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

Unified Diff: net/quic/core/congestion_control/simulation/actor.cc

Issue 2323963002: Implement an event-based simulator for QuicConnection (Closed)
Patch Set: Adding missing files. 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/actor.cc
diff --git a/net/quic/core/congestion_control/simulation/actor.cc b/net/quic/core/congestion_control/simulation/actor.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7058a1fe9971d841a44be2152643790abf700664
--- /dev/null
+++ b/net/quic/core/congestion_control/simulation/actor.cc
@@ -0,0 +1,25 @@
+#include "net/quic/core/congestion_control/simulation/actor.h"
+#include "net/quic/core/congestion_control/simulation/simulator.h"
+
+namespace net {
+namespace simulation {
+
+Actor::Actor(Simulator* simulator, std::string name)
+ : simulator_(simulator),
+ clock_(simulator->GetClock()),
+ name_(std::move(name)) {
+ simulator->AddActor(this);
+}
+
+Actor::~Actor() {}
+
+void Actor::Schedule(QuicTime next_tick) {
+ simulator_->Schedule(this, next_tick);
+}
+
+void Actor::Unschedule() {
+ simulator_->Unschedule(this);
+}
+
+} // namespace simulation
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698