Create a in-memory DTLS identity store that keeps a free identity generated in the background.

BUG=4241
R=pthatcher@webrtc.org

Committed: https://code.google.com/p/webrtc/source/detail?r=8576

Committed: https://code.google.com/p/webrtc/source/detail?r=8581

Review URL: https://webrtc-codereview.appspot.com/37889004

Cr-Commit-Position: refs/heads/master@{#8605}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8605 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/app/webrtc/peerconnectioninterface.h b/talk/app/webrtc/peerconnectioninterface.h
index 391255f..6f6eb24 100644
--- a/talk/app/webrtc/peerconnectioninterface.h
+++ b/talk/app/webrtc/peerconnectioninterface.h
@@ -82,6 +82,7 @@
 #include "webrtc/base/socketaddress.h"
 
 namespace rtc {
+class SSLIdentity;
 class Thread;
 }
 
@@ -437,8 +438,14 @@
 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() {}
 };
@@ -503,6 +510,7 @@
 
   virtual void SetOptions(const Options& options) = 0;
 
+  // This method takes the ownership of |dtls_identity_service|.
   virtual rtc::scoped_refptr<PeerConnectionInterface>
       CreatePeerConnection(
           const PeerConnectionInterface::RTCConfiguration& configuration,