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

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

Issue 15772012: Separate MediaKeys interface from Decryptor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android 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
« no previous file with comments | « webkit/media/crypto/ppapi_decryptor.cc ('k') | webkit/media/crypto/proxy_decryptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/crypto/proxy_decryptor.h
diff --git a/webkit/media/crypto/proxy_decryptor.h b/webkit/media/crypto/proxy_decryptor.h
index 3e81ce37e7b5bbae46e8f7d5c8a2cb981789f74b..df498f9d689ccaa7ff7c218a47e0f24ba164c9e8 100644
--- a/webkit/media/crypto/proxy_decryptor.h
+++ b/webkit/media/crypto/proxy_decryptor.h
@@ -11,6 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "media/base/decryptor.h"
+#include "media/base/media_keys.h"
namespace WebKit {
class WebFrame;
@@ -23,7 +24,8 @@ namespace webkit_media {
// forwards decryptor calls to it.
// TODO(xhwang): Currently we don't support run-time switching among decryptor
// objects. Fix this when needed.
-class ProxyDecryptor {
+// TODO(xhwang): The ProxyDecryptor is not a Decryptor. Find a better name!
+class ProxyDecryptor : public media::MediaKeys {
public:
ProxyDecryptor(WebKit::WebMediaPlayerClient* web_media_player_client,
WebKit::WebFrame* web_frame,
@@ -39,15 +41,17 @@ class ProxyDecryptor {
// NULL immediately and reset.
void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb);
- bool GenerateKeyRequest(const std::string& key_system,
- const std::string& type,
- const uint8* init_data, int init_data_length);
- void AddKey(const std::string& key_system,
- const uint8* key, int key_length,
- const uint8* init_data, int init_data_length,
- const std::string& session_id);
- void CancelKeyRequest(const std::string& key_system,
- const std::string& session_id);
+ // MediaKeys implementation.
+ virtual bool GenerateKeyRequest(const std::string& key_system,
+ 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,
+ 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;
private:
// Helper functions to create decryptors to handle the given |key_system|.
@@ -61,7 +65,7 @@ class ProxyDecryptor {
void KeyAdded(const std::string& key_system, const std::string& session_id);
void KeyError(const std::string& key_system,
const std::string& session_id,
- media::Decryptor::KeyError error_code,
+ media::MediaKeys::KeyError error_code,
int system_code);
void KeyMessage(const std::string& key_system,
const std::string& session_id,
« no previous file with comments | « webkit/media/crypto/ppapi_decryptor.cc ('k') | webkit/media/crypto/proxy_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698