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

Side by Side Diff: content/browser/renderer_host/websocket_dispatcher_host.cc

Issue 2228403003: content: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/websocket_dispatcher_host.h" 5 #include "content/browser/renderer_host/websocket_dispatcher_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 hosts.push_back(i->second); 243 hosts.push_back(i->second);
244 } 244 }
245 245
246 for (size_t i = 0; i < hosts.size(); ++i) { 246 for (size_t i = 0; i < hosts.size(); ++i) {
247 // Note that some calls to GoAway could fail. In that case hosts[i] will be 247 // Note that some calls to GoAway could fail. In that case hosts[i] will be
248 // deleted and removed from |hosts_| in |DoDropChannel|. 248 // deleted and removed from |hosts_| in |DoDropChannel|.
249 hosts[i]->GoAway(); 249 hosts[i]->GoAway();
250 hosts[i] = NULL; 250 hosts[i] = NULL;
251 } 251 }
252 252
253 STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end()); 253 base::STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end());
254 } 254 }
255 255
256 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) { 256 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) {
257 WebSocketHostTable::iterator it = hosts_.find(routing_id); 257 WebSocketHostTable::iterator it = hosts_.find(routing_id);
258 DCHECK(it != hosts_.end()); 258 DCHECK(it != hosts_.end());
259 DCHECK(it->second); 259 DCHECK(it->second);
260 if (!it->second->handshake_succeeded()) { 260 if (!it->second->handshake_succeeded()) {
261 // Update throttling counters (failure). 261 // Update throttling counters (failure).
262 --num_pending_connections_; 262 --num_pending_connections_;
263 DCHECK_GE(num_pending_connections_, 0); 263 DCHECK_GE(num_pending_connections_, 0);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 num_current_succeeded_connections_ = 0; 301 num_current_succeeded_connections_ = 0;
302 302
303 if (num_pending_connections_ == 0 && 303 if (num_pending_connections_ == 0 &&
304 num_previous_failed_connections_ == 0 && 304 num_previous_failed_connections_ == 0 &&
305 num_previous_succeeded_connections_ == 0) { 305 num_previous_succeeded_connections_ == 0) {
306 throttling_period_timer_.Stop(); 306 throttling_period_timer_.Stop();
307 } 307 }
308 } 308 }
309 309
310 } // namespace content 310 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_udp.cc ('k') | content/browser/service_worker/embedded_worker_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698