| 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 "webkit/plugins/ppapi/content_decryptor_delegate.h" | 5 #include "webkit/plugins/ppapi/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 "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 void ContentDecryptorDelegate::Initialize(const std::string& key_system) { | 288 void ContentDecryptorDelegate::Initialize(const std::string& key_system) { |
| 289 // TODO(ddorwin): Add an Initialize method to PPP_ContentDecryptor_Private. | 289 // TODO(ddorwin): Add an Initialize method to PPP_ContentDecryptor_Private. |
| 290 DCHECK(!key_system.empty()); | 290 DCHECK(!key_system.empty()); |
| 291 key_system_ = key_system; | 291 key_system_ = key_system; |
| 292 } | 292 } |
| 293 | 293 |
| 294 void ContentDecryptorDelegate::SetKeyEventCallbacks( | 294 void ContentDecryptorDelegate::SetKeyEventCallbacks( |
| 295 const media::KeyAddedCB& key_added_cb, | 295 const media::KeyAddedCB& key_added_cb, |
| 296 const media::KeyErrorCB& key_error_cb, | 296 const media::KeyErrorCB& key_error_cb, |
| 297 const media::KeyMessageCB& key_message_cb, | 297 const media::KeyMessageCB& key_message_cb) { |
| 298 const media::NeedKeyCB& need_key_cb) { | |
| 299 key_added_cb_ = key_added_cb; | 298 key_added_cb_ = key_added_cb; |
| 300 key_error_cb_ = key_error_cb; | 299 key_error_cb_ = key_error_cb; |
| 301 key_message_cb_ = key_message_cb; | 300 key_message_cb_ = key_message_cb; |
| 302 need_key_cb_ = need_key_cb; | |
| 303 } | 301 } |
| 304 | 302 |
| 305 bool ContentDecryptorDelegate::GenerateKeyRequest(const std::string& type, | 303 bool ContentDecryptorDelegate::GenerateKeyRequest(const std::string& type, |
| 306 const uint8* init_data, | 304 const uint8* init_data, |
| 307 int init_data_length) { | 305 int init_data_length) { |
| 308 PP_Var init_data_array = | 306 PP_Var init_data_array = |
| 309 PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar( | 307 PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar( |
| 310 init_data_length, init_data); | 308 init_data_length, init_data); |
| 311 | 309 |
| 312 plugin_decryption_interface_->GenerateKeyRequest( | 310 plugin_decryption_interface_->GenerateKeyRequest( |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 | 1016 |
| 1019 if (free_buffers_.empty()) | 1017 if (free_buffers_.empty()) |
| 1020 return; | 1018 return; |
| 1021 | 1019 |
| 1022 tracking_info->buffer_id = free_buffers_.front(); | 1020 tracking_info->buffer_id = free_buffers_.front(); |
| 1023 free_buffers_.pop(); | 1021 free_buffers_.pop(); |
| 1024 } | 1022 } |
| 1025 | 1023 |
| 1026 } // namespace ppapi | 1024 } // namespace ppapi |
| 1027 } // namespace webkit | 1025 } // namespace webkit |
| OLD | NEW |