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 #include "media/cdm/proxy_decryptor.h" | 5 #include "media/cdm/proxy_decryptor.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "media/base/cdm_callback_promise.h" | 13 #include "media/base/cdm_callback_promise.h" |
14 #include "media/base/cdm_factory.h" | 14 #include "media/base/cdm_factory.h" |
| 15 #include "media/base/cdm_key_information.h" |
15 #include "media/base/key_systems.h" | 16 #include "media/base/key_systems.h" |
16 #include "media/cdm/json_web_key.h" | 17 #include "media/cdm/json_web_key.h" |
17 #include "media/cdm/key_system_names.h" | 18 #include "media/cdm/key_system_names.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 // Special system code to signal a closed persistent session in a SessionError() | 22 // Special system code to signal a closed persistent session in a SessionError() |
22 // call. This is needed because there is no SessionClosed() call in the prefixed | 23 // call. This is needed because there is no SessionClosed() call in the prefixed |
23 // EME API. | 24 // EME API. |
24 const int kSessionClosedSystemCode = 29127; | 25 const int kSessionClosedSystemCode = 29127; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 if (ExtractFirstKeyIdFromLicenseRequest(message, &key)) { | 222 if (ExtractFirstKeyIdFromLicenseRequest(message, &key)) { |
222 key_message_cb_.Run(web_session_id, key, destination_url); | 223 key_message_cb_.Run(web_session_id, key, destination_url); |
223 return; | 224 return; |
224 } | 225 } |
225 } | 226 } |
226 | 227 |
227 key_message_cb_.Run(web_session_id, message, destination_url); | 228 key_message_cb_.Run(web_session_id, message, destination_url); |
228 } | 229 } |
229 | 230 |
230 void ProxyDecryptor::OnSessionKeysChange(const std::string& web_session_id, | 231 void ProxyDecryptor::OnSessionKeysChange(const std::string& web_session_id, |
231 bool has_additional_usable_key) { | 232 bool has_additional_usable_key, |
| 233 const CdmKeysInfo& keys_info) { |
232 // EME v0.1b doesn't support this event. | 234 // EME v0.1b doesn't support this event. |
233 } | 235 } |
234 | 236 |
235 void ProxyDecryptor::OnSessionExpirationUpdate( | 237 void ProxyDecryptor::OnSessionExpirationUpdate( |
236 const std::string& web_session_id, | 238 const std::string& web_session_id, |
237 const base::Time& new_expiry_time) { | 239 const base::Time& new_expiry_time) { |
238 // EME v0.1b doesn't support this event. | 240 // EME v0.1b doesn't support this event. |
239 } | 241 } |
240 | 242 |
241 void ProxyDecryptor::GenerateKeyAdded(const std::string& web_session_id) { | 243 void ProxyDecryptor::GenerateKeyAdded(const std::string& web_session_id) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 bool is_persistent = | 299 bool is_persistent = |
298 session_type == PersistentSession || session_type == LoadSession; | 300 session_type == PersistentSession || session_type == LoadSession; |
299 active_sessions_.insert(std::make_pair(web_session_id, is_persistent)); | 301 active_sessions_.insert(std::make_pair(web_session_id, is_persistent)); |
300 | 302 |
301 // For LoadSession(), generate the KeyAdded event. | 303 // For LoadSession(), generate the KeyAdded event. |
302 if (session_type == LoadSession) | 304 if (session_type == LoadSession) |
303 GenerateKeyAdded(web_session_id); | 305 GenerateKeyAdded(web_session_id); |
304 } | 306 } |
305 | 307 |
306 } // namespace media | 308 } // namespace media |
OLD | NEW |