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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 this, &FakeQuicDataTransport::OnIncomingStream); | 113 this, &FakeQuicDataTransport::OnIncomingStream); |
114 } | 114 } |
115 | 115 |
116 rtc::scoped_refptr<QuicDataChannel> CreateDataChannel( | 116 rtc::scoped_refptr<QuicDataChannel> CreateDataChannel( |
117 int id, | 117 int id, |
118 const std::string& label, | 118 const std::string& label, |
119 const std::string& protocol) { | 119 const std::string& protocol) { |
120 DataChannelInit config; | 120 DataChannelInit config; |
121 config.id = id; | 121 config.id = id; |
122 config.protocol = protocol; | 122 config.protocol = protocol; |
123 rtc::scoped_refptr<QuicDataChannel> data_channel(new QuicDataChannel( | 123 rtc::scoped_refptr<QuicDataChannel> data_channel( |
124 rtc::Thread::Current(), rtc::Thread::Current(), label, config)); | 124 new QuicDataChannel(rtc::Thread::Current(), rtc::Thread::Current(), |
| 125 rtc::Thread::Current(), label, config)); |
125 data_channel_by_id_[id] = data_channel; | 126 data_channel_by_id_[id] = data_channel; |
126 return data_channel; | 127 return data_channel; |
127 } | 128 } |
128 | 129 |
129 private: | 130 private: |
130 void OnIncomingStream(cricket::ReliableQuicStream* stream) { | 131 void OnIncomingStream(cricket::ReliableQuicStream* stream) { |
131 incoming_stream_ = stream; | 132 incoming_stream_ = stream; |
132 incoming_stream_->SignalDataReceived.connect( | 133 incoming_stream_->SignalDataReceived.connect( |
133 this, &FakeQuicDataTransport::OnDataReceived); | 134 this, &FakeQuicDataTransport::OnDataReceived); |
134 } | 135 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 195 |
195 rtc::scoped_refptr<QuicDataChannel> CreateDataChannelWithoutTransportChannel( | 196 rtc::scoped_refptr<QuicDataChannel> CreateDataChannelWithoutTransportChannel( |
196 int id, | 197 int id, |
197 const std::string& label, | 198 const std::string& label, |
198 const std::string& protocol) { | 199 const std::string& protocol) { |
199 return fake_quic_data_transport_.CreateDataChannel(id, label, protocol); | 200 return fake_quic_data_transport_.CreateDataChannel(id, label, protocol); |
200 } | 201 } |
201 | 202 |
202 // Connects |ice_transport_channel_| to that of the other peer. | 203 // Connects |ice_transport_channel_| to that of the other peer. |
203 void Connect(QuicDataChannelPeer* other_peer) { | 204 void Connect(QuicDataChannelPeer* other_peer) { |
204 ice_transport_channel_->Connect(); | |
205 other_peer->ice_transport_channel_->Connect(); | |
206 ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_); | 205 ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_); |
207 } | 206 } |
208 | 207 |
209 std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() { | 208 std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() { |
210 return local_fingerprint_; | 209 return local_fingerprint_; |
211 } | 210 } |
212 | 211 |
213 QuicTransportChannel* quic_transport_channel() { | 212 QuicTransportChannel* quic_transport_channel() { |
214 return &quic_transport_channel_; | 213 return &quic_transport_channel_; |
215 } | 214 } |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 size_t bytes_read2; | 649 size_t bytes_read2; |
651 ASSERT_TRUE(webrtc::ParseQuicDataMessageHeader( | 650 ASSERT_TRUE(webrtc::ParseQuicDataMessageHeader( |
652 header2.data<char>(), header2.size(), &decoded_data_channel_id2, | 651 header2.data<char>(), header2.size(), &decoded_data_channel_id2, |
653 &decoded_message_id2, &bytes_read2)); | 652 &decoded_message_id2, &bytes_read2)); |
654 EXPECT_EQ(data_channel_id2, decoded_data_channel_id2); | 653 EXPECT_EQ(data_channel_id2, decoded_data_channel_id2); |
655 EXPECT_EQ(message_id2, decoded_message_id2); | 654 EXPECT_EQ(message_id2, decoded_message_id2); |
656 EXPECT_EQ(8u, bytes_read2); | 655 EXPECT_EQ(8u, bytes_read2); |
657 } | 656 } |
658 | 657 |
659 } // namespace | 658 } // namespace |
OLD | NEW |