| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/socket_stream_dispatcher_host.h" | 5 #include "chrome/browser/renderer_host/socket_stream_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/renderer_host/socket_stream_host.h" | 8 #include "chrome/browser/renderer_host/socket_stream_host.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 #include "chrome/common/net/socket_stream.h" | 10 #include "chrome/common/net/socket_stream.h" |
| 11 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
| 12 #include "net/websockets/websocket_job.h" |
| 12 #include "net/websockets/websocket_throttle.h" | 13 #include "net/websockets/websocket_throttle.h" |
| 13 | 14 |
| 14 SocketStreamDispatcherHost::SocketStreamDispatcherHost() : receiver_(NULL) { | 15 SocketStreamDispatcherHost::SocketStreamDispatcherHost() : receiver_(NULL) { |
| 16 net::WebSocketJob::EnsureInit(); |
| 15 net::WebSocketThrottle::Init(); | 17 net::WebSocketThrottle::Init(); |
| 16 } | 18 } |
| 17 | 19 |
| 18 SocketStreamDispatcherHost::~SocketStreamDispatcherHost() { | 20 SocketStreamDispatcherHost::~SocketStreamDispatcherHost() { |
| 19 // TODO(ukai): Implement IDMap::RemoveAll(). | 21 // TODO(ukai): Implement IDMap::RemoveAll(). |
| 20 for (IDMap< IDMap<SocketStreamHost> >::const_iterator iter(&hostmap_); | 22 for (IDMap< IDMap<SocketStreamHost> >::const_iterator iter(&hostmap_); |
| 21 !iter.IsAtEnd(); | 23 !iter.IsAtEnd(); |
| 22 iter.Advance()) { | 24 iter.Advance()) { |
| 23 int host_id = iter.GetCurrentKey(); | 25 int host_id = iter.GetCurrentKey(); |
| 24 CancelRequestsForProcess(host_id); | 26 CancelRequestsForProcess(host_id); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 case ViewHostMsg_SocketStream_Connect::ID: | 220 case ViewHostMsg_SocketStream_Connect::ID: |
| 219 case ViewHostMsg_SocketStream_SendData::ID: | 221 case ViewHostMsg_SocketStream_SendData::ID: |
| 220 case ViewHostMsg_SocketStream_Close::ID: | 222 case ViewHostMsg_SocketStream_Close::ID: |
| 221 return true; | 223 return true; |
| 222 | 224 |
| 223 default: | 225 default: |
| 224 break; | 226 break; |
| 225 } | 227 } |
| 226 return false; | 228 return false; |
| 227 } | 229 } |
| OLD | NEW |