Index: ios/chrome/browser/ios_chrome_io_thread.mm |
diff --git a/ios/chrome/browser/ios_chrome_io_thread.mm b/ios/chrome/browser/ios_chrome_io_thread.mm |
index ef492dc3b698b1c7b95aeead7c512743dbbc3229..31b5c5a3b6764e10a65935547e4133863181bfed 100644 |
--- a/ios/chrome/browser/ios_chrome_io_thread.mm |
+++ b/ios/chrome/browser/ios_chrome_io_thread.mm |
@@ -140,12 +140,18 @@ const char kNpnTrialDisabledGroupNamePrefix[] = "Disable"; |
// Used for the "system" URLRequestContext. |
class SystemURLRequestContext : public net::URLRequestContext { |
public: |
- SystemURLRequestContext() { net::SetURLRequestContextForNSSHttpIO(this); } |
+ SystemURLRequestContext() { |
+#if defined(USE_NSS_VERIFIER) |
+ net::SetURLRequestContextForNSSHttpIO(this); |
+#endif |
+ } |
private: |
~SystemURLRequestContext() override { |
AssertNoURLRequests(); |
+#if defined(USE_NSS_VERIFIER) |
net::SetURLRequestContextForNSSHttpIO(nullptr); |
+#endif |
} |
}; |
@@ -377,7 +383,9 @@ void IOSChromeIOThread::Init() { |
TRACE_EVENT0("startup", "IOSChromeIOThread::Init"); |
DCHECK_CURRENTLY_ON(web::WebThread::IO); |
+#if defined(USE_NSS_VERIFIER) |
net::SetMessageLoopForNSSHttpIO(); |
+#endif |
const base::CommandLine& command_line = |
*base::CommandLine::ForCurrentProcess(); |
@@ -474,7 +482,9 @@ void IOSChromeIOThread::Init() { |
} |
void IOSChromeIOThread::CleanUp() { |
+#if defined(USE_NSS_VERIFIER) |
net::ShutdownNSSHttpIO(); |
+#endif |
system_url_request_context_getter_ = nullptr; |