Fix usages of global BrowserContext in App::ImportCertificate
authorCheng Zhao <zcbenz@gmail.com>
Wed, 22 Jun 2016 07:10:36 +0000 (16:10 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 22 Jun 2016 07:10:36 +0000 (16:10 +0900)
atom/browser/api/atom_api_app.cc

index bc29b98..265ed8f 100644 (file)
@@ -463,10 +463,11 @@ void App::DisableHardwareAcceleration(mate::Arguments* args) {
 void App::ImportCertificate(
     const base::DictionaryValue& options,
     const net::CompletionCallback& callback) {
-  auto browser_context = AtomBrowserMainParts::Get()->browser_context();
+  auto browser_context = brightray::BrowserContext::From("", false);
   if (!certificate_manager_model_) {
     std::unique_ptr<base::DictionaryValue> copy = options.CreateDeepCopy();
-    CertificateManagerModel::Create(browser_context,
+    CertificateManagerModel::Create(
+        browser_context.get(),
         base::Bind(&App::OnCertificateManagerModelCreated,
                    base::Unretained(this),
                    base::Passed(&copy),