| 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_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ | 5 #ifndef MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ |
| 6 #define MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ | 6 #define MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 const std::string& error_description); | 151 const std::string& error_description); |
| 152 cdm::Error error; | 152 cdm::Error error; |
| 153 uint32_t system_code; | 153 uint32_t system_code; |
| 154 std::string error_description; | 154 std::string error_description; |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 struct SessionMessage { | 157 struct SessionMessage { |
| 158 SessionMessage(const std::string& session_id, | 158 SessionMessage(const std::string& session_id, |
| 159 cdm::MessageType message_type, | 159 cdm::MessageType message_type, |
| 160 const char* message, | 160 const char* message, |
| 161 uint32_t message_size, | 161 uint32_t message_size); |
| 162 const std::string& legacy_destination_url); | |
| 163 std::string session_id; | 162 std::string session_id; |
| 164 cdm::MessageType message_type; | 163 cdm::MessageType message_type; |
| 165 std::vector<uint8_t> message; | 164 std::vector<uint8_t> message; |
| 166 std::string legacy_destination_url; | |
| 167 }; | 165 }; |
| 168 | 166 |
| 169 // Create an instance of the |key_system| CDM. Caller owns the returned | 167 // Create an instance of the |key_system| CDM. Caller owns the returned |
| 170 // pointer. On error (unable to load CDM, does not support |key_system|, | 168 // pointer. On error (unable to load CDM, does not support |key_system|, |
| 171 // does not support an supported interface, etc.) NULL will be returned. | 169 // does not support an supported interface, etc.) NULL will be returned. |
| 172 CdmWrapper* CreateCdmInstance(const std::string& key_system); | 170 CdmWrapper* CreateCdmInstance(const std::string& key_system); |
| 173 | 171 |
| 174 // <code>PPB_ContentDecryptor_Private</code> dispatchers. These are passed to | 172 // <code>PPB_ContentDecryptor_Private</code> dispatchers. These are passed to |
| 175 // <code>callback_factory_</code> to ensure that calls into | 173 // <code>callback_factory_</code> to ensure that calls into |
| 176 // <code>PPP_ContentDecryptor_Private</code> are asynchronous. | 174 // <code>PPP_ContentDecryptor_Private</code> are asynchronous. |
| 177 void SendPromiseResolvedInternal(int32_t result, uint32_t promise_id); | 175 void SendPromiseResolvedInternal(int32_t result, uint32_t promise_id); |
| 178 void SendPromiseResolvedWithSessionInternal(int32_t result, | 176 void SendPromiseResolvedWithSessionInternal(int32_t result, |
| 179 uint32_t promise_id, | 177 uint32_t promise_id, |
| 180 const std::string& session_id); | 178 const std::string& session_id); |
| 181 void SendPromiseRejectedInternal(int32_t result, | 179 void SendPromiseRejectedInternal(int32_t result, |
| 182 uint32_t promise_id, | 180 uint32_t promise_id, |
| 183 const SessionError& error); | 181 const SessionError& error); |
| 184 void SendSessionMessageInternal(int32_t result, | 182 void SendSessionMessageInternal(int32_t result, |
| 185 const SessionMessage& message); | 183 const SessionMessage& message); |
| 186 void SendSessionClosedInternal(int32_t result, const std::string& session_id); | 184 void SendSessionClosedInternal(int32_t result, const std::string& session_id); |
| 187 void SendSessionErrorInternal(int32_t result, | |
| 188 const std::string& session_id, | |
| 189 const SessionError& error); | |
| 190 void SendSessionKeysChangeInternal( | 185 void SendSessionKeysChangeInternal( |
| 191 int32_t result, | 186 int32_t result, |
| 192 const std::string& session_id, | 187 const std::string& session_id, |
| 193 bool has_additional_usable_key, | 188 bool has_additional_usable_key, |
| 194 const std::vector<PP_KeyInformation>& key_info); | 189 const std::vector<PP_KeyInformation>& key_info); |
| 195 void SendExpirationChangeInternal(int32_t result, | 190 void SendExpirationChangeInternal(int32_t result, |
| 196 const std::string& session_id, | 191 const std::string& session_id, |
| 197 cdm::Time new_expiry_time); | 192 cdm::Time new_expiry_time); |
| 198 void RejectPromise(uint32_t promise_id, | 193 void RejectPromise(uint32_t promise_id, |
| 199 cdm::Error error, | 194 cdm::Error error, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 285 |
| 291 uint32_t last_read_file_size_kb_; | 286 uint32_t last_read_file_size_kb_; |
| 292 bool file_size_uma_reported_; | 287 bool file_size_uma_reported_; |
| 293 | 288 |
| 294 DISALLOW_COPY_AND_ASSIGN(PpapiCdmAdapter); | 289 DISALLOW_COPY_AND_ASSIGN(PpapiCdmAdapter); |
| 295 }; | 290 }; |
| 296 | 291 |
| 297 } // namespace media | 292 } // namespace media |
| 298 | 293 |
| 299 #endif // MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ | 294 #endif // MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ |
| OLD | NEW |