| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/content_decryptor_delegate.h" | 5 #include "content/renderer/pepper/content_decryptor_delegate.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| 11 #include "base/numerics/safe_conversions.h" | 11 #include "base/numerics/safe_conversions.h" |
| 12 #include "content/renderer/pepper/ppb_buffer_impl.h" | 12 #include "content/renderer/pepper/ppb_buffer_impl.h" |
| 13 #include "media/base/audio_buffer.h" | 13 #include "media/base/audio_buffer.h" |
| 14 #include "media/base/audio_decoder_config.h" | 14 #include "media/base/audio_decoder_config.h" |
| 15 #include "media/base/bind_to_current_loop.h" | 15 #include "media/base/bind_to_current_loop.h" |
| 16 #include "media/base/cdm_key_information.h" |
| 16 #include "media/base/cdm_promise.h" | 17 #include "media/base/cdm_promise.h" |
| 17 #include "media/base/channel_layout.h" | 18 #include "media/base/channel_layout.h" |
| 18 #include "media/base/data_buffer.h" | 19 #include "media/base/data_buffer.h" |
| 19 #include "media/base/decoder_buffer.h" | 20 #include "media/base/decoder_buffer.h" |
| 20 #include "media/base/decrypt_config.h" | 21 #include "media/base/decrypt_config.h" |
| 21 #include "media/base/key_systems.h" | 22 #include "media/base/key_systems.h" |
| 22 #include "media/base/limits.h" | 23 #include "media/base/limits.h" |
| 23 #include "media/base/video_decoder_config.h" | 24 #include "media/base/video_decoder_config.h" |
| 24 #include "media/base/video_frame.h" | 25 #include "media/base/video_frame.h" |
| 25 #include "media/base/video_util.h" | 26 #include "media/base/video_util.h" |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 | 772 |
| 772 void ContentDecryptorDelegate::OnSessionKeysChange( | 773 void ContentDecryptorDelegate::OnSessionKeysChange( |
| 773 PP_Var web_session_id, | 774 PP_Var web_session_id, |
| 774 PP_Bool has_additional_usable_key) { | 775 PP_Bool has_additional_usable_key) { |
| 775 if (session_keys_change_cb_.is_null()) | 776 if (session_keys_change_cb_.is_null()) |
| 776 return; | 777 return; |
| 777 | 778 |
| 778 StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); | 779 StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); |
| 779 DCHECK(web_session_id_string); | 780 DCHECK(web_session_id_string); |
| 780 | 781 |
| 782 // TODO(jrummell): Pass key information through Pepper. |
| 781 session_keys_change_cb_.Run(web_session_id_string->value(), | 783 session_keys_change_cb_.Run(web_session_id_string->value(), |
| 782 PP_ToBool(has_additional_usable_key)); | 784 PP_ToBool(has_additional_usable_key), |
| 785 media::CdmKeyInformationVector()); |
| 783 } | 786 } |
| 784 | 787 |
| 785 void ContentDecryptorDelegate::OnSessionExpirationChange( | 788 void ContentDecryptorDelegate::OnSessionExpirationChange( |
| 786 PP_Var web_session_id, | 789 PP_Var web_session_id, |
| 787 PP_Time new_expiry_time) { | 790 PP_Time new_expiry_time) { |
| 788 if (session_expiration_update_cb_.is_null()) | 791 if (session_expiration_update_cb_.is_null()) |
| 789 return; | 792 return; |
| 790 | 793 |
| 791 StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); | 794 StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); |
| 792 DCHECK(web_session_id_string); | 795 DCHECK(web_session_id_string); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 | 1277 |
| 1275 scoped_ptr<CdmPromise> ContentDecryptorDelegate::TakePromise( | 1278 scoped_ptr<CdmPromise> ContentDecryptorDelegate::TakePromise( |
| 1276 uint32_t promise_id) { | 1279 uint32_t promise_id) { |
| 1277 PromiseMap::iterator it = promises_.find(promise_id); | 1280 PromiseMap::iterator it = promises_.find(promise_id); |
| 1278 if (it == promises_.end()) | 1281 if (it == promises_.end()) |
| 1279 return scoped_ptr<CdmPromise>(); | 1282 return scoped_ptr<CdmPromise>(); |
| 1280 return promises_.take_and_erase(it); | 1283 return promises_.take_and_erase(it); |
| 1281 } | 1284 } |
| 1282 | 1285 |
| 1283 } // namespace content | 1286 } // namespace content |
| OLD | NEW |