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

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

Issue 2324833004: Define Stable API for WebRTC/Quartc (Closed)
Patch Set: Fix the IOS simulator and merge. Created 4 years, 1 month 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
« no previous file with comments | « net/quic/quartc/quartc_alarm_factory_test.cc ('k') | net/quic/quartc/quartc_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quartc/quartc_factory.h
diff --git a/net/quic/quartc/quartc_factory.h b/net/quic/quartc/quartc_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..eee82d9579106bb14b32643cc7a56c9058538816
--- /dev/null
+++ b/net/quic/quartc/quartc_factory.h
@@ -0,0 +1,67 @@
+// 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_FACTORY_H_
+#define NET_QUIC_QUARTC_QUARTC_FACTORY_H_
+
+#include "base/at_exit.h"
+#include "base/message_loop/message_loop.h"
+#include "net/quic/core/quic_alarm_factory.h"
+#include "net/quic/core/quic_clock.h"
+#include "net/quic/core/quic_connection.h"
+#include "net/quic/core/quic_simple_buffer_allocator.h"
+#include "net/quic/quartc/quartc_alarm_factory.h"
+#include "net/quic/quartc/quartc_factory_interface.h"
+#include "net/quic/quartc/quartc_packet_writer.h"
+#include "net/quic/quartc/quartc_task_runner_interface.h"
+
+namespace net {
+
+// Implements the QuartcFactoryInterface to create the instances of
+// QuartcSessionInterface. Implements the QuicAlarmFactory to create alarms
+// using the QuartcTaskRunner. Implements the QuicConnectionHelperInterface used
+// by the QuicConnections. Only one QuartcFactory is expected to be created.
+class NET_EXPORT_PRIVATE QuartcFactory : public QuartcFactoryInterface,
+ public QuicAlarmFactory,
+ public QuicConnectionHelperInterface {
+ public:
+ QuartcFactory(const QuartcFactoryConfig& factory_config);
+ ~QuartcFactory() override;
+
+ // QuartcFactoryInterface overrides.
+ std::unique_ptr<QuartcSessionInterface> CreateQuartcSession(
+ const QuartcSessionConfig& quartc_session_config) override;
+
+ // QuicAlarmFactory overrides.
+ QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
+
+ QuicArenaScopedPtr<QuicAlarm> CreateAlarm(
+ QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
+ QuicConnectionArena* arena) override;
+
+ // QuicConnectionHelperInterface overrides.
+ const QuicClock* GetClock() const override;
+
+ QuicRandom* GetRandomGenerator() override;
+
+ QuicBufferAllocator* GetBufferAllocator() override;
+
+ private:
+ std::unique_ptr<QuicConnection> CreateQuicConnection(
+ const QuartcSessionConfig& quartc_session_config,
+ Perspective perspective);
+
+ // Used to implement QuicAlarmFactory..
+ std::unique_ptr<QuartcTaskRunnerInterface> task_runner_;
+ // Used to implement the QuicConnectionHelperInterface.
+ QuicClock clock_;
+ SimpleBufferAllocator buffer_allocator_;
+ // An AtExitManager owned by the QuartcFactory to manage the lifetime of
+ // Singletons.
+ std::unique_ptr<base::AtExitManager> at_exit_manager_;
+};
+
+} // namepapce net
+
+#endif // NET_QUIC_QUARTC_QUARTC_FACTORY_H_
« no previous file with comments | « net/quic/quartc/quartc_alarm_factory_test.cc ('k') | net/quic/quartc/quartc_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698