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

Unified Diff: chromecast/browser/url_request_context_factory.cc

Issue 2725293003: [Chromecast] Respect "ignore-certificate-errors" in connectivity_checker (Closed)
Patch Set: Get ignore_certificate_errors setting from url_request_ Created 3 years, 10 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 | chromecast/net/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/url_request_context_factory.cc
diff --git a/chromecast/browser/url_request_context_factory.cc b/chromecast/browser/url_request_context_factory.cc
index a7628f1e24256ba35ec3c3ace088d86ca547d582..b6def5f53a86f34d8c379211f4d75bc02d540d9f 100644
--- a/chromecast/browser/url_request_context_factory.cc
+++ b/chromecast/browser/url_request_context_factory.cc
@@ -73,6 +73,11 @@ class IgnoresCTPolicyEnforcer : public net::CTPolicyEnforcer {
}
};
+bool IgnoreCertificateErrors() {
+ base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ return cmd_line->HasSwitch(switches::kIgnoreCertificateErrors);
+}
+
} // namespace
// Private classes to expose URLRequestContextGetter that call back to the
@@ -336,7 +341,7 @@ net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
InitializeSystemContextDependencies();
net::HttpNetworkSession::Params system_params;
- PopulateNetworkSessionParams(false, &system_params);
+ PopulateNetworkSessionParams(IgnoreCertificateErrors(), &system_params);
system_transaction_factory_.reset(new net::HttpNetworkLayer(
new net::HttpNetworkSession(system_params)));
system_job_factory_.reset(new net::URLRequestJobFactoryImpl());
@@ -392,13 +397,8 @@ net::URLRequestContext* URLRequestContextFactory::CreateMainRequestContext(
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
InitializeSystemContextDependencies();
- bool ignore_certificate_errors = false;
- base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
- if (cmd_line->HasSwitch(switches::kIgnoreCertificateErrors)) {
- ignore_certificate_errors = true;
- }
net::HttpNetworkSession::Params network_session_params;
- PopulateNetworkSessionParams(ignore_certificate_errors,
+ PopulateNetworkSessionParams(IgnoreCertificateErrors(),
&network_session_params);
InitializeMainContextDependencies(
new net::HttpNetworkLayer(
« no previous file with comments | « no previous file | chromecast/net/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698