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

Unified Diff: talk/app/webrtc/dtlsidentitystore.h

Issue 1268363002: DtlsIdentityStoreInterface added. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master, remove unnecessary forw decl 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
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnectioninterface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/dtlsidentitystore.h
diff --git a/talk/app/webrtc/dtlsidentitystore.h b/talk/app/webrtc/dtlsidentitystore.h
index b2a797462fbe43b747070db0223fca07775aae05..b655a7d1b29f7fc7676685e37a495d3792c87bd3 100644
--- a/talk/app/webrtc/dtlsidentitystore.h
+++ b/talk/app/webrtc/dtlsidentitystore.h
@@ -31,17 +31,64 @@
#include <queue>
#include <string>
-#include "talk/app/webrtc/peerconnectioninterface.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/messagequeue.h"
+#include "webrtc/base/refcount.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h"
+#include "webrtc/base/sslidentity.h"
+#include "webrtc/base/thread.h"
namespace webrtc {
-class DTLSIdentityRequestObserver;
class SSLIdentity;
class Thread;
+// Used to receive callbacks of DTLS identity requests.
+class DTLSIdentityRequestObserver : public rtc::RefCountInterface {
+ public:
+ virtual void OnFailure(int error) = 0;
+ // TODO(jiayl): Unify the OnSuccess method once Chrome code is updated.
+ virtual void OnSuccess(const std::string& der_cert,
+ const std::string& der_private_key) = 0;
+ // |identity| is a scoped_ptr because rtc::SSLIdentity is not copyable and the
+ // client has to get the ownership of the object to make use of it.
+ virtual void OnSuccessWithIdentityObj(
+ rtc::scoped_ptr<rtc::SSLIdentity> identity) = 0;
+
+ protected:
+ virtual ~DTLSIdentityRequestObserver() {}
+};
+
+// TODO(hbos): To replace DTLSIdentityRequestObserver.
+// Used to receive callbacks of DTLS identity requests.
+class DtlsIdentityRequestObserver : public rtc::RefCountInterface {
+ public:
+ virtual void OnFailure(int error) = 0;
+ // TODO(hbos): Unify the OnSuccess method once Chrome code is updated.
+ virtual void OnSuccess(const std::string& der_cert,
+ const std::string& der_private_key) = 0;
+ // |identity| is a scoped_ptr because rtc::SSLIdentity is not copyable and the
+ // client has to get the ownership of the object to make use of it.
+ virtual void OnSuccess(rtc::scoped_ptr<rtc::SSLIdentity> identity) = 0;
+
+ protected:
+ virtual ~DtlsIdentityRequestObserver() {}
+};
+
+// TODO(hbos): To be implemented.
+// This interface defines an in-memory DTLS identity store, which generates DTLS
+// identities.
+// APIs calls must be made on the signaling thread and the callbacks are also
+// called on the signaling thread.
+class DtlsIdentityStoreInterface {
+ public:
+ virtual ~DtlsIdentityStoreInterface() { }
+
+ virtual void RequestIdentity(
+ rtc::KeyType key_type,
+ const rtc::scoped_refptr<DtlsIdentityRequestObserver>& observer) = 0;
+};
+
// This class implements an in-memory DTLS identity store, which generates the
// DTLS identity on the worker thread.
// APIs calls must be made on the signaling thread and the callbacks are also
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnectioninterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698