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..674e60d295353e53e885ab502ed9b041962e125a |
--- /dev/null |
+++ b/net/quic/core/congestion_control/simulation/alarm_factory.h |
@@ -0,0 +1,35 @@ |
+#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::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::std::string GetNewAlarmName(); |
+ |
+ Simulator* simulator_; |
+ std::std::string name_; |
+ int counter_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AlarmFactory); |
+}; |
+ |
+} // namespace simulation |
+} // namespace net |
+ |
+#endif // NET_QUIC_CORE_CONGESTION_CONTROL_SIMULATION_ALARM_FACTORY_H_ |