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

Unified Diff: media/blink/cdm_session_adapter.h

Issue 1070853004: media: CdmFactory creates CDM (MediaKeys) asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use ScopedVector Created 5 years, 8 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 | « media/base/cdm_factory.h ('k') | media/blink/cdm_session_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/cdm_session_adapter.h
diff --git a/media/blink/cdm_session_adapter.h b/media/blink/cdm_session_adapter.h
index e35c4cba3ba0e7371e2953b8f15bc3522899ca08..5ed7550e2b19c23dcdeda7d402b04dd0c4784bf9 100644
--- a/media/blink/cdm_session_adapter.h
+++ b/media/blink/cdm_session_adapter.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "media/base/media_keys.h"
+#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModuleSession.h"
class GURL;
@@ -30,12 +31,14 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> {
public:
CdmSessionAdapter();
- // Returns true on success.
- bool Initialize(CdmFactory* cdm_factory,
- const std::string& key_system,
- bool allow_distinctive_identifier,
- bool allow_persistent_state,
- const GURL& security_origin);
+ // Creates the CDM for |key_system| using |cdm_factory| and returns the result
+ // via |result|.
+ void CreateCdm(CdmFactory* cdm_factory,
+ const std::string& key_system,
+ bool allow_distinctive_identifier,
+ bool allow_persistent_state,
+ const GURL& security_origin,
+ blink::WebContentDecryptionModuleResult result);
// Provides a server certificate to be used to encrypt messages to the
// license server.
@@ -99,12 +102,19 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> {
private:
friend class base::RefCounted<CdmSessionAdapter>;
+
+ // Session ID to WebContentDecryptionModuleSessionImpl mapping.
typedef base::hash_map<std::string,
base::WeakPtr<WebContentDecryptionModuleSessionImpl> >
SessionMap;
~CdmSessionAdapter();
+ // Callback for CreateCdm().
+ void OnCdmCreated(const std::string& key_system,
+ blink::WebContentDecryptionModuleResult result,
+ scoped_ptr<MediaKeys> cdm);
+
// Callbacks for firing session events.
void OnSessionMessage(const std::string& session_id,
MediaKeys::MessageType message_type,
@@ -125,7 +135,7 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> {
WebContentDecryptionModuleSessionImpl* GetSession(
const std::string& session_id);
- scoped_ptr<MediaKeys> media_keys_;
+ scoped_ptr<MediaKeys> cdm_;
SessionMap sessions_;
« no previous file with comments | « media/base/cdm_factory.h ('k') | media/blink/cdm_session_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698