Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Side by Side Diff: content/browser/renderer_host/p2p/socket_dispatcher_host.cc

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/renderer_host/p2p/socket_dispatcher_host.h" 5 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "content/browser/renderer_host/p2p/socket_host.h" 9 #include "content/browser/renderer_host/p2p/socket_host.h"
10 #include "content/common/p2p_messages.h" 10 #include "content/common/p2p_messages.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 std::string host_name_; 90 std::string host_name_;
91 net::SingleRequestHostResolver resolver_; 91 net::SingleRequestHostResolver resolver_;
92 92
93 DoneCallback done_callback_; 93 DoneCallback done_callback_;
94 }; 94 };
95 95
96 P2PSocketDispatcherHost::P2PSocketDispatcherHost( 96 P2PSocketDispatcherHost::P2PSocketDispatcherHost(
97 content::ResourceContext* resource_context, 97 content::ResourceContext* resource_context,
98 net::URLRequestContextGetter* url_context) 98 net::URLRequestContextGetter* url_context)
99 : resource_context_(resource_context), 99 : BrowserMessageFilter(P2PMsgStart),
100 resource_context_(resource_context),
100 url_context_(url_context), 101 url_context_(url_context),
101 monitoring_networks_(false) { 102 monitoring_networks_(false) {
102 } 103 }
103 104
104 void P2PSocketDispatcherHost::OnChannelClosing() { 105 void P2PSocketDispatcherHost::OnChannelClosing() {
105 // Since the IPC channel is gone, close pending connections. 106 // Since the IPC channel is gone, close pending connections.
106 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); 107 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end());
107 sockets_.clear(); 108 sockets_.clear();
108 109
109 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); 110 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end());
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 void P2PSocketDispatcherHost::OnAddressResolved( 290 void P2PSocketDispatcherHost::OnAddressResolved(
290 DnsRequest* request, 291 DnsRequest* request,
291 const net::IPAddressList& addresses) { 292 const net::IPAddressList& addresses) {
292 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses)); 293 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses));
293 294
294 dns_requests_.erase(request); 295 dns_requests_.erase(request);
295 delete request; 296 delete request;
296 } 297 }
297 298
298 } // namespace content 299 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698