#ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_IDENTITY_SERVICE_H_
#define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_IDENTITY_SERVICE_H_
#include <string>
#include "base/basictypes.h"
#include "content/public/renderer/render_process_observer.h"
#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h"
#include "url/gurl.h"
namespace content {
class PeerConnectionIdentityService
: public webrtc::DTLSIdentityServiceInterface {
public:
explicit PeerConnectionIdentityService(const GURL& origin);
virtual ~PeerConnectionIdentityService();
virtual bool RequestIdentity(
const std::string& identity_name,
const std::string& common_name,
webrtc::DTLSIdentityRequestObserver* observer) OVERRIDE;
private:
void OnIdentityReady(const std::string& certificate,
const std::string& private_key);
void OnRequestFailed(int error);
void ResetPendingRequest();
GURL origin_;
talk_base::scoped_refptr<webrtc::DTLSIdentityRequestObserver>
pending_observer_;
int pending_request_id_;
DISALLOW_COPY_AND_ASSIGN(PeerConnectionIdentityService);
};
}
#endif