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

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

Issue 340433002: Port QuicServer to Chrome network stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix invalid memory access + blocked writers Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/quic/quic_dispatcher.h" 5 #include "net/quic/quic_dispatcher.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 framer_visitor_(new QuicFramerVisitor(this)), 172 framer_visitor_(new QuicFramerVisitor(this)),
173 initial_flow_control_window_bytes_(initial_flow_control_window_bytes) { 173 initial_flow_control_window_bytes_(initial_flow_control_window_bytes) {
174 framer_.set_visitor(framer_visitor_.get()); 174 framer_.set_visitor(framer_visitor_.get());
175 } 175 }
176 176
177 QuicDispatcher::~QuicDispatcher() { 177 QuicDispatcher::~QuicDispatcher() {
178 STLDeleteValues(&session_map_); 178 STLDeleteValues(&session_map_);
179 STLDeleteElements(&closed_session_list_); 179 STLDeleteElements(&closed_session_list_);
180 } 180 }
181 181
182 void QuicDispatcher::Initialize(QuicPacketWriter* writer) { 182 void QuicDispatcher::Initialize(QuicServerPacketWriter* writer) {
183 DCHECK(writer_ == NULL); 183 DCHECK(writer_ == NULL);
184 writer_.reset(writer); 184 writer_.reset(writer);
185 time_wait_list_manager_.reset(CreateQuicTimeWaitListManager()); 185 time_wait_list_manager_.reset(CreateQuicTimeWaitListManager());
186 186
187 // Remove all versions > QUIC_VERSION_16 from the 187 // Remove all versions > QUIC_VERSION_16 from the
188 // supported_versions_no_flow_control_ vector. 188 // supported_versions_no_flow_control_ vector.
189 QuicVersionVector::iterator it = 189 QuicVersionVector::iterator it =
190 find(supported_versions_no_flow_control_.begin(), 190 find(supported_versions_no_flow_control_.begin(),
191 supported_versions_no_flow_control_.end(), QUIC_VERSION_17); 191 supported_versions_no_flow_control_.end(), QUIC_VERSION_17);
192 if (it != supported_versions_no_flow_control_.end()) { 192 if (it != supported_versions_no_flow_control_.end()) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // be parsed correctly. 420 // be parsed correctly.
421 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( 421 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId(
422 header.connection_id)); 422 header.connection_id));
423 423
424 // Continue parsing the packet to extract the sequence number. Then 424 // Continue parsing the packet to extract the sequence number. Then
425 // send it to the time wait manager in OnUnathenticatedHeader. 425 // send it to the time wait manager in OnUnathenticatedHeader.
426 return true; 426 return true;
427 } 427 }
428 428
429 } // namespace net 429 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698