| OLD | NEW |
| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/profiler/scoped_tracker.h" |
| 8 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 10 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/io_thread.h" | 12 #include "chrome/browser/io_thread.h" |
| 12 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" | 13 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" |
| 13 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 15 #include "net/base/net_log.h" | 16 #include "net/base/net_log.h" |
| 16 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" | 17 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" |
| 17 #include "net/proxy/proxy_config_service.h" | 18 #include "net/proxy/proxy_config_service.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // static | 88 // static |
| 88 net::ProxyService* ProxyServiceFactory::CreateProxyService( | 89 net::ProxyService* ProxyServiceFactory::CreateProxyService( |
| 89 net::NetLog* net_log, | 90 net::NetLog* net_log, |
| 90 net::URLRequestContext* context, | 91 net::URLRequestContext* context, |
| 91 net::NetworkDelegate* network_delegate, | 92 net::NetworkDelegate* network_delegate, |
| 92 net::ProxyConfigService* proxy_config_service, | 93 net::ProxyConfigService* proxy_config_service, |
| 93 const base::CommandLine& command_line, | 94 const base::CommandLine& command_line, |
| 94 bool quick_check_enabled) { | 95 bool quick_check_enabled) { |
| 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 96 | 97 |
| 98 // TODO(michaeln): Remove ScopedTracker below once crbug.com/454983 is fixed. |
| 99 tracked_objects::ScopedTracker tracking_profile( |
| 100 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 101 "454983 ProxyServiceFactory::CreateProxyService")); |
| 102 |
| 97 #if defined(OS_IOS) | 103 #if defined(OS_IOS) |
| 98 bool use_v8 = false; | 104 bool use_v8 = false; |
| 99 #else | 105 #else |
| 100 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver); | 106 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver); |
| 101 if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) { | 107 if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) { |
| 102 // See the note about V8 multithreading in net/proxy/proxy_resolver_v8.h | 108 // See the note about V8 multithreading in net/proxy/proxy_resolver_v8.h |
| 103 // to understand why we have this limitation. | 109 // to understand why we have this limitation. |
| 104 LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode."; | 110 LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode."; |
| 105 use_v8 = false; // Fallback to non-v8 implementation. | 111 use_v8 = false; // Fallback to non-v8 implementation. |
| 106 } | 112 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 156 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
| 151 proxy_config_service, | 157 proxy_config_service, |
| 152 num_pac_threads, | 158 num_pac_threads, |
| 153 net_log); | 159 net_log); |
| 154 } | 160 } |
| 155 | 161 |
| 156 proxy_service->set_quick_check_enabled(quick_check_enabled); | 162 proxy_service->set_quick_check_enabled(quick_check_enabled); |
| 157 | 163 |
| 158 return proxy_service; | 164 return proxy_service; |
| 159 } | 165 } |
| OLD | NEW |