Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_INTERFACE_H_ | |
| 6 #define NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ | |
| 7 | |
| 8 #include "net/base/net_export.h" | |
|
zhihuang1
2016/10/13 06:22:41
Same as before. This is a stand-alone header with
| |
| 9 #include "net/quic/quartc/quartc_session_interface.h" | |
| 10 #include "net/quic/quartc/quartc_task_runner_interface.h" | |
| 11 | |
| 12 namespace net { | |
| 13 | |
| 14 // Used to create instances for Quartc objects such as QuartcSession. | |
| 15 class QuartcFactoryInterface { | |
| 16 public: | |
| 17 virtual ~QuartcFactoryInterface() {} | |
| 18 | |
| 19 struct QuartcSessionConfig { | |
| 20 // When using Quartc, there are two endpoints. The QuartcSession on one | |
| 21 // endpoint must act as a server and the one on the other side must act as a | |
| 22 // client. | |
| 23 bool is_server = false; | |
| 24 // This is only needed when is_server = false. It must be unique | |
| 25 // for each endpoint the local endpoint may communicate with. For example, | |
| 26 // a WebRTC client could use the remote endpoint's crypto fingerprint | |
| 27 std::string unique_remote_server_id; | |
| 28 // The way the QuicConnection will send and receive packets, like a virtual | |
| 29 // UDP socket. For WebRTC, this will typically be an IceTransport. | |
| 30 QuartcSessionInterface::PacketTransport* packet_transport = nullptr; | |
| 31 }; | |
| 32 | |
| 33 virtual std::unique_ptr<QuartcSessionInterface> CreateQuartcSession( | |
| 34 const QuartcSessionConfig& quartc_config) = 0; | |
| 35 }; | |
| 36 | |
| 37 // The configuration for creating a QuartcFactory. | |
| 38 struct QuartcFactoryConfig { | |
| 39 // The task runner used by the QuartcAlarm. Implemented by the Quartc user | |
| 40 // with different mechanism. For example in WebRTC, it is implemented with | |
| 41 // rtc::Thread. | |
| 42 QuartcTaskRunnerInterface* quartc_task_runner; | |
|
pthatcher1
2016/10/14 18:59:00
"task_runner" is probably sufficient.
And should
zhihuang1
2016/10/16 00:45:28
I removed the "=nullptr" from other classes becaus
| |
| 43 }; | |
| 44 | |
| 45 // Creates a new instance of QuartcFactoryInterface. | |
| 46 NET_EXPORT_PRIVATE std::unique_ptr<QuartcFactoryInterface> CreateQuartcFactory( | |
| 47 const QuartcFactoryConfig& factory_config); | |
| 48 | |
| 49 } // namepace net | |
| 50 | |
| 51 #endif // NET_QUIC_QUARTC_QUARTC_FACTORY_INTERFACE_H_ | |
| OLD | NEW |