Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: chrome/browser/net/proxy_service_factory.cc

Issue 1296663003: Componentize proxy code from chrome/browser/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updating for win p/f Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/io_thread.h" 14 #include "chrome/browser/io_thread.h"
15 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h"
16 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
16 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "net/log/net_log.h" 18 #include "net/log/net_log.h"
19 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" 19 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
20 #include "net/proxy/proxy_config_service.h" 20 #include "net/proxy/proxy_config_service.h"
21 #include "net/proxy/proxy_script_fetcher_impl.h" 21 #include "net/proxy/proxy_script_fetcher_impl.h"
22 #include "net/proxy/proxy_service.h" 22 #include "net/proxy/proxy_service.h"
23 #include "net/proxy/proxy_service_v8.h" 23 #include "net/proxy/proxy_service_v8.h"
24 #include "net/url_request/url_request_context.h" 24 #include "net/url_request/url_request_context.h"
25 25
26 #if defined(OS_CHROMEOS) 26 #if defined(OS_CHROMEOS)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 // static 89 // static
90 PrefProxyConfigTracker* 90 PrefProxyConfigTracker*
91 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 91 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
92 PrefService* profile_prefs, 92 PrefService* profile_prefs,
93 PrefService* local_state_prefs) { 93 PrefService* local_state_prefs) {
94 #if defined(OS_CHROMEOS) 94 #if defined(OS_CHROMEOS)
95 return new chromeos::ProxyConfigServiceImpl(profile_prefs, local_state_prefs); 95 return new chromeos::ProxyConfigServiceImpl(profile_prefs, local_state_prefs);
96 #else 96 #else
97 return new PrefProxyConfigTrackerImpl(profile_prefs); 97 return new PrefProxyConfigTrackerImpl(
98 profile_prefs,
99 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
98 #endif // defined(OS_CHROMEOS) 100 #endif // defined(OS_CHROMEOS)
99 } 101 }
100 102
101 // static 103 // static
102 PrefProxyConfigTracker* 104 PrefProxyConfigTracker*
103 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 105 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
104 PrefService* local_state_prefs) { 106 PrefService* local_state_prefs) {
105 #if defined(OS_CHROMEOS) 107 #if defined(OS_CHROMEOS)
106 return new chromeos::ProxyConfigServiceImpl(NULL, local_state_prefs); 108 return new chromeos::ProxyConfigServiceImpl(NULL, local_state_prefs);
107 #else 109 #else
108 return new PrefProxyConfigTrackerImpl(local_state_prefs); 110 return new PrefProxyConfigTrackerImpl(
111 local_state_prefs,
112 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
109 #endif // defined(OS_CHROMEOS) 113 #endif // defined(OS_CHROMEOS)
110 } 114 }
111 115
112 // static 116 // static
113 net::ProxyService* ProxyServiceFactory::CreateProxyService( 117 net::ProxyService* ProxyServiceFactory::CreateProxyService(
114 net::NetLog* net_log, 118 net::NetLog* net_log,
115 net::URLRequestContext* context, 119 net::URLRequestContext* context,
116 net::NetworkDelegate* network_delegate, 120 net::NetworkDelegate* network_delegate,
117 net::ProxyConfigService* proxy_config_service, 121 net::ProxyConfigService* proxy_config_service,
118 const base::CommandLine& command_line, 122 const base::CommandLine& command_line,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( 193 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver(
190 proxy_config_service, 194 proxy_config_service,
191 num_pac_threads, 195 num_pac_threads,
192 net_log); 196 net_log);
193 } 197 }
194 198
195 proxy_service->set_quick_check_enabled(quick_check_enabled); 199 proxy_service->set_quick_check_enabled(quick_check_enabled);
196 200
197 return proxy_service; 201 return proxy_service;
198 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698