OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // QuicDataTransport creates QuicDataChannels for the PeerConnection. It also | 30 // QuicDataTransport creates QuicDataChannels for the PeerConnection. It also |
31 // handles QUIC stream demuxing by distributing incoming QUIC streams from the | 31 // handles QUIC stream demuxing by distributing incoming QUIC streams from the |
32 // QuicTransportChannel among the QuicDataChannels that it has created. | 32 // QuicTransportChannel among the QuicDataChannels that it has created. |
33 // | 33 // |
34 // QuicDataTransport reads the data channel ID from the incoming QUIC stream, | 34 // QuicDataTransport reads the data channel ID from the incoming QUIC stream, |
35 // then looks it up in a map of ID => QuicDataChannel. If the data channel | 35 // then looks it up in a map of ID => QuicDataChannel. If the data channel |
36 // exists, it sends the QUIC stream to the QuicDataChannel. | 36 // exists, it sends the QUIC stream to the QuicDataChannel. |
37 class QuicDataTransport : public sigslot::has_slots<> { | 37 class QuicDataTransport : public sigslot::has_slots<> { |
38 public: | 38 public: |
39 QuicDataTransport(rtc::Thread* signaling_thread, rtc::Thread* worker_thread); | 39 QuicDataTransport(rtc::Thread* signaling_thread, |
| 40 rtc::Thread* worker_thread, |
| 41 rtc::Thread* network_thread); |
40 ~QuicDataTransport() override; | 42 ~QuicDataTransport() override; |
41 | 43 |
42 // Sets the QUIC transport channel for the QuicDataChannels and the | 44 // Sets the QUIC transport channel for the QuicDataChannels and the |
43 // QuicDataTransport. Returns false if a different QUIC transport channel is | 45 // QuicDataTransport. Returns false if a different QUIC transport channel is |
44 // already set, the QUIC transport channel cannot be set for any of the | 46 // already set, the QUIC transport channel cannot be set for any of the |
45 // QuicDataChannels, or |channel| is NULL. | 47 // QuicDataChannels, or |channel| is NULL. |
46 bool SetTransportChannel(cricket::QuicTransportChannel* channel); | 48 bool SetTransportChannel(cricket::QuicTransportChannel* channel); |
47 | 49 |
48 // Creates a QuicDataChannel that uses this QuicDataTransport. | 50 // Creates a QuicDataChannel that uses this QuicDataTransport. |
49 rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( | 51 rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( |
(...skipping 23 matching lines...) Expand all Loading... |
73 size_t len); | 75 size_t len); |
74 | 76 |
75 // Map of data channel ID => QUIC data channel values. | 77 // Map of data channel ID => QUIC data channel values. |
76 std::unordered_map<int, rtc::scoped_refptr<QuicDataChannel>> | 78 std::unordered_map<int, rtc::scoped_refptr<QuicDataChannel>> |
77 data_channel_by_id_; | 79 data_channel_by_id_; |
78 // Map of QUIC stream ID => ReliableQuicStream* values. | 80 // Map of QUIC stream ID => ReliableQuicStream* values. |
79 std::unordered_map<net::QuicStreamId, cricket::ReliableQuicStream*> | 81 std::unordered_map<net::QuicStreamId, cricket::ReliableQuicStream*> |
80 quic_stream_by_id_; | 82 quic_stream_by_id_; |
81 // QuicTransportChannel for sending/receiving data. | 83 // QuicTransportChannel for sending/receiving data. |
82 cricket::QuicTransportChannel* quic_transport_channel_ = nullptr; | 84 cricket::QuicTransportChannel* quic_transport_channel_ = nullptr; |
83 // Signaling and worker threads for the QUIC data channel. | 85 // Threads for the QUIC data channel. |
84 rtc::Thread* const signaling_thread_; | 86 rtc::Thread* const signaling_thread_; |
85 rtc::Thread* const worker_thread_; | 87 rtc::Thread* const worker_thread_; |
| 88 rtc::Thread* const network_thread_; |
86 }; | 89 }; |
87 | 90 |
88 } // namespace webrtc | 91 } // namespace webrtc |
89 | 92 |
90 #endif // WEBRTC_API_QUICDATATRANSPORT_H_ | 93 #endif // WEBRTC_API_QUICDATATRANSPORT_H_ |
OLD | NEW |