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

Side by Side Diff: chrome/browser/renderer_host/socket_stream_dispatcher_host.cc

Issue 669157: Refactor WebSocket throttling feature. (Closed)
Patch Set: Fix for tyoshino's comment Created 10 years, 9 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
« no previous file with comments | « no previous file | net/net.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698