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

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

Issue 165333004: Revert "Allow MessageFilters to restrict listening to specific message classes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 : BrowserMessageFilter(P2PMsgStart), 99 : resource_context_(resource_context),
100 resource_context_(resource_context),
101 url_context_(url_context), 100 url_context_(url_context),
102 monitoring_networks_(false) { 101 monitoring_networks_(false) {
103 } 102 }
104 103
105 void P2PSocketDispatcherHost::OnChannelClosing() { 104 void P2PSocketDispatcherHost::OnChannelClosing() {
106 // Since the IPC channel is gone, close pending connections. 105 // Since the IPC channel is gone, close pending connections.
107 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); 106 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end());
108 sockets_.clear(); 107 sockets_.clear();
109 108
110 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); 109 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end());
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 void P2PSocketDispatcherHost::OnAddressResolved( 289 void P2PSocketDispatcherHost::OnAddressResolved(
291 DnsRequest* request, 290 DnsRequest* request,
292 const net::IPAddressList& addresses) { 291 const net::IPAddressList& addresses) {
293 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses)); 292 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses));
294 293
295 dns_requests_.erase(request); 294 dns_requests_.erase(request);
296 delete request; 295 delete request;
297 } 296 }
298 297
299 } // namespace content 298 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698