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/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 Loading... |
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 : BrowserMessageFilter(SocketStreamMsgStart), | 35 : render_process_id_(render_process_id), |
36 render_process_id_(render_process_id), | |
37 request_context_callback_(request_context_callback), | 36 request_context_callback_(request_context_callback), |
38 resource_context_(resource_context), | 37 resource_context_(resource_context), |
39 weak_ptr_factory_(this), | 38 weak_ptr_factory_(this), |
40 on_shutdown_(false) { | 39 on_shutdown_(false) { |
41 net::WebSocketJob::EnsureInit(); | 40 net::WebSocketJob::EnsureInit(); |
42 } | 41 } |
43 | 42 |
44 bool SocketStreamDispatcherHost::OnMessageReceived(const IPC::Message& message, | 43 bool SocketStreamDispatcherHost::OnMessageReceived(const IPC::Message& message, |
45 bool* message_was_ok) { | 44 bool* message_was_ok) { |
46 if (on_shutdown_) | 45 if (on_shutdown_) |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 iter.Advance()) { | 273 iter.Advance()) { |
275 int socket_id = iter.GetCurrentKey(); | 274 int socket_id = iter.GetCurrentKey(); |
276 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); | 275 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); |
277 delete socket_stream_host; | 276 delete socket_stream_host; |
278 hosts_.Remove(socket_id); | 277 hosts_.Remove(socket_id); |
279 } | 278 } |
280 on_shutdown_ = true; | 279 on_shutdown_ = true; |
281 } | 280 } |
282 | 281 |
283 } // namespace content | 282 } // namespace content |
OLD | NEW |