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/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 PrefService* pref_service) { | 68 PrefService* pref_service) { |
69 return new PrefProxyConfigTrackerImpl(pref_service); | 69 return new PrefProxyConfigTrackerImpl(pref_service); |
70 } | 70 } |
71 #endif // defined(OS_CHROMEOS) | 71 #endif // defined(OS_CHROMEOS) |
72 | 72 |
73 // static | 73 // static |
74 net::ProxyService* ProxyServiceFactory::CreateProxyService( | 74 net::ProxyService* ProxyServiceFactory::CreateProxyService( |
75 net::NetLog* net_log, | 75 net::NetLog* net_log, |
76 net::URLRequestContext* context, | 76 net::URLRequestContext* context, |
77 net::ProxyConfigService* proxy_config_service, | 77 net::ProxyConfigService* proxy_config_service, |
| 78 v8::Isolate* v8_default_isolate, |
78 const CommandLine& command_line) { | 79 const CommandLine& command_line) { |
79 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 80 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
80 | 81 |
81 #if defined(OS_IOS) | 82 #if defined(OS_IOS) |
82 bool use_v8 = false; | 83 bool use_v8 = false; |
83 #else | 84 #else |
84 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver); | 85 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver); |
85 if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) { | 86 if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) { |
86 // See the note about V8 multithreading in net/proxy/proxy_resolver_v8.h | 87 // See the note about V8 multithreading in net/proxy/proxy_resolver_v8.h |
87 // to understand why we have this limitation. | 88 // to understand why we have this limitation. |
(...skipping 28 matching lines...) Expand all Loading... |
116 dhcp_factory.set_enabled(false); | 117 dhcp_factory.set_enabled(false); |
117 } | 118 } |
118 | 119 |
119 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( | 120 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( |
120 proxy_config_service, | 121 proxy_config_service, |
121 num_pac_threads, | 122 num_pac_threads, |
122 new net::ProxyScriptFetcherImpl(context), | 123 new net::ProxyScriptFetcherImpl(context), |
123 dhcp_factory.Create(context), | 124 dhcp_factory.Create(context), |
124 context->host_resolver(), | 125 context->host_resolver(), |
125 net_log, | 126 net_log, |
126 context->network_delegate()); | 127 context->network_delegate(), |
| 128 v8_default_isolate); |
127 #endif // defined(OS_IOS) | 129 #endif // defined(OS_IOS) |
128 } else { | 130 } else { |
129 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 131 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
130 proxy_config_service, | 132 proxy_config_service, |
131 num_pac_threads, | 133 num_pac_threads, |
132 net_log); | 134 net_log); |
133 } | 135 } |
134 | 136 |
135 return proxy_service; | 137 return proxy_service; |
136 } | 138 } |
OLD | NEW |