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_job.h" |
13 #include "net/websockets/websocket_throttle.h" | 13 #include "net/websockets/websocket_throttle.h" |
14 | 14 |
15 SocketStreamDispatcherHost::SocketStreamDispatcherHost() : receiver_(NULL) { | 15 SocketStreamDispatcherHost::SocketStreamDispatcherHost() : receiver_(NULL) { |
16 net::WebSocketJob::EnsureInit(); | 16 net::WebSocketJob::EnsureInit(); |
17 net::WebSocketThrottle::Init(); | |
18 } | 17 } |
19 | 18 |
20 SocketStreamDispatcherHost::~SocketStreamDispatcherHost() { | 19 SocketStreamDispatcherHost::~SocketStreamDispatcherHost() { |
21 // TODO(ukai): Implement IDMap::RemoveAll(). | 20 // TODO(ukai): Implement IDMap::RemoveAll(). |
22 for (IDMap< IDMap<SocketStreamHost> >::const_iterator iter(&hostmap_); | 21 for (IDMap< IDMap<SocketStreamHost> >::const_iterator iter(&hostmap_); |
23 !iter.IsAtEnd(); | 22 !iter.IsAtEnd(); |
24 iter.Advance()) { | 23 iter.Advance()) { |
25 int host_id = iter.GetCurrentKey(); | 24 int host_id = iter.GetCurrentKey(); |
26 CancelRequestsForProcess(host_id); | 25 CancelRequestsForProcess(host_id); |
27 } | 26 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 case ViewHostMsg_SocketStream_Connect::ID: | 219 case ViewHostMsg_SocketStream_Connect::ID: |
221 case ViewHostMsg_SocketStream_SendData::ID: | 220 case ViewHostMsg_SocketStream_SendData::ID: |
222 case ViewHostMsg_SocketStream_Close::ID: | 221 case ViewHostMsg_SocketStream_Close::ID: |
223 return true; | 222 return true; |
224 | 223 |
225 default: | 224 default: |
226 break; | 225 break; |
227 } | 226 } |
228 return false; | 227 return false; |
229 } | 228 } |
OLD | NEW |