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 #include "content/browser/resolve_proxy_msg_helper.h" | 5 #include "content/browser/resolve_proxy_msg_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/url_request/url_request_context.h" | 12 #include "net/url_request/url_request_context.h" |
13 #include "net/url_request/url_request_context_getter.h" | 13 #include "net/url_request/url_request_context_getter.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
| 16 namespace { |
| 17 const uint32 kFilteredMessageClasses[] = { |
| 18 ViewMsgStart |
| 19 }; |
| 20 } // namespace |
16 | 21 |
17 ResolveProxyMsgHelper::ResolveProxyMsgHelper( | 22 ResolveProxyMsgHelper::ResolveProxyMsgHelper( |
18 net::URLRequestContextGetter* getter) | 23 net::URLRequestContextGetter* getter) |
19 : context_getter_(getter), | 24 : BrowserMessageFilter( |
| 25 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)), |
| 26 context_getter_(getter), |
20 proxy_service_(NULL) { | 27 proxy_service_(NULL) { |
21 } | 28 } |
22 | 29 |
23 ResolveProxyMsgHelper::ResolveProxyMsgHelper(net::ProxyService* proxy_service) | 30 ResolveProxyMsgHelper::ResolveProxyMsgHelper(net::ProxyService* proxy_service) |
24 : proxy_service_(proxy_service) { | 31 : BrowserMessageFilter( |
| 32 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)), |
| 33 proxy_service_(proxy_service) { |
25 } | 34 } |
26 | 35 |
27 bool ResolveProxyMsgHelper::OnMessageReceived(const IPC::Message& message, | 36 bool ResolveProxyMsgHelper::OnMessageReceived(const IPC::Message& message, |
28 bool* message_was_ok) { | 37 bool* message_was_ok) { |
29 bool handled = true; | 38 bool handled = true; |
30 IPC_BEGIN_MESSAGE_MAP_EX(ResolveProxyMsgHelper, message, *message_was_ok) | 39 IPC_BEGIN_MESSAGE_MAP_EX(ResolveProxyMsgHelper, message, *message_was_ok) |
31 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ResolveProxy, OnResolveProxy) | 40 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ResolveProxy, OnResolveProxy) |
32 IPC_MESSAGE_UNHANDLED(handled = false) | 41 IPC_MESSAGE_UNHANDLED(handled = false) |
33 IPC_END_MESSAGE_MAP() | 42 IPC_END_MESSAGE_MAP() |
34 return handled; | 43 return handled; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 base::Bind(&ResolveProxyMsgHelper::OnResolveProxyCompleted, | 103 base::Bind(&ResolveProxyMsgHelper::OnResolveProxyCompleted, |
95 base::Unretained(this)), | 104 base::Unretained(this)), |
96 &req.pac_req, net::BoundNetLog()); | 105 &req.pac_req, net::BoundNetLog()); |
97 | 106 |
98 // Completed synchronously. | 107 // Completed synchronously. |
99 if (result != net::ERR_IO_PENDING) | 108 if (result != net::ERR_IO_PENDING) |
100 OnResolveProxyCompleted(result); | 109 OnResolveProxyCompleted(result); |
101 } | 110 } |
102 | 111 |
103 } // namespace content | 112 } // namespace content |
OLD | NEW |