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

Side by Side Diff: chrome/browser/net/proxy_service_factory.cc

Issue 2030193004: Add a policy for disabling the stripping of PAC URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/proxy_service_factory.h" 5 #include "chrome/browser/net/proxy_service_factory.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #endif // defined(OS_CHROMEOS) 110 #endif // defined(OS_CHROMEOS)
111 } 111 }
112 112
113 // static 113 // static
114 std::unique_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService( 114 std::unique_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService(
115 net::NetLog* net_log, 115 net::NetLog* net_log,
116 net::URLRequestContext* context, 116 net::URLRequestContext* context,
117 net::NetworkDelegate* network_delegate, 117 net::NetworkDelegate* network_delegate,
118 std::unique_ptr<net::ProxyConfigService> proxy_config_service, 118 std::unique_ptr<net::ProxyConfigService> proxy_config_service,
119 const base::CommandLine& command_line, 119 const base::CommandLine& command_line,
120 bool quick_check_enabled) { 120 bool quick_check_enabled,
121 bool pac_https_url_stripping_enabled) {
121 DCHECK_CURRENTLY_ON(BrowserThread::IO); 122 DCHECK_CURRENTLY_ON(BrowserThread::IO);
122 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver); 123 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver);
123 // TODO(eroman): Figure out why this doesn't work in single-process mode. 124 // TODO(eroman): Figure out why this doesn't work in single-process mode.
124 // Should be possible now that a private isolate is used. 125 // Should be possible now that a private isolate is used.
125 // http://crbug.com/474654 126 // http://crbug.com/474654
126 if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) { 127 if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) {
127 LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode."; 128 LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode.";
128 use_v8 = false; // Fallback to non-v8 implementation. 129 use_v8 = false; // Fallback to non-v8 implementation.
129 } 130 }
130 131
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 new net::ProxyScriptFetcherImpl(context), 181 new net::ProxyScriptFetcherImpl(context),
181 std::move(dhcp_proxy_script_fetcher), context->host_resolver(), 182 std::move(dhcp_proxy_script_fetcher), context->host_resolver(),
182 net_log, network_delegate); 183 net_log, network_delegate);
183 } 184 }
184 } else { 185 } else {
185 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( 186 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver(
186 std::move(proxy_config_service), num_pac_threads, net_log); 187 std::move(proxy_config_service), num_pac_threads, net_log);
187 } 188 }
188 189
189 proxy_service->set_quick_check_enabled(quick_check_enabled); 190 proxy_service->set_quick_check_enabled(quick_check_enabled);
190 191 proxy_service->set_sanitize_url_policy(
191 if (command_line.HasSwitch(switches::kUnsafePacUrl)) { 192 pac_https_url_stripping_enabled
192 proxy_service->set_sanitize_url_policy( 193 ? net::ProxyService::SanitizeUrlPolicy::SAFE
193 net::ProxyService::SanitizeUrlPolicy::UNSAFE); 194 : net::ProxyService::SanitizeUrlPolicy::UNSAFE);
194 }
195 195
196 return proxy_service; 196 return proxy_service;
197 } 197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698