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

Unified 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: Build quic_ported_server on other platforms too 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_dispatcher.cc
diff --git a/net/quic/quic_dispatcher.cc b/net/quic/quic_dispatcher.cc
index 280622da381c178db3b7da98592df0c9664d3787..a5a9607b0ca01978d21aa08e5c9348ae7d2f9b9b 100644
--- a/net/quic/quic_dispatcher.cc
+++ b/net/quic/quic_dispatcher.cc
@@ -177,7 +177,7 @@ QuicDispatcher::~QuicDispatcher() {
STLDeleteElements(&closed_session_list_);
}
-void QuicDispatcher::Initialize(QuicPacketWriter* writer) {
+void QuicDispatcher::Initialize(QuicServerPacketWriter* writer) {
DCHECK(writer_ == NULL);
writer_.reset(writer);
time_wait_list_manager_.reset(CreateQuicTimeWaitListManager());
@@ -366,9 +366,18 @@ QuicSession* QuicDispatcher::CreateQuicSession(
QuicConnectionId connection_id,
const IPEndPoint& server_address,
const IPEndPoint& client_address) {
+ QuicPerConnectionPacketWriter* connection_packet_writer =
wtc 2014/06/23 23:12:15 Nit: rename this variable "per_connection_packet_w
dmziegler 2014/06/24 00:08:52 Done.
+ new QuicPerConnectionPacketWriter(writer_.get());
+ QuicConnection* connection =
+ CreateQuicConnection(connection_id,
+ server_address,
+ client_address,
+ connection_packet_writer);
+ connection_packet_writer->set_connection(connection);
wtc 2014/06/23 23:12:15 1. Nit: the two-way links between |connection| and
dmziegler 2014/06/24 00:08:52 The connection needs to write on the writer, and t
QuicServerSession* session = new QuicServerSession(
config_,
- CreateQuicConnection(connection_id, server_address, client_address),
+ connection,
+ connection_packet_writer,
this);
session->InitializeSession(crypto_config_);
return session;
@@ -377,12 +386,13 @@ QuicSession* QuicDispatcher::CreateQuicSession(
QuicConnection* QuicDispatcher::CreateQuicConnection(
QuicConnectionId connection_id,
const IPEndPoint& server_address,
- const IPEndPoint& client_address) {
+ const IPEndPoint& client_address,
+ QuicPerConnectionPacketWriter* writer) {
if (FLAGS_enable_quic_stream_flow_control_2 &&
FLAGS_enable_quic_connection_flow_control_2) {
DVLOG(1) << "Creating QuicDispatcher with all versions.";
return new QuicConnection(connection_id, client_address, helper_,
- writer_.get(), true, supported_versions_);
+ writer, true, supported_versions_);
}
if (FLAGS_enable_quic_stream_flow_control_2 &&
@@ -390,14 +400,14 @@ QuicConnection* QuicDispatcher::CreateQuicConnection(
DVLOG(1) << "Connection flow control disabled, creating QuicDispatcher "
<< "WITHOUT version 19 or higher.";
return new QuicConnection(connection_id, client_address, helper_,
- writer_.get(), true,
+ writer, true,
supported_versions_no_connection_flow_control_);
}
DVLOG(1) << "Flow control disabled, creating QuicDispatcher WITHOUT "
<< "version 17 or higher.";
return new QuicConnection(connection_id, client_address, helper_,
- writer_.get(), true,
+ writer, true,
supported_versions_no_flow_control_);
}

Powered by Google App Engine
This is Rietveld 408576698