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 "net/proxy/proxy_service_v8.h" | 5 #include "net/proxy/proxy_service_v8.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/proxy/network_delegate_error_observer.h" | 8 #include "net/proxy/network_delegate_error_observer.h" |
9 #include "net/proxy/proxy_resolver.h" | 9 #include "net/proxy/proxy_resolver.h" |
10 #include "net/proxy/proxy_resolver_v8_tracing.h" | 10 #include "net/proxy/proxy_resolver_v8_tracing.h" |
11 #include "net/proxy/proxy_service.h" | 11 #include "net/proxy/proxy_service.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 // static | 15 // static |
16 ProxyService* CreateProxyServiceUsingV8ProxyResolver( | 16 ProxyService* CreateProxyServiceUsingV8ProxyResolver( |
17 ProxyConfigService* proxy_config_service, | 17 ProxyConfigService* proxy_config_service, |
18 ProxyScriptFetcher* proxy_script_fetcher, | 18 ProxyScriptFetcher* proxy_script_fetcher, |
19 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, | 19 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, |
20 HostResolver* host_resolver, | 20 HostResolver* host_resolver, |
21 NetLog* net_log, | 21 NetLog* net_log, |
22 NetworkDelegate* network_delegate) { | 22 NetworkDelegate* network_delegate) { |
23 DCHECK(proxy_config_service); | 23 DCHECK(proxy_config_service); |
24 DCHECK(proxy_script_fetcher); | 24 DCHECK(proxy_script_fetcher); |
25 DCHECK(dhcp_proxy_script_fetcher); | 25 DCHECK(dhcp_proxy_script_fetcher); |
26 DCHECK(host_resolver); | 26 DCHECK(host_resolver); |
27 | 27 |
28 ProxyResolverErrorObserver* error_observer = | 28 ProxyResolverErrorObserver* error_observer = new NetworkDelegateErrorObserver( |
29 new NetworkDelegateErrorObserver( | 29 network_delegate, base::MessageLoopProxy::current().get()); |
30 network_delegate, base::MessageLoopProxy::current()); | |
31 | 30 |
32 ProxyResolver* proxy_resolver = | 31 ProxyResolver* proxy_resolver = |
33 new ProxyResolverV8Tracing(host_resolver, error_observer, net_log); | 32 new ProxyResolverV8Tracing(host_resolver, error_observer, net_log); |
34 | 33 |
35 ProxyService* proxy_service = | 34 ProxyService* proxy_service = |
36 new ProxyService(proxy_config_service, proxy_resolver, net_log); | 35 new ProxyService(proxy_config_service, proxy_resolver, net_log); |
37 | 36 |
38 // Configure fetchers to use for PAC script downloads and auto-detect. | 37 // Configure fetchers to use for PAC script downloads and auto-detect. |
39 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher, | 38 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher, |
40 dhcp_proxy_script_fetcher); | 39 dhcp_proxy_script_fetcher); |
41 | 40 |
42 return proxy_service; | 41 return proxy_service; |
43 } | 42 } |
44 | 43 |
45 } // namespace net | 44 } // namespace net |
OLD | NEW |