| 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 <utility> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 10 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 11 #include "net/proxy/network_delegate_error_observer.h" | 13 #include "net/proxy/network_delegate_error_observer.h" |
| 12 #include "net/proxy/proxy_resolver.h" | 14 #include "net/proxy/proxy_resolver.h" |
| 13 #include "net/proxy/proxy_resolver_factory.h" | 15 #include "net/proxy/proxy_resolver_factory.h" |
| 14 #include "net/proxy/proxy_resolver_v8_tracing_wrapper.h" | 16 #include "net/proxy/proxy_resolver_v8_tracing_wrapper.h" |
| 15 #include "net/proxy/proxy_service.h" | 17 #include "net/proxy/proxy_service.h" |
| 16 | 18 |
| 17 namespace net { | 19 namespace net { |
| 18 | 20 |
| 19 // static | 21 // static |
| 20 scoped_ptr<ProxyService> CreateProxyServiceUsingV8ProxyResolver( | 22 scoped_ptr<ProxyService> CreateProxyServiceUsingV8ProxyResolver( |
| 21 scoped_ptr<ProxyConfigService> proxy_config_service, | 23 scoped_ptr<ProxyConfigService> proxy_config_service, |
| 22 ProxyScriptFetcher* proxy_script_fetcher, | 24 ProxyScriptFetcher* proxy_script_fetcher, |
| 23 scoped_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher, | 25 scoped_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher, |
| 24 HostResolver* host_resolver, | 26 HostResolver* host_resolver, |
| 25 NetLog* net_log, | 27 NetLog* net_log, |
| 26 NetworkDelegate* network_delegate) { | 28 NetworkDelegate* network_delegate) { |
| 27 DCHECK(proxy_config_service); | 29 DCHECK(proxy_config_service); |
| 28 DCHECK(proxy_script_fetcher); | 30 DCHECK(proxy_script_fetcher); |
| 29 DCHECK(dhcp_proxy_script_fetcher); | 31 DCHECK(dhcp_proxy_script_fetcher); |
| 30 DCHECK(host_resolver); | 32 DCHECK(host_resolver); |
| 31 | 33 |
| 32 scoped_ptr<ProxyService> proxy_service(new ProxyService( | 34 scoped_ptr<ProxyService> proxy_service(new ProxyService( |
| 33 proxy_config_service.Pass(), | 35 std::move(proxy_config_service), |
| 34 make_scoped_ptr(new ProxyResolverFactoryV8TracingWrapper( | 36 make_scoped_ptr(new ProxyResolverFactoryV8TracingWrapper( |
| 35 host_resolver, net_log, | 37 host_resolver, net_log, |
| 36 base::Bind(&NetworkDelegateErrorObserver::Create, network_delegate, | 38 base::Bind(&NetworkDelegateErrorObserver::Create, network_delegate, |
| 37 base::ThreadTaskRunnerHandle::Get()))), | 39 base::ThreadTaskRunnerHandle::Get()))), |
| 38 net_log)); | 40 net_log)); |
| 39 | 41 |
| 40 // Configure fetchers to use for PAC script downloads and auto-detect. | 42 // Configure fetchers to use for PAC script downloads and auto-detect. |
| 41 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher, | 43 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher, |
| 42 dhcp_proxy_script_fetcher.Pass()); | 44 std::move(dhcp_proxy_script_fetcher)); |
| 43 | 45 |
| 44 return proxy_service; | 46 return proxy_service; |
| 45 } | 47 } |
| 46 | 48 |
| 47 } // namespace net | 49 } // namespace net |
| OLD | NEW |