| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // which expects requests to finish in the order they were added. | 210 // which expects requests to finish in the order they were added. |
| 211 typedef std::vector<scoped_refptr<PacRequest> > PendingRequests; | 211 typedef std::vector<scoped_refptr<PacRequest> > PendingRequests; |
| 212 | 212 |
| 213 enum State { | 213 enum State { |
| 214 STATE_NONE, | 214 STATE_NONE, |
| 215 STATE_WAITING_FOR_PROXY_CONFIG, | 215 STATE_WAITING_FOR_PROXY_CONFIG, |
| 216 STATE_WAITING_FOR_INIT_PROXY_RESOLVER, | 216 STATE_WAITING_FOR_INIT_PROXY_RESOLVER, |
| 217 STATE_READY, | 217 STATE_READY, |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 ~ProxyService(); | 220 virtual ~ProxyService(); |
| 221 | 221 |
| 222 // Resets all the variables associated with the current proxy configuration, | 222 // Resets all the variables associated with the current proxy configuration, |
| 223 // and rewinds the current state to |STATE_NONE|. Returns the previous value | 223 // and rewinds the current state to |STATE_NONE|. Returns the previous value |
| 224 // of |current_state_|. If |reset_fetched_config| is true then | 224 // of |current_state_|. If |reset_fetched_config| is true then |
| 225 // |fetched_config_| will also be reset, otherwise it will be left as-is. | 225 // |fetched_config_| will also be reset, otherwise it will be left as-is. |
| 226 // Resetting it means that we will have to re-fetch the configuration from | 226 // Resetting it means that we will have to re-fetch the configuration from |
| 227 // the ProxyConfigService later. | 227 // the ProxyConfigService later. |
| 228 State ResetProxyConfig(bool reset_fetched_config); | 228 State ResetProxyConfig(bool reset_fetched_config); |
| 229 | 229 |
| 230 // Retrieves the current proxy configuration from the ProxyConfigService, and | 230 // Retrieves the current proxy configuration from the ProxyConfigService, and |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 int ResolveProxy(const GURL& url, | 334 int ResolveProxy(const GURL& url, |
| 335 ProxyInfo* proxy_info, | 335 ProxyInfo* proxy_info, |
| 336 const BoundNetLog& net_log); | 336 const BoundNetLog& net_log); |
| 337 int ReconsiderProxyAfterError(const GURL& url, | 337 int ReconsiderProxyAfterError(const GURL& url, |
| 338 ProxyInfo* proxy_info, | 338 ProxyInfo* proxy_info, |
| 339 const BoundNetLog& net_log); | 339 const BoundNetLog& net_log); |
| 340 | 340 |
| 341 private: | 341 private: |
| 342 friend class base::RefCountedThreadSafe<SyncProxyServiceHelper>; | 342 friend class base::RefCountedThreadSafe<SyncProxyServiceHelper>; |
| 343 | 343 |
| 344 ~SyncProxyServiceHelper() {} | 344 virtual ~SyncProxyServiceHelper(); |
| 345 | 345 |
| 346 void StartAsyncResolve(const GURL& url, const BoundNetLog& net_log); | 346 void StartAsyncResolve(const GURL& url, const BoundNetLog& net_log); |
| 347 void StartAsyncReconsider(const GURL& url, const BoundNetLog& net_log); | 347 void StartAsyncReconsider(const GURL& url, const BoundNetLog& net_log); |
| 348 | 348 |
| 349 void OnCompletion(int result); | 349 void OnCompletion(int result); |
| 350 | 350 |
| 351 MessageLoop* io_message_loop_; | 351 MessageLoop* io_message_loop_; |
| 352 ProxyService* proxy_service_; | 352 ProxyService* proxy_service_; |
| 353 | 353 |
| 354 base::WaitableEvent event_; | 354 base::WaitableEvent event_; |
| 355 CompletionCallbackImpl<SyncProxyServiceHelper> callback_; | 355 CompletionCallbackImpl<SyncProxyServiceHelper> callback_; |
| 356 ProxyInfo proxy_info_; | 356 ProxyInfo proxy_info_; |
| 357 int result_; | 357 int result_; |
| 358 }; | 358 }; |
| 359 | 359 |
| 360 } // namespace net | 360 } // namespace net |
| 361 | 361 |
| 362 #endif // NET_PROXY_PROXY_SERVICE_H_ | 362 #endif // NET_PROXY_PROXY_SERVICE_H_ |
| OLD | NEW |