Chromium Code Reviews| Index: content/renderer/media/webcontentdecryptionmodulesession_impl.h |
| diff --git a/content/renderer/media/webcontentdecryptionmodulesession_impl.h b/content/renderer/media/webcontentdecryptionmodulesession_impl.h |
| index 05a358b0ac471eff1d787d410362d49a535ac889..d270fed82bda391848aad0b354324ed89df8689d 100644 |
| --- a/content/renderer/media/webcontentdecryptionmodulesession_impl.h |
| +++ b/content/renderer/media/webcontentdecryptionmodulesession_impl.h |
| @@ -13,6 +13,7 @@ |
| #include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "content/renderer/media/webcontentdecryptionmoduleresult_helper.h" |
| #include "media/base/media_keys.h" |
| #include "third_party/WebKit/public/platform/WebContentDecryptionModuleSession.h" |
| #include "third_party/WebKit/public/platform/WebString.h" |
| @@ -49,11 +50,18 @@ class WebContentDecryptionModuleSessionImpl |
| virtual void update(const uint8* response, |
| size_t response_length, |
| blink::WebContentDecryptionModuleResult result); |
| + virtual void close(blink::WebContentDecryptionModuleResult result); |
| + virtual void remove(blink::WebContentDecryptionModuleResult result); |
| + virtual void getUsableKeyIds(blink::WebContentDecryptionModuleResult result); |
| + |
| + // TODO(jrummell): Remove the next method once blink updated. |
| virtual void release(blink::WebContentDecryptionModuleResult result); |
| // Callbacks. |
| void OnSessionMessage(const std::vector<uint8>& message, |
| const GURL& destination_url); |
| + void OnSessionKeysChange(bool has_additional_usable_key); |
| + void OnSessionExpirationChange(double new_expiry_time); |
| void OnSessionReady(); |
| void OnSessionClosed(); |
| void OnSessionError(media::MediaKeys::Exception exception_code, |
| @@ -61,25 +69,17 @@ class WebContentDecryptionModuleSessionImpl |
| const std::string& error_message); |
| private: |
| - typedef std::map<uint32, blink::WebContentDecryptionModuleResult> ResultMap; |
| - |
| // These function are used as callbacks when CdmPromise resolves/rejects. |
| // |result_index| = kReservedIndex means that there is no |
| // WebContentDecryptionModuleResult. |
| void SessionCreated(uint32 result_index, const std::string& web_session_id); |
|
ddorwin
2014/09/10 22:58:39
Hmm, I wonder why these aren't On... too. I know w
jrummell
2014/09/11 21:21:55
I think the discussion had to do with the other ca
ddorwin
2014/09/11 23:31:11
Let's stick with the current pattern for now. The
|
| void SessionUpdatedOrReleased(uint32 result_index); |
| + void KeyIdsAvailable(uint32 result_index, const media::KeyIdsVector& key_ids); |
| void SessionError(uint32 result_index, |
| media::MediaKeys::Exception exception_code, |
| uint32 system_code, |
| const std::string& error_message); |
| - // As initializeNewSession(), update(), and release() get passed a |
| - // WebContentDecryptionModuleResult, keep track of them since this class owns |
| - // it and needs to keep them around until completed. Returns the index used |
| - // to locate the WebContentDecryptionModuleResult when the operation is |
| - // complete. |
| - uint32 AddResult(blink::WebContentDecryptionModuleResult result); |
| - |
| scoped_refptr<CdmSessionAdapter> adapter_; |
| // Non-owned pointer. |
| @@ -96,8 +96,7 @@ class WebContentDecryptionModuleSessionImpl |
| bool is_closed_; |
| // Keep track of all the outstanding WebContentDecryptionModuleResult objects. |
| - uint32 next_available_result_index_; |
| - ResultMap outstanding_results_; |
| + WebContentDecryptionModuleResultHelper outstanding_results_; |
| // Since promises will live until they are fired, use a weak reference when |
| // creating a promise in case this class disappears before the promise |