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

Side by Side Diff: net/proxy/proxy_service.h

Issue 10912132: Move ProxyConfigService construction onto the IO thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust comments Created 8 years, 2 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 | Annotate | Revision Log
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 #ifndef NET_PROXY_PROXY_SERVICE_H_ 5 #ifndef NET_PROXY_PROXY_SERVICE_H_
6 #define NET_PROXY_PROXY_SERVICE_H_ 6 #define NET_PROXY_PROXY_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // Clears the list of bad proxy servers that has been cached. 194 // Clears the list of bad proxy servers that has been cached.
195 void ClearBadProxiesCache() { 195 void ClearBadProxiesCache() {
196 proxy_retry_info_.clear(); 196 proxy_retry_info_.clear();
197 } 197 }
198 198
199 // Forces refetching the proxy configuration, and applying it. 199 // Forces refetching the proxy configuration, and applying it.
200 // This re-does everything from fetching the system configuration, 200 // This re-does everything from fetching the system configuration,
201 // to downloading and testing the PAC files. 201 // to downloading and testing the PAC files.
202 void ForceReloadProxyConfig(); 202 void ForceReloadProxyConfig();
203 203
204 // Give ProxyConfigService a chance to perform shutdown work.
205 void StartTearDown();
206
204 // Same as CreateProxyServiceUsingV8ProxyResolver, except it uses system 207 // Same as CreateProxyServiceUsingV8ProxyResolver, except it uses system
205 // libraries for evaluating the PAC script if available, otherwise skips 208 // libraries for evaluating the PAC script if available, otherwise skips
206 // proxy autoconfig. 209 // proxy autoconfig.
207 static ProxyService* CreateUsingSystemProxyResolver( 210 static ProxyService* CreateUsingSystemProxyResolver(
208 ProxyConfigService* proxy_config_service, 211 ProxyConfigService* proxy_config_service,
209 size_t num_pac_threads, 212 size_t num_pac_threads,
210 NetLog* net_log); 213 NetLog* net_log);
211 214
212 // Creates a ProxyService without support for proxy autoconfig. 215 // Creates a ProxyService without support for proxy autoconfig.
213 static ProxyService* CreateWithoutProxyResolver( 216 static ProxyService* CreateWithoutProxyResolver(
(...skipping 13 matching lines...) Expand all
227 // This method is used by tests to create a ProxyService that returns a 230 // This method is used by tests to create a ProxyService that returns a
228 // hardcoded proxy fallback list (|pac_string|) for every URL. 231 // hardcoded proxy fallback list (|pac_string|) for every URL.
229 // 232 //
230 // |pac_string| is a list of proxy servers, in the format that a PAC script 233 // |pac_string| is a list of proxy servers, in the format that a PAC script
231 // would return it. For example, "PROXY foobar:99; SOCKS fml:2; DIRECT" 234 // would return it. For example, "PROXY foobar:99; SOCKS fml:2; DIRECT"
232 static ProxyService* CreateFixedFromPacResult(const std::string& pac_string); 235 static ProxyService* CreateFixedFromPacResult(const std::string& pac_string);
233 236
234 // Creates a config service appropriate for this platform that fetches the 237 // Creates a config service appropriate for this platform that fetches the
235 // system proxy settings. 238 // system proxy settings.
236 static ProxyConfigService* CreateSystemProxyConfigService( 239 static ProxyConfigService* CreateSystemProxyConfigService(
237 base::SingleThreadTaskRunner* io_thread_task_runner, 240 base::SingleThreadTaskRunner* glib_thread_task_runner,
digit1 2012/10/19 10:32:46 Probably use main_thread_task_runner here.
238 MessageLoop* file_loop); 241 MessageLoop* file_loop);
239 242
240 // This method should only be used by unit tests. 243 // This method should only be used by unit tests.
241 void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { 244 void set_stall_proxy_auto_config_delay(base::TimeDelta delay) {
242 stall_proxy_auto_config_delay_ = delay; 245 stall_proxy_auto_config_delay_ = delay;
243 } 246 }
244 247
245 // This method should only be used by unit tests. Returns the previously 248 // This method should only be used by unit tests. Returns the previously
246 // active policy. 249 // active policy.
247 static const PacPollPolicy* set_pac_script_poll_policy( 250 static const PacPollPolicy* set_pac_script_poll_policy(
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 429
427 base::WaitableEvent event_; 430 base::WaitableEvent event_;
428 CompletionCallback callback_; 431 CompletionCallback callback_;
429 ProxyInfo proxy_info_; 432 ProxyInfo proxy_info_;
430 int result_; 433 int result_;
431 }; 434 };
432 435
433 } // namespace net 436 } // namespace net
434 437
435 #endif // NET_PROXY_PROXY_SERVICE_H_ 438 #endif // NET_PROXY_PROXY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698