Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Unified Diff: webrtc/p2p/base/faketransportcontroller.h

Issue 1416673006: Convert internal representation of Srtp cryptos from string to int. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: change srtp crypto name conversion Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel_unittest.cc ('k') | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/faketransportcontroller.h
diff --git a/webrtc/p2p/base/faketransportcontroller.h b/webrtc/p2p/base/faketransportcontroller.h
index 3e656fa4a3ff10583726269487e7d3f77fdb7184..251a0c681aa448bee449937bd43f7ae0f1d1a508 100644
--- a/webrtc/p2p/base/faketransportcontroller.h
+++ b/webrtc/p2p/base/faketransportcontroller.h
@@ -242,20 +242,20 @@ class FakeTransportChannel : public TransportChannelImpl,
bool IsDtlsActive() const override { return do_dtls_; }
- bool SetSrtpCiphers(const std::vector<std::string>& ciphers) override {
+ bool SetSrtpCryptoSuites(const std::vector<int>& ciphers) override {
srtp_ciphers_ = ciphers;
return true;
}
- bool GetSrtpCryptoSuite(std::string* cipher) override {
- if (!chosen_srtp_cipher_.empty()) {
- *cipher = chosen_srtp_cipher_;
+ bool GetSrtpCryptoSuite(int* crypto_suite) override {
+ if (chosen_crypto_suite_ != rtc::SRTP_INVALID_CRYPTO_SUITE) {
+ *crypto_suite = chosen_crypto_suite_;
return true;
}
return false;
}
- bool GetSslCipherSuite(int* cipher) override { return false; }
+ bool GetSslCipherSuite(int* cipher_suite) override { return false; }
rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const {
return local_cert_;
@@ -275,7 +275,7 @@ class FakeTransportChannel : public TransportChannelImpl,
bool use_context,
uint8_t* result,
size_t result_len) override {
- if (!chosen_srtp_cipher_.empty()) {
+ if (chosen_crypto_suite_ != rtc::SRTP_INVALID_CRYPTO_SUITE) {
memset(result, 0xff, result_len);
return true;
}
@@ -284,14 +284,13 @@ class FakeTransportChannel : public TransportChannelImpl,
}
void NegotiateSrtpCiphers() {
- for (std::vector<std::string>::const_iterator it1 = srtp_ciphers_.begin();
+ for (std::vector<int>::const_iterator it1 = srtp_ciphers_.begin();
it1 != srtp_ciphers_.end(); ++it1) {
- for (std::vector<std::string>::const_iterator it2 =
- dest_->srtp_ciphers_.begin();
+ for (std::vector<int>::const_iterator it2 = dest_->srtp_ciphers_.begin();
it2 != dest_->srtp_ciphers_.end(); ++it2) {
if (*it1 == *it2) {
- chosen_srtp_cipher_ = *it1;
- dest_->chosen_srtp_cipher_ = *it2;
+ chosen_crypto_suite_ = *it1;
+ dest_->chosen_crypto_suite_ = *it2;
return;
}
}
@@ -322,8 +321,8 @@ class FakeTransportChannel : public TransportChannelImpl,
rtc::scoped_refptr<rtc::RTCCertificate> local_cert_;
rtc::FakeSSLCertificate* remote_cert_ = nullptr;
bool do_dtls_ = false;
- std::vector<std::string> srtp_ciphers_;
- std::string chosen_srtp_cipher_;
+ std::vector<int> srtp_ciphers_;
+ int chosen_crypto_suite_ = rtc::SRTP_INVALID_CRYPTO_SUITE;
int receiving_timeout_ = -1;
bool gather_continually_ = false;
IceRole role_ = ICEROLE_UNKNOWN;
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel_unittest.cc ('k') | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698