Chromium Code Reviews| Index: content/renderer/pepper/content_decryptor_delegate.h |
| diff --git a/content/renderer/pepper/content_decryptor_delegate.h b/content/renderer/pepper/content_decryptor_delegate.h |
| index 4e5a4bd5661c4644305e2e7d96313dfec42de425..65c8f33dfa15e8aa8fdcc7bfce898e91ebcae732 100644 |
| --- a/content/renderer/pepper/content_decryptor_delegate.h |
| +++ b/content/renderer/pepper/content_decryptor_delegate.h |
| @@ -40,14 +40,15 @@ class ContentDecryptorDelegate { |
| const PPP_ContentDecryptor_Private* plugin_decryption_interface); |
| ~ContentDecryptorDelegate(); |
| - void Initialize(const std::string& key_system); |
| + void Initialize(const std::string& key_system, |
|
ddorwin
2014/01/08 23:40:32
Should we document in this public interface that p
xhwang
2014/01/09 01:58:49
Done.
|
| + const media::SessionCreatedCB& session_created_cb, |
| + const media::SessionMessageCB& session_message_cb, |
| + const media::SessionReadyCB& session_ready_cb, |
| + const media::SessionClosedCB& session_closed_cb, |
| + const media::SessionErrorCB& session_error_cb, |
| + const base::Closure& plugin_error_cb); |
| - void SetSessionEventCallbacks( |
| - const media::SessionCreatedCB& session_created_cb, |
| - const media::SessionMessageCB& session_message_cb, |
| - const media::SessionReadyCB& session_ready_cb, |
| - const media::SessionClosedCB& session_closed_cb, |
| - const media::SessionErrorCB& session_error_cb); |
| + void InstanceCrashed(); |
| // Provides access to PPP_ContentDecryptor_Private. |
| bool CreateSession(uint32 session_id, |
| @@ -109,8 +110,11 @@ class ContentDecryptorDelegate { |
| class TrackableCallback { |
| public: |
| TrackableCallback() : id_(0u) {} |
| - // TODO(xhwang): Check that no callback is pending in dtor. |
| - ~TrackableCallback() {}; |
| + ~TrackableCallback() { |
| + // Callbacks must be satisfied. |
| + DCHECK_EQ(id_, 0u); |
| + DCHECK(is_null()); |
| + }; |
| bool Matches(uint32_t id) const { return id == id_; } |
| @@ -162,6 +166,8 @@ class ContentDecryptorDelegate { |
| media::SampleFormat sample_format, |
| media::Decryptor::AudioBuffers* frames); |
| + void SatisfyAllPendingCallbacksOnError(); |
| + |
| const PP_Instance pp_instance_; |
| const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; |
| @@ -175,6 +181,10 @@ class ContentDecryptorDelegate { |
| media::SessionClosedCB session_closed_cb_; |
| media::SessionErrorCB session_error_cb_; |
| + // Callback to notify that unexpected error happened and |this| should not |
| + // be used anymore. |
| + base::Closure plugin_error_cb_; |
| + |
| gfx::Size natural_size_; |
| // Request ID for tracking pending content decryption callbacks. |