| 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 CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 uint32 system_code)> KeyErrorCB; | 52 uint32 system_code)> KeyErrorCB; |
| 53 typedef base::Callback<void(const std::string& session_id, | 53 typedef base::Callback<void(const std::string& session_id, |
| 54 const std::vector<uint8>& message, | 54 const std::vector<uint8>& message, |
| 55 const std::string& default_url)> KeyMessageCB; | 55 const std::string& default_url)> KeyMessageCB; |
| 56 | 56 |
| 57 ProxyDecryptor( | 57 ProxyDecryptor( |
| 58 #if defined(ENABLE_PEPPER_CDMS) | 58 #if defined(ENABLE_PEPPER_CDMS) |
| 59 const CreatePepperCdmCB& create_pepper_cdm_cb, | 59 const CreatePepperCdmCB& create_pepper_cdm_cb, |
| 60 #elif defined(OS_ANDROID) | 60 #elif defined(OS_ANDROID) |
| 61 RendererMediaPlayerManager* manager, | 61 RendererMediaPlayerManager* manager, |
| 62 int cdm_id, | |
| 63 #endif // defined(ENABLE_PEPPER_CDMS) | 62 #endif // defined(ENABLE_PEPPER_CDMS) |
| 64 const KeyAddedCB& key_added_cb, | 63 const KeyAddedCB& key_added_cb, |
| 65 const KeyErrorCB& key_error_cb, | 64 const KeyErrorCB& key_error_cb, |
| 66 const KeyMessageCB& key_message_cb); | 65 const KeyMessageCB& key_message_cb); |
| 67 virtual ~ProxyDecryptor(); | 66 virtual ~ProxyDecryptor(); |
| 68 | 67 |
| 69 // Returns the Decryptor associated with this object. May be NULL if no | 68 // Returns the Decryptor associated with this object. May be NULL if no |
| 70 // Decryptor is associated. | 69 // Decryptor is associated. |
| 71 media::Decryptor* GetDecryptor(); | 70 media::Decryptor* GetDecryptor(); |
| 72 | 71 |
| 72 #if defined(OS_ANDROID) |
| 73 // Returns the CDM ID associated with this object. May be kInvalidCdmId if no |
| 74 // CDM ID is associated, such as when Clear Key is used. |
| 75 int GetCdmId(); |
| 76 #endif |
| 77 |
| 73 // Only call this once. | 78 // Only call this once. |
| 74 bool InitializeCDM(const std::string& key_system, const GURL& frame_url); | 79 bool InitializeCDM(const std::string& key_system, const GURL& frame_url); |
| 75 | 80 |
| 76 // May only be called after InitializeCDM() succeeds. | 81 // May only be called after InitializeCDM() succeeds. |
| 77 bool GenerateKeyRequest(const std::string& type, | 82 bool GenerateKeyRequest(const std::string& type, |
| 78 const uint8* init_data, | 83 const uint8* init_data, |
| 79 int init_data_length); | 84 int init_data_length); |
| 80 void AddKey(const uint8* key, int key_length, | 85 void AddKey(const uint8* key, int key_length, |
| 81 const uint8* init_data, int init_data_length, | 86 const uint8* init_data, int init_data_length, |
| 82 const std::string& session_id); | 87 const std::string& session_id); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 143 |
| 139 // NOTE: Weak pointers must be invalidated before all other member variables. | 144 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 140 base::WeakPtrFactory<ProxyDecryptor> weak_ptr_factory_; | 145 base::WeakPtrFactory<ProxyDecryptor> weak_ptr_factory_; |
| 141 | 146 |
| 142 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); | 147 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); |
| 143 }; | 148 }; |
| 144 | 149 |
| 145 } // namespace content | 150 } // namespace content |
| 146 | 151 |
| 147 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 152 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
| OLD | NEW |