From 5291393510c17748701706471272c1ba0151dec2 Mon Sep 17 00:00:00 2001 From: hbos Date: Mon, 7 Mar 2016 15:14:40 -0800 Subject: [PATCH] DtlsIdentityStoreInterface::RequestIdentity: const& parameters Changing from: virtual void RequestIdentity( rtc::KeyParams key_params, rtc::Optional expires, const rtc::scoped_refptr& observer); to: virtual void RequestIdentity( const rtc::KeyParams& key_params, const rtc::Optional& expires_ms, const rtc::scoped_refptr& observer); Making FakeDtlsIdentityStore DCHECK that |expires_ms| is not set, since it does not support that parameterization. In a follow-up chromium CL the new signature will be used. BUG=webrtc:5092, chromium:544902 Review URL: https://codereview.webrtc.org/1766673002 Cr-Commit-Position: refs/heads/master@{#11892} --- webrtc/api/dtlsidentitystore.cc | 6 +++--- webrtc/api/dtlsidentitystore.h | 8 ++++---- webrtc/api/peerconnectionfactory.cc | 6 +++--- webrtc/api/test/fakedtlsidentitystore.h | 7 ++++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/webrtc/api/dtlsidentitystore.cc b/webrtc/api/dtlsidentitystore.cc index 31c9bc0543..a485188065 100644 --- a/webrtc/api/dtlsidentitystore.cc +++ b/webrtc/api/dtlsidentitystore.cc @@ -122,13 +122,13 @@ DtlsIdentityStoreImpl::~DtlsIdentityStoreImpl() { } void DtlsIdentityStoreImpl::RequestIdentity( - rtc::KeyParams key_params, - rtc::Optional expires, + const rtc::KeyParams& key_params, + const rtc::Optional& expires_ms, const rtc::scoped_refptr& observer) { RTC_DCHECK(signaling_thread_->IsCurrent()); RTC_DCHECK(observer); - // Dropping parameterization and |expires|. + // Dropping parameterization and |expires_ms|. // TODO(hbos,torbjorng): Use parameterizaton/expiration. webrtc:5092. GenerateIdentity(key_params.type(), observer); } diff --git a/webrtc/api/dtlsidentitystore.h b/webrtc/api/dtlsidentitystore.h index 8666b3cf3d..af4229201c 100644 --- a/webrtc/api/dtlsidentitystore.h +++ b/webrtc/api/dtlsidentitystore.h @@ -70,8 +70,8 @@ class DtlsIdentityStoreInterface { RequestIdentity(key_params, rtc::Optional(), observer); } virtual void RequestIdentity( - rtc::KeyParams key_params, - rtc::Optional expires, + const rtc::KeyParams& key_params, + const rtc::Optional& expires_ms, const rtc::scoped_refptr& observer) { // Drop |expires|. RequestIdentity(key_params, observer); @@ -91,8 +91,8 @@ class DtlsIdentityStoreImpl : public DtlsIdentityStoreInterface, // DtlsIdentityStoreInterface override; void RequestIdentity( - rtc::KeyParams key_params, - rtc::Optional expires, + const rtc::KeyParams& key_params, + const rtc::Optional& expires_ms, const rtc::scoped_refptr& observer) override; // rtc::MessageHandler override; diff --git a/webrtc/api/peerconnectionfactory.cc b/webrtc/api/peerconnectionfactory.cc index 4d8125fe8b..40e845f4d6 100644 --- a/webrtc/api/peerconnectionfactory.cc +++ b/webrtc/api/peerconnectionfactory.cc @@ -46,11 +46,11 @@ class DtlsIdentityStoreWrapper : public DtlsIdentityStoreInterface { } void RequestIdentity( - rtc::KeyParams key_params, - rtc::Optional expires, + const rtc::KeyParams& key_params, + const rtc::Optional& expires_ms, const rtc::scoped_refptr& observer) override { - store_->RequestIdentity(key_params, expires, observer); + store_->RequestIdentity(key_params, expires_ms, observer); } private: diff --git a/webrtc/api/test/fakedtlsidentitystore.h b/webrtc/api/test/fakedtlsidentitystore.h index 7c8a4fc71f..8bbffbf93e 100644 --- a/webrtc/api/test/fakedtlsidentitystore.h +++ b/webrtc/api/test/fakedtlsidentitystore.h @@ -96,14 +96,15 @@ class FakeDtlsIdentityStore : public webrtc::DtlsIdentityStoreInterface, void use_alternate_key() { key_index_ = 1; } void RequestIdentity( - rtc::KeyParams key_params, - rtc::Optional expires, + const rtc::KeyParams& key_params, + const rtc::Optional& expires_ms, const rtc::scoped_refptr& observer) override { // TODO(hbos): Should be able to generate KT_ECDSA too. RTC_DCHECK((key_params.type() == rtc::KT_RSA && key_params.rsa_params().mod_size == 1024 && - key_params.rsa_params().pub_exp == 0x10001) || + key_params.rsa_params().pub_exp == 0x10001 && + !expires_ms) || should_fail_); MessageData* msg = new MessageData( rtc::scoped_refptr(observer));