| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ | 5 #ifndef CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ |
| 6 #define CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ | 6 #define CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 virtual void OnResolveProxyCompleted(IPC::Message* reply_msg, | 39 virtual void OnResolveProxyCompleted(IPC::Message* reply_msg, |
| 40 int result, | 40 int result, |
| 41 const std::string& proxy_list) = 0; | 41 const std::string& proxy_list) = 0; |
| 42 virtual ~Delegate() {} | 42 virtual ~Delegate() {} |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // Construct a ResolveProxyMsgHelper instance that notifies request | 45 // Construct a ResolveProxyMsgHelper instance that notifies request |
| 46 // completion to |delegate|. Note that |delegate| must be live throughout | 46 // completion to |delegate|. Note that |delegate| must be live throughout |
| 47 // our lifespan. If |proxy_service| is NULL, then the current profile's | 47 // our lifespan. If |proxy_service| is NULL, then the current profile's |
| 48 // proxy service will be used. | 48 // proxy service will be used. |
| 49 explicit ResolveProxyMsgHelper(Delegate* delegate, | 49 ResolveProxyMsgHelper(Delegate* delegate, net::ProxyService* proxy_service); |
| 50 net::ProxyService* proxy_service); | |
| 51 | 50 |
| 52 // Resolve proxies for |url|. Completion is notified through the delegate. | 51 // Resolve proxies for |url|. Completion is notified through the delegate. |
| 53 // If multiple requests are started at the same time, they will run in | 52 // If multiple requests are started at the same time, they will run in |
| 54 // FIFO order, with only 1 being outstanding at a time. | 53 // FIFO order, with only 1 being outstanding at a time. |
| 55 void Start(const GURL& url, IPC::Message* reply_msg); | 54 void Start(const GURL& url, IPC::Message* reply_msg); |
| 56 | 55 |
| 57 // Destruction cancels the current outstanding request, and clears the | 56 // Destruction cancels the current outstanding request, and clears the |
| 58 // pending queue. | 57 // pending queue. |
| 59 ~ResolveProxyMsgHelper(); | 58 ~ResolveProxyMsgHelper(); |
| 60 | 59 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 PendingRequestList pending_requests_; | 93 PendingRequestList pending_requests_; |
| 95 | 94 |
| 96 Delegate* delegate_; | 95 Delegate* delegate_; |
| 97 | 96 |
| 98 // Specified by unit-tests, to use this proxy service in place of the | 97 // Specified by unit-tests, to use this proxy service in place of the |
| 99 // global one. | 98 // global one. |
| 100 net::ProxyService* proxy_service_override_; | 99 net::ProxyService* proxy_service_override_; |
| 101 }; | 100 }; |
| 102 | 101 |
| 103 #endif // CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ | 102 #endif // CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ |
| OLD | NEW |