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

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

Issue 1312643004: Replaces SSLIdentity* with scoped_refptr<RTCCertificate> in cricket::Transport layer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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: webrtc/p2p/base/fakesession.h
diff --git a/webrtc/p2p/base/fakesession.h b/webrtc/p2p/base/fakesession.h
index b63958e4d335d6c3056ea6242e2830003bb7567d..96ef1199573b09ff0e07a725af688ce080c6cf1f 100644
--- a/webrtc/p2p/base/fakesession.h
+++ b/webrtc/p2p/base/fakesession.h
@@ -336,8 +336,7 @@ class FakeTransport : public Transport {
: Transport(signaling_thread, worker_thread,
content_name, NULL),
dest_(NULL),
tommi 2015/08/25 10:28:08 nit: can you fix the indent here?
hbos 2015/08/25 15:45:44 Done.
- async_(false),
- identity_(NULL) {
+ async_(false) {
}
~FakeTransport() {
DestroyAllChannels();
@@ -350,7 +349,9 @@ class FakeTransport : public Transport {
dest_ = dest;
for (ChannelMap::iterator it = channels_.begin(); it != channels_.end();
++it) {
- it->second->SetLocalIdentity(identity_);
+ // TODO(hbos): SetLocalCertificate
+ it->second->SetLocalIdentity(
+ certificate_ ? certificate_->identity() : nullptr);
SetChannelDestination(it->first, it->second);
}
}
@@ -362,8 +363,9 @@ class FakeTransport : public Transport {
}
}
- void set_identity(rtc::SSLIdentity* identity) {
- identity_ = identity;
+ void set_certificate(
+ const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
+ certificate_ = certificate;
}
using Transport::local_description;
@@ -385,14 +387,16 @@ class FakeTransport : public Transport {
channels_.erase(channel->component());
delete channel;
}
- virtual void SetIdentity_w(rtc::SSLIdentity* identity) {
- identity_ = identity;
+ void SetCertificate_w(
+ const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override {
+ certificate_ = certificate;
tommi 2015/08/25 10:28:08 there should be thread checks in this implementati
hbos 2015/08/25 15:45:44 Added a TODO.
}
- virtual bool GetIdentity_w(rtc::SSLIdentity** identity) {
- if (!identity_)
+ bool GetCertificate_w(
+ rtc::scoped_refptr<rtc::RTCCertificate>* certificate) override {
+ if (!certificate_)
return false;
- *identity = identity_->GetReference();
+ *certificate = certificate_;
return true;
}
@@ -407,7 +411,9 @@ class FakeTransport : public Transport {
if (dest_) {
dest_channel = dest_->GetFakeChannel(component);
if (dest_channel) {
- dest_channel->SetLocalIdentity(dest_->identity_);
+ // TODO(hbos): SetLocalCertificate
+ dest_channel->SetLocalIdentity(
+ dest_->certificate_ ? dest_->certificate_->identity() : nullptr);
}
}
channel->SetDestination(dest_channel);
@@ -418,7 +424,7 @@ class FakeTransport : public Transport {
ChannelMap channels_;
FakeTransport* dest_;
bool async_;
- rtc::SSLIdentity* identity_;
+ rtc::scoped_refptr<rtc::RTCCertificate> certificate_;
};
// Fake session class, which can be passed into a BaseChannel object for
@@ -474,13 +480,14 @@ class FakeSession : public BaseSession {
}
// TODO: Hoist this into Session when we re-work the Session code.
- void set_ssl_identity(rtc::SSLIdentity* identity) {
+ void set_ssl_rtccertificate(
+ const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
for (TransportMap::const_iterator it = transport_proxies().begin();
it != transport_proxies().end(); ++it) {
// We know that we have a FakeTransport*
- static_cast<FakeTransport*>(it->second->impl())->set_identity
- (identity);
+ static_cast<FakeTransport*>(it->second->impl())->set_certificate
+ (certificate);
}
}

Powered by Google App Engine
This is Rietveld 408576698