Switch some page set from user_agent fields to coresponding shared_state classes
[chromium-blink-merge.git] / net / proxy / proxy_service_v8.cc
blob3634613ccde6503f4c3bf61f83d922dfd2469b3d
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
3 // found in the LICENSE file.
5 #include "net/proxy/proxy_service_v8.h"
7 #include "base/logging.h"
8 #include "base/thread_task_runner_handle.h"
9 #include "base/threading/thread_checker.h"
10 #include "net/proxy/network_delegate_error_observer.h"
11 #include "net/proxy/proxy_resolver.h"
12 #include "net/proxy/proxy_resolver_factory.h"
13 #include "net/proxy/proxy_resolver_v8_tracing.h"
14 #include "net/proxy/proxy_service.h"
16 namespace net {
18 // static
19 ProxyService* CreateProxyServiceUsingV8ProxyResolver(
20 ProxyConfigService* proxy_config_service,
21 ProxyScriptFetcher* proxy_script_fetcher,
22 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher,
23 HostResolver* host_resolver,
24 NetLog* net_log,
25 NetworkDelegate* network_delegate) {
26 DCHECK(proxy_config_service);
27 DCHECK(proxy_script_fetcher);
28 DCHECK(dhcp_proxy_script_fetcher);
29 DCHECK(host_resolver);
31 ProxyService* proxy_service = new ProxyService(
32 proxy_config_service,
33 make_scoped_ptr(new ProxyResolverFactoryV8Tracing(
34 host_resolver, net_log, ProxyResolver::LoadStateChangedCallback(),
35 base::Bind(&NetworkDelegateErrorObserver::Create, network_delegate,
36 base::ThreadTaskRunnerHandle::Get()))),
37 net_log);
39 // Configure fetchers to use for PAC script downloads and auto-detect.
40 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher,
41 dhcp_proxy_script_fetcher);
43 return proxy_service;
46 } // namespace net