| 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 18 matching lines...) Expand all Loading... |
| 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 : BrowserMessageFilter(SocketStreamMsgStart), |
| 36 render_process_id_(render_process_id), | 36 render_process_id_(render_process_id), |
| 37 request_context_callback_(request_context_callback), | 37 request_context_callback_(request_context_callback), |
| 38 resource_context_(resource_context), | 38 resource_context_(resource_context), |
| 39 weak_ptr_factory_(this), | 39 on_shutdown_(false), |
| 40 on_shutdown_(false) { | 40 weak_ptr_factory_(this) { |
| 41 net::WebSocketJob::EnsureInit(); | 41 net::WebSocketJob::EnsureInit(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool SocketStreamDispatcherHost::OnMessageReceived( | 44 bool SocketStreamDispatcherHost::OnMessageReceived( |
| 45 const IPC::Message& message) { | 45 const IPC::Message& message) { |
| 46 if (on_shutdown_) | 46 if (on_shutdown_) |
| 47 return false; | 47 return false; |
| 48 | 48 |
| 49 bool handled = true; | 49 bool handled = true; |
| 50 IPC_BEGIN_MESSAGE_MAP(SocketStreamDispatcherHost, message) | 50 IPC_BEGIN_MESSAGE_MAP(SocketStreamDispatcherHost, message) |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 iter.Advance()) { | 298 iter.Advance()) { |
| 299 int socket_id = iter.GetCurrentKey(); | 299 int socket_id = iter.GetCurrentKey(); |
| 300 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); | 300 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); |
| 301 delete socket_stream_host; | 301 delete socket_stream_host; |
| 302 hosts_.Remove(socket_id); | 302 hosts_.Remove(socket_id); |
| 303 } | 303 } |
| 304 on_shutdown_ = true; | 304 on_shutdown_ = true; |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace content | 307 } // namespace content |
| OLD | NEW |