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

Unified Diff: content/renderer/media/webrtc_identity_service.h

Issue 15969025: Generates the DTLS identity in browser process and returns it to render process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 | « content/content_tests.gypi ('k') | content/renderer/media/webrtc_identity_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e9ce6f023db0e2cd0a7d197daa55de206e4955fb
--- /dev/null
+++ b/content/renderer/media/webrtc_identity_service.h
@@ -0,0 +1,51 @@
+// 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 "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:
+ explicit 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_
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/webrtc_identity_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698