Chromium Code Reviews| Index: content/renderer/media/webrtc_identity_service.h |
| diff --git a/content/renderer/media/webrtc_identity_service.h b/content/renderer/media/webrtc_identity_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e5a3e4028f23083c5301d7ce1c9481e35b82859f |
| --- /dev/null |
| +++ b/content/renderer/media/webrtc_identity_service.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_IDENTITY_SERVICE_H_ |
| +#define CONTENT_RENDERER_MEDIA_WEBRTC_IDENTITY_SERVICE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/scoped_ptr.h" |
|
Ryan Sleevi
2013/06/27 18:05:24
Is this actually needed? Doesn't seem like it.
jiayl
2013/06/27 18:29:36
Done.
|
| +#include "content/public/renderer/render_process_observer.h" |
| +#include "googleurl/src/gurl.h" |
| +#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" |
| + |
| +namespace content { |
| + |
| +// This class handles WebRTC DTLS identity requests by sending IPC messages to |
| +// the browser process. |
| +class WebRTCIdentityService : public webrtc::DTLSIdentityServiceInterface, |
| + public RenderProcessObserver { |
| + public: |
| + WebRTCIdentityService(const GURL& origin); |
| + virtual ~WebRTCIdentityService(); |
| + |
| + // WebRTCIdentityServiceInterface implementation. |
| + virtual bool RequestIdentity(const std::string& identity_name, |
| + const std::string& common_name, |
| + webrtc::DTLSIdentityRequestObserver* observer) |
| + OVERRIDE; |
| + |
| + private: |
| + // RenderProcessObserver implementation. |
| + virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| + |
| + void OnIdentityReady(int request_id, |
| + const std::string& certificate, |
| + const std::string& private_key); |
| + |
| + void OnRequestFailed(int request_id, int error); |
| + |
| + // The origin of the DTLS connection. |
| + GURL origin_; |
| + talk_base::scoped_refptr<webrtc::DTLSIdentityRequestObserver> |
| + pending_observer_; |
| + int pending_request_id_; |
| + DISALLOW_COPY_AND_ASSIGN(WebRTCIdentityService); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_WEBRTC_IDENTITY_SERVICE_H_ |