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

Side by Side Diff: net/quic/quartc/quartc_factory.h

Issue 2324833004: Define Stable API for WebRTC/Quartc (Closed)
Patch Set: Fix the memory leak. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_QUIC_QUARTC_QUARTC_FACTORY_H_
6 #define NET_QUIC_QUARTC_QUARTC_FACTORY_H_
7
8 #include "base/at_exit.h"
9 #include "base/message_loop/message_loop.h"
10 #include "net/quic/core/quic_alarm_factory.h"
11 #include "net/quic/core/quic_clock.h"
12 #include "net/quic/core/quic_connection.h"
13 #include "net/quic/core/quic_simple_buffer_allocator.h"
14 #include "net/quic/quartc/quartc_alarm_factory.h"
15 #include "net/quic/quartc/quartc_factory_interface.h"
16 #include "net/quic/quartc/quartc_packet_writer.h"
17 #include "net/quic/quartc/quartc_task_runner_interface.h"
18
19 namespace net {
20
21 // Implements the QuartcFactoryInterface to create the instances of
22 // QuartcSessionInterface. Implements the QuicAlarmFactory to create alarms
23 // using the QuartcTaskRunner. Implements the QuicConnectionHelperInterface used
24 // by the QuicConnections. Only one QuartcFactory is expected to be created.
25 class NET_EXPORT_PRIVATE QuartcFactory : public QuartcFactoryInterface,
26 public QuicAlarmFactory,
27 public QuicConnectionHelperInterface {
28 public:
29 QuartcFactory(const QuartcFactoryConfig& factory_config);
30 ~QuartcFactory() override;
31
32 // QuartcFactoryInterface overrides.
33 std::unique_ptr<QuartcSessionInterface> CreateQuartcSession(
34 const QuartcSessionConfig& quartc_session_config) override;
35
36 // QuicAlarmFactory overrides.
37 QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
38
39 QuicArenaScopedPtr<QuicAlarm> CreateAlarm(
40 QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
41 QuicConnectionArena* arena) override;
42
43 // QuicConnectionHelperInterface overrides.
44 const QuicClock* GetClock() const override;
45
46 QuicRandom* GetRandomGenerator() override;
47
48 QuicBufferAllocator* GetBufferAllocator() override;
49
50 private:
51 std::unique_ptr<QuicConnection> CreateQuicConnection(
52 const QuartcSessionConfig& quartc_session_config,
53 Perspective perspective);
54
55 // Used to implement QuicAlarmFactory..
56 std::unique_ptr<QuartcTaskRunnerInterface> task_runner_;
57 // Used to implement the QuicConnectionHelperInterface.
58 QuicClock clock_;
59 SimpleBufferAllocator buffer_allocator_;
60 // An AtExitManager owned by the QuartcFactory to manage the lifetime of
61 // Singletons.
62 std::unique_ptr<base::AtExitManager> at_exit_manager_;
63 };
64
65 } // namepapce net
66
67 #endif // NET_QUIC_QUARTC_QUARTC_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698