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

Side by Side Diff: content/browser/renderer_host/socket_stream_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/socket_stream_dispatcher_host.h" 5 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/renderer_host/socket_stream_host.h" 10 #include "content/browser/renderer_host/socket_stream_host.h"
(...skipping 14 matching lines...) Expand all
25 namespace { 25 namespace {
26 26
27 const size_t kMaxSocketStreamHosts = 16 * 1024; 27 const size_t kMaxSocketStreamHosts = 16 * 1024;
28 28
29 } // namespace 29 } // namespace
30 30
31 SocketStreamDispatcherHost::SocketStreamDispatcherHost( 31 SocketStreamDispatcherHost::SocketStreamDispatcherHost(
32 int render_process_id, 32 int render_process_id,
33 const GetRequestContextCallback& request_context_callback, 33 const GetRequestContextCallback& request_context_callback,
34 ResourceContext* resource_context) 34 ResourceContext* resource_context)
35 : render_process_id_(render_process_id), 35 : BrowserMessageFilter(SocketStreamMsgStart),
36 render_process_id_(render_process_id),
36 request_context_callback_(request_context_callback), 37 request_context_callback_(request_context_callback),
37 resource_context_(resource_context), 38 resource_context_(resource_context),
38 weak_ptr_factory_(this), 39 weak_ptr_factory_(this),
39 on_shutdown_(false) { 40 on_shutdown_(false) {
40 net::WebSocketJob::EnsureInit(); 41 net::WebSocketJob::EnsureInit();
41 } 42 }
42 43
43 bool SocketStreamDispatcherHost::OnMessageReceived(const IPC::Message& message, 44 bool SocketStreamDispatcherHost::OnMessageReceived(const IPC::Message& message,
44 bool* message_was_ok) { 45 bool* message_was_ok) {
45 if (on_shutdown_) 46 if (on_shutdown_)
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 iter.Advance()) { 274 iter.Advance()) {
274 int socket_id = iter.GetCurrentKey(); 275 int socket_id = iter.GetCurrentKey();
275 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); 276 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue();
276 delete socket_stream_host; 277 delete socket_stream_host;
277 hosts_.Remove(socket_id); 278 hosts_.Remove(socket_id);
278 } 279 }
279 on_shutdown_ = true; 280 on_shutdown_ = true;
280 } 281 }
281 282
282 } // namespace content 283 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698