| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ |
| 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ | 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 : public blink::WebContentDecryptionModuleSession { | 25 : public blink::WebContentDecryptionModuleSession { |
| 26 public: | 26 public: |
| 27 WebContentDecryptionModuleSessionImpl( | 27 WebContentDecryptionModuleSessionImpl( |
| 28 const scoped_refptr<CdmSessionAdapter>& adapter); | 28 const scoped_refptr<CdmSessionAdapter>& adapter); |
| 29 virtual ~WebContentDecryptionModuleSessionImpl(); | 29 virtual ~WebContentDecryptionModuleSessionImpl(); |
| 30 | 30 |
| 31 // blink::WebContentDecryptionModuleSession implementation. | 31 // blink::WebContentDecryptionModuleSession implementation. |
| 32 virtual void setClientInterface(Client* client); | 32 virtual void setClientInterface(Client* client); |
| 33 virtual blink::WebString sessionId() const; | 33 virtual blink::WebString sessionId() const; |
| 34 | 34 |
| 35 // TODO(jrummell): Remove the next 3 methods once blink updated. | |
| 36 virtual void initializeNewSession(const blink::WebString& mime_type, | |
| 37 const uint8* init_data, | |
| 38 size_t init_data_length); | |
| 39 virtual void update(const uint8* response, size_t response_length); | |
| 40 virtual void release(); | |
| 41 virtual void initializeNewSession( | 35 virtual void initializeNewSession( |
| 42 const blink::WebString& init_data_type, | 36 const blink::WebString& init_data_type, |
| 43 const uint8* init_data, | 37 const uint8* init_data, |
| 44 size_t init_data_length, | 38 size_t init_data_length, |
| 45 const blink::WebString& session_type, | 39 const blink::WebString& session_type, |
| 46 blink::WebContentDecryptionModuleResult result); | 40 blink::WebContentDecryptionModuleResult result); |
| 47 virtual void load(const blink::WebString& session_id, | 41 virtual void load(const blink::WebString& session_id, |
| 48 blink::WebContentDecryptionModuleResult result); | 42 blink::WebContentDecryptionModuleResult result); |
| 49 virtual void update(const uint8* response, | 43 virtual void update(const uint8* response, |
| 50 size_t response_length, | 44 size_t response_length, |
| 51 blink::WebContentDecryptionModuleResult result); | 45 blink::WebContentDecryptionModuleResult result); |
| 52 virtual void close(blink::WebContentDecryptionModuleResult result); | 46 virtual void close(blink::WebContentDecryptionModuleResult result); |
| 53 virtual void remove(blink::WebContentDecryptionModuleResult result); | 47 virtual void remove(blink::WebContentDecryptionModuleResult result); |
| 54 | 48 |
| 55 // TODO(jrummell): Remove the next method once blink updated. | |
| 56 virtual void release(blink::WebContentDecryptionModuleResult result); | |
| 57 | |
| 58 // Callbacks. | 49 // Callbacks. |
| 59 void OnSessionMessage(MediaKeys::MessageType message_type, | 50 void OnSessionMessage(MediaKeys::MessageType message_type, |
| 60 const std::vector<uint8>& message); | 51 const std::vector<uint8>& message); |
| 61 void OnSessionKeysChange(bool has_additional_usable_key, | 52 void OnSessionKeysChange(bool has_additional_usable_key, |
| 62 CdmKeysInfo keys_info); | 53 CdmKeysInfo keys_info); |
| 63 void OnSessionExpirationUpdate(const base::Time& new_expiry_time); | 54 void OnSessionExpirationUpdate(const base::Time& new_expiry_time); |
| 64 void OnSessionClosed(); | 55 void OnSessionClosed(); |
| 65 | 56 |
| 66 private: | 57 private: |
| 67 // Called when a new session is created. | 58 // Called when a new session is created. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 87 // creating a promise in case this class disappears before the promise | 78 // creating a promise in case this class disappears before the promise |
| 88 // actually fires. | 79 // actually fires. |
| 89 base::WeakPtrFactory<WebContentDecryptionModuleSessionImpl> weak_ptr_factory_; | 80 base::WeakPtrFactory<WebContentDecryptionModuleSessionImpl> weak_ptr_factory_; |
| 90 | 81 |
| 91 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleSessionImpl); | 82 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleSessionImpl); |
| 92 }; | 83 }; |
| 93 | 84 |
| 94 } // namespace media | 85 } // namespace media |
| 95 | 86 |
| 96 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ | 87 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ |
| OLD | NEW |