Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2184)

Unified Diff: chrome/browser/io_thread.cc

Issue 2960713002: Restore calls to set cert fetcher on some platforms. (Closed)
Patch Set: Oops Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 050d4e8311d6af9231ef23080b74412b5a456d22..4d9f63bcea991bf5cff72c976e8d66d3132e8197 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -181,34 +181,6 @@ base::FilePath GetSSLKeyLogFile(const base::CommandLine& command_line) {
#endif
}
-// Used for the "system" URLRequestContext.
-class SystemURLRequestContext : public net::URLRequestContext {
- public:
- SystemURLRequestContext() {
-#if defined(USE_NSS_CERTS)
- net::SetURLRequestContextForNSSHttpIO(this);
-#endif
-#if defined(OS_ANDROID)
- net::CertVerifyProcAndroid::SetCertNetFetcher(
- net::CreateCertNetFetcher(this));
-#endif
- }
-
- ~SystemURLRequestContext() override {
- AssertNoURLRequests();
-#if defined(USE_NSS_CERTS)
- net::SetURLRequestContextForNSSHttpIO(NULL);
-#endif
-
-#if defined(OS_ANDROID)
- net::CertVerifyProcAndroid::ShutdownCertNetFetcher();
-#endif
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SystemURLRequestContext);
-};
-
std::unique_ptr<net::HostResolver> CreateGlobalHostResolver(
net::NetLog* net_log) {
TRACE_EVENT0("startup", "IOThread::CreateGlobalHostResolver");
@@ -644,9 +616,18 @@ void IOThread::CleanUp() {
ct_tree_tracker_.reset();
}
- if (globals_->system_request_context)
+ if (globals_->system_request_context) {
globals_->system_request_context->proxy_service()->OnShutdown();
+#if defined(USE_NSS_CERTS)
+ net::SetURLRequestContextForNSSHttpIO(nullptr);
+#endif
+
+#if defined(OS_ANDROID)
+ net::CertVerifyProcAndroid::ShutdownCertNetFetcher();
+#endif
+ }
+
// Release objects that the net::URLRequestContext could have been pointing
// to.
@@ -887,6 +868,14 @@ void IOThread::ConstructSystemRequestContext() {
builder.DisableHttpCache();
globals_->system_request_context = builder.Build();
+
+#if defined(USE_NSS_CERTS)
+ net::SetURLRequestContextForNSSHttpIO(globals_->system_request_context.get());
+#endif
+#if defined(OS_ANDROID)
+ net::CertVerifyProcAndroid::SetCertNetFetcher(
+ net::CreateCertNetFetcher(globals_->system_request_context.get()));
+#endif
}
// static
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698