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..f71fa30930e6ff6df5ae13dc470c927e762f2f0a |
--- /dev/null |
+++ b/net/quic/quartc/quartc_factory.h |
@@ -0,0 +1,64 @@ |
+// 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. |
+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> quartc_task_runner_; |
pthatcher1
2016/10/14 18:59:00
Could just be task_runner_, I think.
zhihuang1
2016/10/16 00:45:28
Done.
|
+ // Used to implement the QuicConnectionHelperInterface. |
+ QuicClock clock_; |
+ SimpleBufferAllocator buffer_allocator_; |
+}; |
+ |
+} // namepapce net |
+ |
+#endif // NET_QUIC_QUARTC_QUARTC_FACTORY_H_ |