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

Unified Diff: content/browser/media/dtls_identity_store.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, 7 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
Index: content/browser/media/dtls_identity_store.h
diff --git a/content/browser/media/dtls_identity_store.h b/content/browser/media/dtls_identity_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..33e4f404f4959de50f7c7799300163965f5e87d7
--- /dev/null
+++ b/content/browser/media/dtls_identity_store.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_BROWSER_MEDIA_DTLS_IDENTITY_STORE_H_
+#define CONTENT_BROWSER_MEDIA_DTLS_IDENTITY_STORE_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/singleton.h"
+
+class GURL;
+
+namespace base {
+class TaskRunner;
+} // namespace base
+
+namespace content {
+
+// This is a singleton class called in the browser UI thread.
+// It dispatches DTLS identity requests to the background worker thread.
+class DTLSIdentityStore {
+ public:
+ static DTLSIdentityStore* GetInstance();
+ DTLSIdentityStore();
+ DTLSIdentityStore(const scoped_refptr<base::TaskRunner>& task_runner);
+ ~DTLSIdentityStore();
+
+ typedef base::Callback<void(const std::string&, const std::string&)>
+ OnCompleteCallback;
+
+ // Get the DTLS identity for the given domain of |url|, or generate a new one
+ // if not existent. Asynchronous. Called on the browser UI thread.
+ // |url| is the frame URL of the PeerConnection requesting the identity;
+ // |identity_name| is the name of the identity;
+ // |common_name| ???
+ // |callback| is the callback to return the result.
+ void GetOrGenerateIdentity(const GURL& url,
+ const std::string& identity_name,
+ const std::string& common_name,
+ const OnCompleteCallback& callback
+ );
+ private:
+ friend struct DefaultSingletonTraits<DTLSIdentityStore>;
+
+ // The TaskRunner for doing work on a worker thread.
+ scoped_refptr<base::TaskRunner> task_runner_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_DTLS_IDENTITY_STORE_H_
« no previous file with comments | « no previous file | content/browser/media/dtls_identity_store.cc » ('j') | content/browser/renderer_host/render_process_host_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698