Chromium Code Reviews| Index: webkit/media/crypto/proxy_decryptor.h |
| diff --git a/webkit/media/crypto/proxy_decryptor.h b/webkit/media/crypto/proxy_decryptor.h |
| index c68f093f965aeb67375405406b6b20e87aabd666..40a9af5aa7b42d7e0a7ebea8d41c868bf48cea64 100644 |
| --- a/webkit/media/crypto/proxy_decryptor.h |
| +++ b/webkit/media/crypto/proxy_decryptor.h |
| @@ -8,13 +8,10 @@ |
| #include <string> |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "base/synchronization/lock.h" |
| #include "media/base/decryptor.h" |
| -namespace media { |
| -class DecryptorClient; |
| -} |
| - |
| namespace WebKit { |
| class WebFrame; |
| class WebMediaPlayerClient; |
| @@ -28,9 +25,12 @@ namespace webkit_media { |
| // objects. Fix this when needed. |
| class ProxyDecryptor { |
| public: |
| - ProxyDecryptor(media::DecryptorClient* decryptor_client, |
| - WebKit::WebMediaPlayerClient* web_media_player_client, |
| - WebKit::WebFrame* web_frame); |
| + ProxyDecryptor(WebKit::WebMediaPlayerClient* web_media_player_client, |
| + WebKit::WebFrame* web_frame, |
| + const media::KeyAddedCB& key_added_cb, |
|
ddorwin
2012/12/21 04:19:06
nit: Technically, these should come before the poi
xhwang
2012/12/21 05:50:07
I thought about that.. The rule is input before ou
|
| + const media::KeyErrorCB& key_error_cb, |
| + const media::KeyMessageCB& key_message_cb, |
| + const media::NeedKeyCB& need_key_cb); |
| virtual ~ProxyDecryptor(); |
| // Requests the ProxyDecryptor to notify the decryptor when it's ready through |
| @@ -55,13 +55,31 @@ class ProxyDecryptor { |
| const std::string& key_system); |
| scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system); |
| - // DecryptorClient through which key events are fired. |
| - media::DecryptorClient* client_; |
| + // 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, |
| + media::Decryptor::KeyError error_code, |
| + int system_code); |
| + void KeyMessage(const std::string& key_system, |
| + 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, |
| + const std::string& type, |
| + scoped_array<uint8> init_data, int init_data_size); |
| // Needed to create the PpapiDecryptor. |
| WebKit::WebMediaPlayerClient* web_media_player_client_; |
| WebKit::WebFrame* web_frame_; |
| + // Callbacks for firing key events. |
|
ddorwin
2012/12/21 04:19:06
nit: I would then move these up above 73.
xhwang
2012/12/21 05:50:07
see above...
|
| + media::KeyAddedCB key_added_cb_; |
| + media::KeyErrorCB key_error_cb_; |
| + media::KeyMessageCB key_message_cb_; |
| + media::NeedKeyCB need_key_cb_; |
| + |
| // Protects the |decryptor_|. Note that |decryptor_| itself should be thread |
| // safe as per the Decryptor interface. |
| base::Lock lock_; |
| @@ -72,6 +90,8 @@ class ProxyDecryptor { |
| // This pointer is protected by the |lock_|. |
| scoped_ptr<media::Decryptor> decryptor_; |
| + base::WeakPtrFactory<ProxyDecryptor> weak_ptr_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); |
| }; |