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

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

Issue 972783002: Remove unnecessary virtual CreateQuicConnection method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Created 5 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 | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/test_tools/quic_dispatcher_peer.h » ('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 <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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 366
367 QuicPacketWriter* QuicDispatcher::CreateWriter(int fd) { 367 QuicPacketWriter* QuicDispatcher::CreateWriter(int fd) {
368 return new QuicDefaultPacketWriter(fd); 368 return new QuicDefaultPacketWriter(fd);
369 } 369 }
370 370
371 QuicSession* QuicDispatcher::CreateQuicSession( 371 QuicSession* QuicDispatcher::CreateQuicSession(
372 QuicConnectionId connection_id, 372 QuicConnectionId connection_id,
373 const IPEndPoint& server_address, 373 const IPEndPoint& server_address,
374 const IPEndPoint& client_address) { 374 const IPEndPoint& client_address) {
375 QuicServerSession* session = new QuicServerSession( 375 // The QuicSession takes ownership of |connection| below.
376 config_, 376 QuicConnection* connection = new QuicConnection(
377 CreateQuicConnection(connection_id, server_address, client_address), 377 connection_id, client_address, helper_.get(), connection_writer_factory_,
378 this); 378 /* owns_writer= */ true, /* is_server= */ true,
379 crypto_config_.HasProofSource(), supported_versions_);
380
381 QuicServerSession* session = new QuicServerSession(config_, connection, this);
379 session->InitializeSession(crypto_config_); 382 session->InitializeSession(crypto_config_);
380 return session; 383 return session;
381 } 384 }
382 385
383 QuicConnection* QuicDispatcher::CreateQuicConnection(
384 QuicConnectionId connection_id,
385 const IPEndPoint& server_address,
386 const IPEndPoint& client_address) {
387 return new QuicConnection(connection_id,
388 client_address,
389 helper_.get(),
390 connection_writer_factory_,
391 /* owns_writer= */ true,
392 /* is_server= */ true,
393 crypto_config_.HasProofSource(),
394 supported_versions_);
395 }
396
397 QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() { 386 QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() {
398 return new QuicTimeWaitListManager( 387 return new QuicTimeWaitListManager(
399 writer_.get(), this, epoll_server(), supported_versions()); 388 writer_.get(), this, epoll_server(), supported_versions());
400 } 389 }
401 390
402 bool QuicDispatcher::HandlePacketForTimeWait( 391 bool QuicDispatcher::HandlePacketForTimeWait(
403 const QuicPacketPublicHeader& header) { 392 const QuicPacketPublicHeader& header) {
404 if (header.reset_flag) { 393 if (header.reset_flag) {
405 // Public reset packets do not have sequence numbers, so ignore the packet. 394 // Public reset packets do not have sequence numbers, so ignore the packet.
406 return false; 395 return false;
407 } 396 }
408 397
409 // Switch the framer to the correct version, so that the sequence number can 398 // Switch the framer to the correct version, so that the sequence number can
410 // be parsed correctly. 399 // be parsed correctly.
411 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( 400 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId(
412 header.connection_id)); 401 header.connection_id));
413 402
414 // Continue parsing the packet to extract the sequence number. Then 403 // Continue parsing the packet to extract the sequence number. Then
415 // send it to the time wait manager in OnUnathenticatedHeader. 404 // send it to the time wait manager in OnUnathenticatedHeader.
416 return true; 405 return true;
417 } 406 }
418 407
419 } // namespace tools 408 } // namespace tools
420 } // namespace net 409 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/test_tools/quic_dispatcher_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698