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

Unified Diff: net/quic/core/congestion_control/simulation/alarm_factory.h

Issue 2322233004: Landing Recent QUIC changes until Sun Sep 4 03:41:00 (Closed)
Patch Set: Remove simulation files from the build. Created 4 years, 3 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/core/congestion_control/simulation/alarm_factory.h
diff --git a/net/quic/core/congestion_control/simulation/alarm_factory.h b/net/quic/core/congestion_control/simulation/alarm_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..d14b1de86ebdd6bfa2e585783ab0c8bfd296e06e
--- /dev/null
+++ b/net/quic/core/congestion_control/simulation/alarm_factory.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_QUIC_CORE_CONGESTION_CONTROL_SIMULATION_ALARM_FACTORY_H_
+#define NET_QUIC_CORE_CONGESTION_CONTROL_SIMULATION_ALARM_FACTORY_H_
+
+#include "net/quic/core/congestion_control/simulation/actor.h"
+#include "net/quic/core/quic_alarm_factory.h"
+
+namespace net {
+namespace simulation {
+
+// AlarmFactory allows to schedule QuicAlarms using the simulation event queue.
+class AlarmFactory : public QuicAlarmFactory {
+ public:
+ AlarmFactory(Simulator* simulator, std::string name);
+ ~AlarmFactory() override;
+
+ QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
+ QuicArenaScopedPtr<QuicAlarm> CreateAlarm(
+ QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
+ QuicConnectionArena* arena) override;
+
+ private:
+ // Automatically generate a name for a new alarm.
+ std::string GetNewAlarmName();
+
+ Simulator* simulator_;
+ std::string name_;
+ int counter_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlarmFactory);
+};
+
+} // namespace simulation
+} // namespace net
+
+#endif // NET_QUIC_CORE_CONGESTION_CONTROL_SIMULATION_ALARM_FACTORY_H_
« no previous file with comments | « net/quic/core/congestion_control/simulation/actor.cc ('k') | net/quic/core/congestion_control/simulation/alarm_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698