| 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 |
| 11 #include "base/ref_counted.h" |
| 11 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 12 #include "ipc/ipc_message.h" | 13 #include "ipc/ipc_message.h" |
| 13 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
| 14 #include "net/proxy/proxy_service.h" | 15 #include "net/proxy/proxy_service.h" |
| 15 | 16 |
| 16 // This class holds the common logic used to respond to the messages: | 17 // This class holds the common logic used to respond to the messages: |
| 17 // {PluginProcessHostMsg_ResolveProxy, ViewHostMsg_ResolveProxy}. | 18 // {PluginProcessHostMsg_ResolveProxy, ViewHostMsg_ResolveProxy}. |
| 18 // | 19 // |
| 19 // This involves kicking off a ProxyResolve request on the IO thread using | 20 // This involves kicking off a ProxyResolve request on the IO thread using |
| 20 // the specified proxy service. | 21 // the specified proxy service. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 GURL url; | 78 GURL url; |
| 78 | 79 |
| 79 // Data to pass back to the delegate on completion (we own it until then). | 80 // Data to pass back to the delegate on completion (we own it until then). |
| 80 IPC::Message* reply_msg; | 81 IPC::Message* reply_msg; |
| 81 | 82 |
| 82 // Handle for cancelling the current request if it has started (else NULL). | 83 // Handle for cancelling the current request if it has started (else NULL). |
| 83 net::ProxyService::PacRequest* pac_req; | 84 net::ProxyService::PacRequest* pac_req; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 // Members for the current outstanding proxy request. | 87 // Members for the current outstanding proxy request. |
| 87 net::ProxyService* proxy_service_; | 88 scoped_refptr<net::ProxyService> proxy_service_; |
| 88 net::CompletionCallbackImpl<ResolveProxyMsgHelper> callback_; | 89 net::CompletionCallbackImpl<ResolveProxyMsgHelper> callback_; |
| 89 net::ProxyInfo proxy_info_; | 90 net::ProxyInfo proxy_info_; |
| 90 | 91 |
| 91 // FIFO queue of pending requests. The first entry is always the current one. | 92 // FIFO queue of pending requests. The first entry is always the current one. |
| 92 typedef std::deque<PendingRequest> PendingRequestList; | 93 typedef std::deque<PendingRequest> PendingRequestList; |
| 93 PendingRequestList pending_requests_; | 94 PendingRequestList pending_requests_; |
| 94 | 95 |
| 95 Delegate* delegate_; | 96 Delegate* delegate_; |
| 96 | 97 |
| 97 // Specified by unit-tests, to use this proxy service in place of the | 98 // Specified by unit-tests, to use this proxy service in place of the |
| 98 // global one. | 99 // global one. |
| 99 net::ProxyService* proxy_service_override_; | 100 scoped_refptr<net::ProxyService> proxy_service_override_; |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 #endif // CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ | 103 #endif // CHROME_BROWSER_NET_RESOLVE_PROXY_MSG_HELPER_ |
| OLD | NEW |