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

Unified Diff: talk/app/webrtc/dtlscertificate.cc

Issue 1269843005: Added DtlsCertificate, a ref counted object owning an SSLIdentity (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: webrtcsession_unittest cleanup Created 5 years, 4 months 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
Index: talk/app/webrtc/dtlscertificate.cc
diff --git a/talk/app/webrtc/dtlsidentityservice.cc b/talk/app/webrtc/dtlscertificate.cc
similarity index 68%
copy from talk/app/webrtc/dtlsidentityservice.cc
copy to talk/app/webrtc/dtlscertificate.cc
index b4b7279c8288395a8e23a507f7c78dc199572cab..edef63bed3b6ff722045e1eb9428300a7f646e0c 100644
--- a/talk/app/webrtc/dtlsidentityservice.cc
+++ b/talk/app/webrtc/dtlscertificate.cc
@@ -25,26 +25,30 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "talk/app/webrtc/dtlsidentityservice.h"
+#include "talk/app/webrtc/dtlscertificate.h"
-#include "talk/app/webrtc/dtlsidentitystore.h"
-#include "webrtc/base/logging.h"
+#include "webrtc/base/checks.h"
namespace webrtc {
-bool DtlsIdentityService::RequestIdentity(
- const std::string& identity_name,
- const std::string& common_name,
- webrtc::DTLSIdentityRequestObserver* observer) {
- if (identity_name != DtlsIdentityStore::kIdentityName ||
- common_name != DtlsIdentityStore::kIdentityName) {
- LOG(LS_WARNING) << "DtlsIdentityService::RequestIdentity called with "
- << "unsupported params, identity_name=" << identity_name
- << ", common_name=" << common_name;
- return false;
- }
- store_->RequestIdentity(observer);
- return true;
+rtc::scoped_refptr<DtlsCertificate> DtlsCertificate::Create(
+ rtc::scoped_ptr<rtc::SSLIdentity> identity) {
+ // TODO(hbos): |expires| should be specified (what is the right type for
+ // date?), and maybe tied to the identity generation?
+ return new rtc::RefCountedObject<DtlsCertificate>(identity.release(), 0.0);
hbos 2015/08/04 12:50:21 In blink it looked like double was used for dates
+}
+
+DtlsCertificate::DtlsCertificate(rtc::SSLIdentity* identity, double expires)
+ : identity_(identity), expires_(expires) {
+ DCHECK(identity_.get());
+}
+
+rtc::SSLIdentity* DtlsCertificate::identity() const {
+ return identity_.get();
+}
+
+double DtlsCertificate::expires() const {
+ return expires_;
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698