OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ | 5 #ifndef NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ |
6 #define NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ | 6 #define NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "net/base/net_export.h" | 13 #include "net/quic/platform/api/quic_export.h" |
14 #include "net/quic/quartc/quartc_session_interface.h" | 14 #include "net/quic/quartc/quartc_session_interface.h" |
15 #include "net/quic/quartc/quartc_task_runner_interface.h" | 15 #include "net/quic/quartc/quartc_task_runner_interface.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 // Used to create instances for Quartc objects such as QuartcSession. | 19 // Used to create instances for Quartc objects such as QuartcSession. |
20 class NET_EXPORT_PRIVATE QuartcFactoryInterface { | 20 class QUIC_EXPORT_PRIVATE QuartcFactoryInterface { |
21 public: | 21 public: |
22 virtual ~QuartcFactoryInterface() {} | 22 virtual ~QuartcFactoryInterface() {} |
23 | 23 |
24 struct QuartcSessionConfig { | 24 struct QuartcSessionConfig { |
25 // When using Quartc, there are two endpoints. The QuartcSession on one | 25 // When using Quartc, there are two endpoints. The QuartcSession on one |
26 // endpoint must act as a server and the one on the other side must act as a | 26 // endpoint must act as a server and the one on the other side must act as a |
27 // client. | 27 // client. |
28 bool is_server = false; | 28 bool is_server = false; |
29 // This is only needed when is_server = false. It must be unique | 29 // This is only needed when is_server = false. It must be unique |
30 // for each endpoint the local endpoint may communicate with. For example, | 30 // for each endpoint the local endpoint may communicate with. For example, |
(...skipping 17 matching lines...) Expand all Loading... |
48 // with different mechanism. For example in WebRTC, it is implemented with | 48 // with different mechanism. For example in WebRTC, it is implemented with |
49 // rtc::Thread. | 49 // rtc::Thread. |
50 QuartcTaskRunnerInterface* task_runner = nullptr; | 50 QuartcTaskRunnerInterface* task_runner = nullptr; |
51 // If create_at_exit_manager = true, an AtExitManager will be created and | 51 // If create_at_exit_manager = true, an AtExitManager will be created and |
52 // owned by the QuartcFactory. In some scenarios, such as unit tests, this | 52 // owned by the QuartcFactory. In some scenarios, such as unit tests, this |
53 // value could be false and no AtExitManager will be created. | 53 // value could be false and no AtExitManager will be created. |
54 bool create_at_exit_manager = true; | 54 bool create_at_exit_manager = true; |
55 }; | 55 }; |
56 | 56 |
57 // Creates a new instance of QuartcFactoryInterface. | 57 // Creates a new instance of QuartcFactoryInterface. |
58 NET_EXPORT_PRIVATE std::unique_ptr<QuartcFactoryInterface> CreateQuartcFactory( | 58 QUIC_EXPORT_PRIVATE std::unique_ptr<QuartcFactoryInterface> CreateQuartcFactory( |
59 const QuartcFactoryConfig& factory_config); | 59 const QuartcFactoryConfig& factory_config); |
60 | 60 |
61 } // namespace net | 61 } // namespace net |
62 | 62 |
63 #endif // NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ | 63 #endif // NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ |
OLD | NEW |