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

Side by Side Diff: net/tools/quic/quic_dispatcher.cc

Issue 2229393003: net: 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
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('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) 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 "net/tools/quic/quic_dispatcher.h" 5 #include "net/tools/quic/quic_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 current_packet_(nullptr), 204 current_packet_(nullptr),
205 version_manager_(version_manager), 205 version_manager_(version_manager),
206 framer_(GetSupportedVersions(), 206 framer_(GetSupportedVersions(),
207 /*unused*/ QuicTime::Zero(), 207 /*unused*/ QuicTime::Zero(),
208 Perspective::IS_SERVER), 208 Perspective::IS_SERVER),
209 last_error_(QUIC_NO_ERROR) { 209 last_error_(QUIC_NO_ERROR) {
210 framer_.set_visitor(this); 210 framer_.set_visitor(this);
211 } 211 }
212 212
213 QuicDispatcher::~QuicDispatcher() { 213 QuicDispatcher::~QuicDispatcher() {
214 STLDeleteValues(&session_map_); 214 base::STLDeleteValues(&session_map_);
215 STLDeleteElements(&closed_session_list_); 215 base::STLDeleteElements(&closed_session_list_);
216 } 216 }
217 217
218 void QuicDispatcher::InitializeWithWriter(QuicPacketWriter* writer) { 218 void QuicDispatcher::InitializeWithWriter(QuicPacketWriter* writer) {
219 DCHECK(writer_ == nullptr); 219 DCHECK(writer_ == nullptr);
220 writer_.reset(writer); 220 writer_.reset(writer);
221 time_wait_list_manager_.reset(CreateQuicTimeWaitListManager()); 221 time_wait_list_manager_.reset(CreateQuicTimeWaitListManager());
222 } 222 }
223 223
224 void QuicDispatcher::ProcessPacket(const IPEndPoint& server_address, 224 void QuicDispatcher::ProcessPacket(const IPEndPoint& server_address,
225 const IPEndPoint& client_address, 225 const IPEndPoint& client_address,
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 DCHECK(connection->termination_packets() != nullptr && 415 DCHECK(connection->termination_packets() != nullptr &&
416 !connection->termination_packets()->empty()); 416 !connection->termination_packets()->empty());
417 } 417 }
418 time_wait_list_manager_->AddConnectionIdToTimeWait( 418 time_wait_list_manager_->AddConnectionIdToTimeWait(
419 it->first, connection->version(), should_close_statelessly, 419 it->first, connection->version(), should_close_statelessly,
420 connection->termination_packets()); 420 connection->termination_packets());
421 session_map_.erase(it); 421 session_map_.erase(it);
422 } 422 }
423 423
424 void QuicDispatcher::DeleteSessions() { 424 void QuicDispatcher::DeleteSessions() {
425 STLDeleteElements(&closed_session_list_); 425 base::STLDeleteElements(&closed_session_list_);
426 } 426 }
427 427
428 void QuicDispatcher::OnCanWrite() { 428 void QuicDispatcher::OnCanWrite() {
429 // The socket is now writable. 429 // The socket is now writable.
430 writer_->SetWritable(); 430 writer_->SetWritable();
431 431
432 // Give all the blocked writers one chance to write, until we're blocked again 432 // Give all the blocked writers one chance to write, until we're blocked again
433 // or there's no work left. 433 // or there's no work left.
434 while (!write_blocked_list_.empty() && !writer_->IsWriteBlocked()) { 434 while (!write_blocked_list_.empty() && !writer_->IsWriteBlocked()) {
435 QuicBlockedWriterInterface* blocked_writer = 435 QuicBlockedWriterInterface* blocked_writer =
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 QUIC_BUG << "Rejector has unknown invalid state."; 720 QUIC_BUG << "Rejector has unknown invalid state.";
721 return kFateDrop; 721 return kFateDrop;
722 } 722 }
723 723
724 const QuicVersionVector& QuicDispatcher::GetSupportedVersions() { 724 const QuicVersionVector& QuicDispatcher::GetSupportedVersions() {
725 return version_manager_->GetSupportedVersions(); 725 return version_manager_->GetSupportedVersions();
726 } 726 }
727 727
728 } // namespace net 728 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698