OLD | NEW |
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 CONTENT_BROWSER_RESOLVE_PROXY_MSG_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_RESOLVE_PROXY_MSG_HELPER_H_ |
6 #define CONTENT_BROWSER_RESOLVE_PROXY_MSG_HELPER_H_ | 6 #define CONTENT_BROWSER_RESOLVE_PROXY_MSG_HELPER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // the stored IPC::Message pointers for pending requests. | 31 // the stored IPC::Message pointers for pending requests. |
32 // | 32 // |
33 // This object is expected to live on the IO thread. | 33 // This object is expected to live on the IO thread. |
34 class CONTENT_EXPORT ResolveProxyMsgHelper : public BrowserMessageFilter { | 34 class CONTENT_EXPORT ResolveProxyMsgHelper : public BrowserMessageFilter { |
35 public: | 35 public: |
36 explicit ResolveProxyMsgHelper(net::URLRequestContextGetter* getter); | 36 explicit ResolveProxyMsgHelper(net::URLRequestContextGetter* getter); |
37 // Constructor used by unittests. | 37 // Constructor used by unittests. |
38 explicit ResolveProxyMsgHelper(net::ProxyService* proxy_service); | 38 explicit ResolveProxyMsgHelper(net::ProxyService* proxy_service); |
39 | 39 |
40 // BrowserMessageFilter implementation | 40 // BrowserMessageFilter implementation |
41 virtual bool OnMessageReceived(const IPC::Message& message) override; | 41 bool OnMessageReceived(const IPC::Message& message) override; |
42 | 42 |
43 void OnResolveProxy(const GURL& url, IPC::Message* reply_msg); | 43 void OnResolveProxy(const GURL& url, IPC::Message* reply_msg); |
44 | 44 |
45 protected: | 45 protected: |
46 // Destruction cancels the current outstanding request, and clears the | 46 // Destruction cancels the current outstanding request, and clears the |
47 // pending queue. | 47 // pending queue. |
48 virtual ~ResolveProxyMsgHelper(); | 48 ~ResolveProxyMsgHelper() override; |
49 | 49 |
50 private: | 50 private: |
51 // Callback for the ProxyService (bound to |callback_|). | 51 // Callback for the ProxyService (bound to |callback_|). |
52 void OnResolveProxyCompleted(int result); | 52 void OnResolveProxyCompleted(int result); |
53 | 53 |
54 // Starts the first pending request. | 54 // Starts the first pending request. |
55 void StartPendingRequest(); | 55 void StartPendingRequest(); |
56 | 56 |
57 // A PendingRequest is a resolve request that is in progress, or queued. | 57 // A PendingRequest is a resolve request that is in progress, or queued. |
58 struct PendingRequest { | 58 struct PendingRequest { |
(...skipping 18 matching lines...) Expand all Loading... |
77 typedef std::deque<PendingRequest> PendingRequestList; | 77 typedef std::deque<PendingRequest> PendingRequestList; |
78 PendingRequestList pending_requests_; | 78 PendingRequestList pending_requests_; |
79 | 79 |
80 scoped_refptr<net::URLRequestContextGetter> context_getter_; | 80 scoped_refptr<net::URLRequestContextGetter> context_getter_; |
81 net::ProxyService* proxy_service_; | 81 net::ProxyService* proxy_service_; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace content | 84 } // namespace content |
85 | 85 |
86 #endif // CONTENT_BROWSER_RESOLVE_PROXY_MSG_HELPER_H_ | 86 #endif // CONTENT_BROWSER_RESOLVE_PROXY_MSG_HELPER_H_ |
OLD | NEW |