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

Unified Diff: webkit/renderer/media/crypto/proxy_decryptor.h

Issue 17289006: Separate CDM initialization from GenerateKeyRequest & remove key_system parameters. (Closed) Base URL: master
Patch Set: rebase only 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 | « webkit/renderer/media/crypto/ppapi_decryptor.cc ('k') | webkit/renderer/media/crypto/proxy_decryptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/renderer/media/crypto/proxy_decryptor.h
diff --git a/webkit/renderer/media/crypto/proxy_decryptor.h b/webkit/renderer/media/crypto/proxy_decryptor.h
index 629f76fe2eeac750620f6eeb91a8d4b43d97ffac..54efc8a37e690bfb167f7ad77db11a305dd17dec 100644
--- a/webkit/renderer/media/crypto/proxy_decryptor.h
+++ b/webkit/renderer/media/crypto/proxy_decryptor.h
@@ -35,6 +35,9 @@ class ProxyDecryptor : public media::MediaKeys {
const media::NeedKeyCB& need_key_cb);
virtual ~ProxyDecryptor();
+ // Only call this once.
+ bool InitializeCDM(const std::string& key_system);
+
// Requests the ProxyDecryptor to notify the decryptor when it's ready through
// the |decryptor_ready_cb| provided.
// If |decryptor_ready_cb| is null, the existing callback will be fired with
@@ -42,16 +45,14 @@ class ProxyDecryptor : public media::MediaKeys {
void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb);
// MediaKeys implementation.
- virtual bool GenerateKeyRequest(const std::string& key_system,
- const std::string& type,
+ // May only be called after InitializeCDM() succeeds.
+ virtual bool GenerateKeyRequest(const std::string& type,
const uint8* init_data,
int init_data_length) OVERRIDE;
- virtual void AddKey(const std::string& key_system,
- const uint8* key, int key_length,
+ virtual void AddKey(const uint8* key, int key_length,
const uint8* init_data, int init_data_length,
const std::string& session_id) OVERRIDE;
- virtual void CancelKeyRequest(const std::string& key_system,
- const std::string& session_id) OVERRIDE;
+ virtual void CancelKeyRequest(const std::string& session_id) OVERRIDE;
private:
// Helper functions to create decryptors to handle the given |key_system|.
@@ -64,17 +65,14 @@ class ProxyDecryptor : public media::MediaKeys {
#endif // defined(ENABLE_PEPPER_CDMS)
// Callbacks for firing key events.
- void KeyAdded(const std::string& key_system, const std::string& session_id);
- void KeyError(const std::string& key_system,
- const std::string& session_id,
+ void KeyAdded(const std::string& session_id);
+ void KeyError(const std::string& session_id,
media::MediaKeys::KeyError error_code,
int system_code);
- void KeyMessage(const std::string& key_system,
- const std::string& session_id,
+ void KeyMessage(const std::string& session_id,
const std::string& message,
const std::string& default_url);
- void NeedKey(const std::string& key_system,
- const std::string& session_id,
+ void NeedKey(const std::string& session_id,
const std::string& type,
scoped_ptr<uint8[]> init_data, int init_data_size);
« no previous file with comments | « webkit/renderer/media/crypto/ppapi_decryptor.cc ('k') | webkit/renderer/media/crypto/proxy_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698