Chromium Code Reviews| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 public rtc::MessageHandler { | 44 public rtc::MessageHandler { |
| 45 public: | 45 public: |
| 46 explicit FakeTransportChannel(Transport* transport, | 46 explicit FakeTransportChannel(Transport* transport, |
| 47 const std::string& name, | 47 const std::string& name, |
| 48 int component) | 48 int component) |
| 49 : TransportChannelImpl(name, component), | 49 : TransportChannelImpl(name, component), |
| 50 transport_(transport), | 50 transport_(transport), |
| 51 dtls_fingerprint_("", nullptr, 0) {} | 51 dtls_fingerprint_("", nullptr, 0) {} |
| 52 ~FakeTransportChannel() { Reset(); } | 52 ~FakeTransportChannel() { Reset(); } |
| 53 | 53 |
| 54 uint64 IceTiebreaker() const { return tiebreaker_; } | 54 uint64_t IceTiebreaker() const { return tiebreaker_; } |
| 55 IceMode remote_ice_mode() const { return remote_ice_mode_; } | 55 IceMode remote_ice_mode() const { return remote_ice_mode_; } |
| 56 const std::string& ice_ufrag() const { return ice_ufrag_; } | 56 const std::string& ice_ufrag() const { return ice_ufrag_; } |
| 57 const std::string& ice_pwd() const { return ice_pwd_; } | 57 const std::string& ice_pwd() const { return ice_pwd_; } |
| 58 const std::string& remote_ice_ufrag() const { return remote_ice_ufrag_; } | 58 const std::string& remote_ice_ufrag() const { return remote_ice_ufrag_; } |
| 59 const std::string& remote_ice_pwd() const { return remote_ice_pwd_; } | 59 const std::string& remote_ice_pwd() const { return remote_ice_pwd_; } |
| 60 const rtc::SSLFingerprint& dtls_fingerprint() const { | 60 const rtc::SSLFingerprint& dtls_fingerprint() const { |
| 61 return dtls_fingerprint_; | 61 return dtls_fingerprint_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 // If async, will send packets by "Post"-ing to message queue instead of | 64 // If async, will send packets by "Post"-ing to message queue instead of |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 75 | 75 |
| 76 if (connection_count_ == 1) { | 76 if (connection_count_ == 1) { |
| 77 return TransportChannelState::STATE_COMPLETED; | 77 return TransportChannelState::STATE_COMPLETED; |
| 78 } | 78 } |
| 79 | 79 |
| 80 return TransportChannelState::STATE_CONNECTING; | 80 return TransportChannelState::STATE_CONNECTING; |
| 81 } | 81 } |
| 82 | 82 |
| 83 void SetIceRole(IceRole role) override { role_ = role; } | 83 void SetIceRole(IceRole role) override { role_ = role; } |
| 84 IceRole GetIceRole() const override { return role_; } | 84 IceRole GetIceRole() const override { return role_; } |
| 85 void SetIceTiebreaker(uint64 tiebreaker) override { | 85 void SetIceTiebreaker(uint64_t tiebreaker) override { |
| 86 tiebreaker_ = tiebreaker; | 86 tiebreaker_ = tiebreaker; |
| 87 } | 87 } |
| 88 void SetIceCredentials(const std::string& ice_ufrag, | 88 void SetIceCredentials(const std::string& ice_ufrag, |
| 89 const std::string& ice_pwd) override { | 89 const std::string& ice_pwd) override { |
| 90 ice_ufrag_ = ice_ufrag; | 90 ice_ufrag_ = ice_ufrag; |
| 91 ice_pwd_ = ice_pwd; | 91 ice_pwd_ = ice_pwd; |
| 92 } | 92 } |
| 93 void SetRemoteIceCredentials(const std::string& ice_ufrag, | 93 void SetRemoteIceCredentials(const std::string& ice_ufrag, |
| 94 const std::string& ice_pwd) override { | 94 const std::string& ice_pwd) override { |
| 95 remote_ice_ufrag_ = ice_ufrag; | 95 remote_ice_ufrag_ = ice_ufrag; |
| 96 remote_ice_pwd_ = ice_pwd; | 96 remote_ice_pwd_ = ice_pwd; |
| 97 } | 97 } |
| 98 | 98 |
| 99 void SetRemoteIceMode(IceMode mode) override { remote_ice_mode_ = mode; } | 99 void SetRemoteIceMode(IceMode mode) override { remote_ice_mode_ = mode; } |
| 100 bool SetRemoteFingerprint(const std::string& alg, | 100 bool SetRemoteFingerprint(const std::string& alg, |
| 101 const uint8* digest, | 101 const uint8_t* digest, |
| 102 size_t digest_len) override { | 102 size_t digest_len) override { |
| 103 dtls_fingerprint_ = rtc::SSLFingerprint(alg, digest, digest_len); | 103 dtls_fingerprint_ = rtc::SSLFingerprint(alg, digest, digest_len); |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 bool SetSslRole(rtc::SSLRole role) override { | 106 bool SetSslRole(rtc::SSLRole role) override { |
| 107 ssl_role_ = role; | 107 ssl_role_ = role; |
| 108 return true; | 108 return true; |
| 109 } | 109 } |
| 110 bool GetSslRole(rtc::SSLRole* role) const override { | 110 bool GetSslRole(rtc::SSLRole* role) const override { |
| 111 *role = ssl_role_; | 111 *role = ssl_role_; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 | 259 |
| 260 bool GetRemoteSSLCertificate(rtc::SSLCertificate** cert) const override { | 260 bool GetRemoteSSLCertificate(rtc::SSLCertificate** cert) const override { |
| 261 if (!remote_cert_) | 261 if (!remote_cert_) |
| 262 return false; | 262 return false; |
| 263 | 263 |
| 264 *cert = remote_cert_->GetReference(); | 264 *cert = remote_cert_->GetReference(); |
| 265 return true; | 265 return true; |
| 266 } | 266 } |
| 267 | 267 |
| 268 bool ExportKeyingMaterial(const std::string& label, | 268 bool ExportKeyingMaterial(const std::string& label, |
| 269 const uint8* context, | 269 const uint8_t* context, |
| 270 size_t context_len, | 270 size_t context_len, |
| 271 bool use_context, | 271 bool use_context, |
| 272 uint8* result, | 272 uint8_t* result, |
| 273 size_t result_len) override { | 273 size_t result_len) override { |
| 274 if (!chosen_srtp_cipher_.empty()) { | 274 if (!chosen_srtp_cipher_.empty()) { |
| 275 memset(result, 0xff, result_len); | 275 memset(result, 0xff, result_len); |
| 276 return true; | 276 return true; |
| 277 } | 277 } |
| 278 | 278 |
| 279 return false; | 279 return false; |
| 280 } | 280 } |
| 281 | 281 |
| 282 void NegotiateSrtpCiphers() { | 282 void NegotiateSrtpCiphers() { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 State state_ = STATE_INIT; | 315 State state_ = STATE_INIT; |
| 316 bool async_ = false; | 316 bool async_ = false; |
| 317 Candidates remote_candidates_; | 317 Candidates remote_candidates_; |
| 318 rtc::scoped_refptr<rtc::RTCCertificate> local_cert_; | 318 rtc::scoped_refptr<rtc::RTCCertificate> local_cert_; |
| 319 rtc::FakeSSLCertificate* remote_cert_ = nullptr; | 319 rtc::FakeSSLCertificate* remote_cert_ = nullptr; |
| 320 bool do_dtls_ = false; | 320 bool do_dtls_ = false; |
| 321 std::vector<std::string> srtp_ciphers_; | 321 std::vector<std::string> srtp_ciphers_; |
| 322 std::string chosen_srtp_cipher_; | 322 std::string chosen_srtp_cipher_; |
| 323 int receiving_timeout_ = -1; | 323 int receiving_timeout_ = -1; |
| 324 bool gather_continually_ = false; | 324 bool gather_continually_ = false; |
| 325 IceRole role_ = ICEROLE_UNKNOWN; | 325 IceRole role_; |
|
the sun
2015/10/06 11:23:53
Why aren't these needed anymore?
pbos-webrtc
2015/10/06 11:55:12
Sorry, bad rebase. Added back, thanks.
| |
| 326 uint64 tiebreaker_ = 0; | 326 uint64_t tiebreaker_; |
| 327 std::string ice_ufrag_; | 327 std::string ice_ufrag_; |
| 328 std::string ice_pwd_; | 328 std::string ice_pwd_; |
| 329 std::string remote_ice_ufrag_; | 329 std::string remote_ice_ufrag_; |
| 330 std::string remote_ice_pwd_; | 330 std::string remote_ice_pwd_; |
| 331 IceMode remote_ice_mode_ = ICEMODE_FULL; | 331 IceMode remote_ice_mode_ = ICEMODE_FULL; |
| 332 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_10; | 332 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_10; |
| 333 rtc::SSLFingerprint dtls_fingerprint_; | 333 rtc::SSLFingerprint dtls_fingerprint_; |
| 334 rtc::SSLRole ssl_role_ = rtc::SSL_CLIENT; | 334 rtc::SSLRole ssl_role_ = rtc::SSL_CLIENT; |
| 335 size_t connection_count_ = 0; | 335 size_t connection_count_ = 0; |
| 336 IceGatheringState gathering_state_ = kIceGatheringNew; | 336 IceGatheringState gathering_state_ = kIceGatheringNew; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 } | 531 } |
| 532 } | 532 } |
| 533 | 533 |
| 534 private: | 534 private: |
| 535 bool fail_create_channel_; | 535 bool fail_create_channel_; |
| 536 }; | 536 }; |
| 537 | 537 |
| 538 } // namespace cricket | 538 } // namespace cricket |
| 539 | 539 |
| 540 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ | 540 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ |
| OLD | NEW |