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

Unified Diff: net/tools/quic/quic_simple_client.cc

Issue 1905843003: Split out QuicAlarm creation from QuicConnectionHelper to new QuicAlarmFactory. No behavior change,… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119753783
Patch Set: Rebase Created 4 years, 8 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
« no previous file with comments | « net/tools/quic/quic_simple_client.h ('k') | net/tools/quic/quic_simple_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_simple_client.cc
diff --git a/net/tools/quic/quic_simple_client.cc b/net/tools/quic/quic_simple_client.cc
index c04d0b6c218f9813542f1a7174da31f65705b5e4..43886bb4126983166deed3c1dfa661c7f1b4604d 100644
--- a/net/tools/quic/quic_simple_client.cc
+++ b/net/tools/quic/quic_simple_client.cc
@@ -11,6 +11,7 @@
#include "net/http/http_request_info.h"
#include "net/http/http_response_info.h"
#include "net/quic/crypto/quic_random.h"
+#include "net/quic/quic_chromium_alarm_factory.h"
#include "net/quic/quic_chromium_connection_helper.h"
#include "net/quic/quic_chromium_packet_reader.h"
#include "net/quic/quic_chromium_packet_writer.h"
@@ -42,6 +43,7 @@ QuicSimpleClient::QuicSimpleClient(IPEndPoint server_address,
supported_versions,
QuicConfig(),
CreateQuicConnectionHelper(),
+ CreateQuicAlarmFactory(),
proof_verifier),
server_address_(server_address),
local_port_(0),
@@ -58,6 +60,7 @@ QuicSimpleClient::QuicSimpleClient(IPEndPoint server_address,
supported_versions,
config,
CreateQuicConnectionHelper(),
+ CreateQuicAlarmFactory(),
proof_verifier),
server_address_(server_address),
local_port_(0),
@@ -68,7 +71,7 @@ QuicSimpleClient::QuicSimpleClient(IPEndPoint server_address,
QuicSimpleClient::~QuicSimpleClient() {
if (connected()) {
session()->connection()->CloseConnection(
- QUIC_PEER_GOING_AWAY, "",
+ QUIC_PEER_GOING_AWAY, "Shutting down",
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
}
STLDeleteElements(&data_to_resend_on_connect_);
@@ -214,7 +217,7 @@ void QuicSimpleClient::StartConnect() {
}
CreateQuicClientSession(new QuicConnection(
- GetNextConnectionId(), server_address_, helper(), writer(),
+ GetNextConnectionId(), server_address_, helper(), alarm_factory(), writer(),
/* owns_writer= */ false, Perspective::IS_CLIENT, supported_versions()));
session()->Initialize();
@@ -377,8 +380,12 @@ QuicConnectionId QuicSimpleClient::GenerateNewConnectionId() {
QuicChromiumConnectionHelper* QuicSimpleClient::CreateQuicConnectionHelper() {
return new QuicChromiumConnectionHelper(
- base::ThreadTaskRunnerHandle::Get().get(), &clock_,
- QuicRandom::GetInstance());
+ &clock_, QuicRandom::GetInstance());
+}
+
+QuicChromiumAlarmFactory* QuicSimpleClient::CreateQuicAlarmFactory() {
+ return new QuicChromiumAlarmFactory(
+ base::ThreadTaskRunnerHandle::Get().get(), &clock_);
}
QuicPacketWriter* QuicSimpleClient::CreateQuicPacketWriter() {
« no previous file with comments | « net/tools/quic/quic_simple_client.h ('k') | net/tools/quic/quic_simple_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698