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

Unified Diff: net/quic/quartc/quartc_alarm_factory.h

Issue 2324833004: Define Stable API for WebRTC/Quartc (Closed)
Patch Set: Fix the issues when testing with WebRTC. Created 4 years, 2 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/quartc/quartc_alarm_factory.h
diff --git a/net/quic/quartc/quartc_alarm_factory.h b/net/quic/quartc/quartc_alarm_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..b464f35de44496fa47d09814dd29d41beccc5fc4
--- /dev/null
+++ b/net/quic/quartc/quartc_alarm_factory.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2016 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_QUARTC_QUARTC_ALARM_FACTORY_H_
+#define NET_QUIC_QUARTC_QUARTC_ALARM_FACTORY_H_
+
+#include <utility>
+
+#include "net/quic/core/quic_alarm_factory.h"
+#include "net/quic/core/quic_clock.h"
+
+namespace base {
+class TaskRunner;
+} // namespace base
+
+namespace net {
+
+// Creates Chromium based QuartcAlarms used throughout QUIC. The alarm posts
pthatcher1 2016/10/14 18:58:59 "Chromium based" => "Chromium-based"
zhihuang1 2016/10/16 00:45:27 Done.
+// messages to Chromium message queue for tasks such as retransmission.
pthatcher1 2016/10/14 18:58:59 "to Chromium message queue" => "to the Chromium me
zhihuang1 2016/10/16 00:45:27 Done.
+// Used for the tests inside Chromium.
+class NET_EXPORT_PRIVATE QuartcAlarmFactory : public QuicAlarmFactory {
+ public:
+ QuartcAlarmFactory(base::TaskRunner* task_runner, const QuicClock* clock);
+ ~QuartcAlarmFactory() override;
+
+ QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
+
+ QuicArenaScopedPtr<QuicAlarm> CreateAlarm(
+ QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
+ QuicConnectionArena* arena) override;
+
+ private:
+ base::TaskRunner* task_runner_ = nullptr;
+ // Not owned by QuartcAlarmFactory. The implementation of
+ // QuicConnectionHelperInterface owns it.
+ const QuicClock* clock_;
pthatcher1 2016/10/14 18:58:59 If the task_runner_ has "= nullptr", shouldn't the
zhihuang1 2016/10/16 00:45:27 I'll remove this since it will be set in the const
+
+ DISALLOW_COPY_AND_ASSIGN(QuartcAlarmFactory);
+};
+
+} // namespace net
+
+#endif // NET_QUIC_QUARTC_QUARTC_ALARM_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698