OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 const Candidates& remote_candidates() const { return remote_candidates_; } | 224 const Candidates& remote_candidates() const { return remote_candidates_; } |
225 | 225 |
226 void OnMessage(rtc::Message* msg) override { | 226 void OnMessage(rtc::Message* msg) override { |
227 PacketMessageData* data = static_cast<PacketMessageData*>(msg->pdata); | 227 PacketMessageData* data = static_cast<PacketMessageData*>(msg->pdata); |
228 dest_->SignalReadPacket(dest_, data->packet.data<char>(), | 228 dest_->SignalReadPacket(dest_, data->packet.data<char>(), |
229 data->packet.size(), rtc::CreatePacketTime(0), 0); | 229 data->packet.size(), rtc::CreatePacketTime(0), 0); |
230 delete data; | 230 delete data; |
231 } | 231 } |
232 | 232 |
233 bool SetLocalCertificate( | 233 bool SetLocalCertificate( |
234 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override { | 234 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) { |
235 local_cert_ = certificate; | 235 local_cert_ = certificate; |
236 return true; | 236 return true; |
237 } | 237 } |
238 | 238 |
239 void SetRemoteSSLCertificate(rtc::FakeSSLCertificate* cert) { | 239 void SetRemoteSSLCertificate(rtc::FakeSSLCertificate* cert) { |
240 remote_cert_ = cert; | 240 remote_cert_ = cert; |
241 } | 241 } |
242 | 242 |
243 bool IsDtlsActive() const override { return do_dtls_; } | 243 bool IsDtlsActive() const override { return do_dtls_; } |
244 | 244 |
245 bool SetSrtpCryptoSuites(const std::vector<int>& ciphers) override { | 245 bool SetSrtpCryptoSuites(const std::vector<int>& ciphers) override { |
246 srtp_ciphers_ = ciphers; | 246 srtp_ciphers_ = ciphers; |
247 return true; | 247 return true; |
248 } | 248 } |
249 | 249 |
250 bool GetSrtpCryptoSuite(int* crypto_suite) override { | 250 bool GetSrtpCryptoSuite(int* crypto_suite) override { |
251 if (chosen_crypto_suite_ != rtc::SRTP_INVALID_CRYPTO_SUITE) { | 251 if (chosen_crypto_suite_ != rtc::SRTP_INVALID_CRYPTO_SUITE) { |
252 *crypto_suite = chosen_crypto_suite_; | 252 *crypto_suite = chosen_crypto_suite_; |
253 return true; | 253 return true; |
254 } | 254 } |
255 return false; | 255 return false; |
256 } | 256 } |
257 | 257 |
258 bool GetSslCipherSuite(int* cipher_suite) override { return false; } | 258 bool GetSslCipherSuite(int* cipher_suite) override { return false; } |
259 | 259 |
260 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const override { | 260 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const { |
261 return local_cert_; | 261 return local_cert_; |
262 } | 262 } |
263 | 263 |
264 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate() | 264 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate() |
265 const override { | 265 const override { |
266 return remote_cert_ ? std::unique_ptr<rtc::SSLCertificate>( | 266 return remote_cert_ ? std::unique_ptr<rtc::SSLCertificate>( |
267 remote_cert_->GetReference()) | 267 remote_cert_->GetReference()) |
268 : nullptr; | 268 : nullptr; |
269 } | 269 } |
270 | 270 |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 } | 572 } |
573 } | 573 } |
574 | 574 |
575 private: | 575 private: |
576 bool fail_create_channel_; | 576 bool fail_create_channel_; |
577 }; | 577 }; |
578 | 578 |
579 } // namespace cricket | 579 } // namespace cricket |
580 | 580 |
581 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ | 581 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ |
OLD | NEW |