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

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

Issue 1899753003: Split out QuicAlarm creation from QuicConnectionHelper to new QuicAlarmFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119871679
Patch Set: 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
Index: net/tools/quic/quic_simple_server.cc
diff --git a/net/tools/quic/quic_simple_server.cc b/net/tools/quic/quic_simple_server.cc
index 77139862507ea6f0c2fdad8689ee19d2ac9e26af..b7d2e83ac57efb0599bc0d860579365a93cec83a 100644
--- a/net/tools/quic/quic_simple_server.cc
+++ b/net/tools/quic/quic_simple_server.cc
@@ -36,8 +36,13 @@ class SimpleQuicDispatcher : public QuicDispatcher {
SimpleQuicDispatcher(const QuicConfig& config,
const QuicCryptoServerConfig* crypto_config,
const QuicVersionVector& supported_versions,
- QuicConnectionHelperInterface* helper)
- : QuicDispatcher(config, crypto_config, supported_versions, helper) {}
+ QuicConnectionHelperInterface* helper,
+ QuicChromiumAlarmFactory* alarm_factory)
+ : QuicDispatcher(config,
+ crypto_config,
+ supported_versions,
+ helper,
+ alarm_factory) {}
protected:
QuicServerSessionBase* CreateQuicSession(
@@ -63,10 +68,10 @@ QuicSimpleServer::QuicSimpleServer(ProofSource* proof_source,
const QuicConfig& config,
const QuicVersionVector& supported_versions)
: helper_(
- new QuicChromiumConnectionHelper(base::ThreadTaskRunnerHandle::Get()
- .get(),
- &clock_,
- QuicRandom::GetInstance())),
+ new QuicChromiumConnectionHelper(&clock_, QuicRandom::GetInstance())),
+ alarm_factory_(new QuicChromiumAlarmFactory(
+ base::ThreadTaskRunnerHandle::Get().get(),
+ &clock_)),
config_(config),
crypto_config_(kSourceAddressTokenSecret,
QuicRandom::GetInstance(),
@@ -144,8 +149,8 @@ int QuicSimpleServer::Listen(const IPEndPoint& address) {
socket_.swap(socket);
- dispatcher_.reset(new SimpleQuicDispatcher(config_, &crypto_config_,
- supported_versions_, helper_));
+ dispatcher_.reset(new SimpleQuicDispatcher(
+ config_, &crypto_config_, supported_versions_, helper_, alarm_factory_));
QuicSimpleServerPacketWriter* writer =
new QuicSimpleServerPacketWriter(socket_.get(), dispatcher_.get());
dispatcher_->InitializeWithWriter(writer);

Powered by Google App Engine
This is Rietveld 408576698