• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc
2index 6df863b5fbc90..6b98a515af9f8 100644
3--- content/browser/storage_partition_impl.cc
4+++ content/browser/storage_partition_impl.cc
5@@ -490,10 +490,6 @@ class LoginHandlerDelegate {
6     }
7
8     WebContents* web_contents = web_contents_getter_.Run();
9-    if (!web_contents) {
10-      OnAuthCredentials(absl::nullopt);
11-      return;
12-    }
13
14     // WeakPtr is not strictly necessary here due to OnRequestCancelled.
15     creating_login_delegate_ = true;
16@@ -545,12 +541,6 @@ void OnAuthRequiredContinuation(
17     mojo::PendingRemote<network::mojom::AuthChallengeResponder>
18         auth_challenge_responder,
19     base::RepeatingCallback<WebContents*(void)> web_contents_getter) {
20-  if (!web_contents_getter || !web_contents_getter.Run()) {
21-    mojo::Remote<network::mojom::AuthChallengeResponder>
22-        auth_challenge_responder_remote(std::move(auth_challenge_responder));
23-    auth_challenge_responder_remote->OnAuthCredentials(absl::nullopt);
24-    return;
25-  }
26   new LoginHandlerDelegate(
27       std::move(auth_challenge_responder), std::move(web_contents_getter),
28       auth_info, is_request_for_primary_main_frame, process_id, request_id, url,
29@@ -2729,8 +2719,12 @@ void StoragePartitionImpl::GetQuotaSettings(
30     return;
31   }
32
33+  // CEF always returns false for IsOffTheRecord(), so also check the path.
34+  const bool is_incognito = browser_context_->IsOffTheRecord() ||
35+                            browser_context_->GetPath().empty();
36+
37   storage::GetNominalDynamicSettings(
38-      GetPath(), browser_context_->IsOffTheRecord(),
39+      GetPath(), is_incognito,
40       storage::GetDefaultDeviceInfoHelper(), std::move(callback));
41 }
42
43@@ -2740,9 +2734,12 @@ void StoragePartitionImpl::InitNetworkContext() {
44   cert_verifier::mojom::CertVerifierCreationParamsPtr
45       cert_verifier_creation_params =
46           cert_verifier::mojom::CertVerifierCreationParams::New();
47-  GetContentClient()->browser()->ConfigureNetworkContextParams(
48+  if (!GetContentClient()->browser()->ConfigureNetworkContextParams(
49       browser_context_, is_in_memory(), relative_partition_path_,
50-      context_params.get(), cert_verifier_creation_params.get());
51+      context_params.get(), cert_verifier_creation_params.get())) {
52+    // Don't re-initialize the network context during shutdown.
53+    return;
54+  }
55   // Should be initialized with existing per-profile CORS access lists.
56   DCHECK(context_params->cors_origin_access_list.empty())
57       << "NetworkContextParams::cors_origin_access_list should be populated "
58