Chromium Code Reviews| 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/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/metrics/sparse_histogram.h" | 9 #include "base/metrics/sparse_histogram.h" |
| 10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 audio_channel_count_(0), | 345 audio_channel_count_(0), |
| 346 audio_channel_layout_(media::CHANNEL_LAYOUT_NONE), | 346 audio_channel_layout_(media::CHANNEL_LAYOUT_NONE), |
| 347 weak_ptr_factory_(this) { | 347 weak_ptr_factory_(this) { |
| 348 weak_this_ = weak_ptr_factory_.GetWeakPtr(); | 348 weak_this_ = weak_ptr_factory_.GetWeakPtr(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 ContentDecryptorDelegate::~ContentDecryptorDelegate() { | 351 ContentDecryptorDelegate::~ContentDecryptorDelegate() { |
| 352 SatisfyAllPendingCallbacksOnError(); | 352 SatisfyAllPendingCallbacksOnError(); |
| 353 } | 353 } |
| 354 | 354 |
| 355 // TODO(jrummell): Remove |session_ready_cb| and |session_keys_change_cb|. | 355 // TODO(jrummell): Remove |session_ready_cb| and |session_keys_change_cb|. |
|
ddorwin
2015/03/06 21:42:54
Can we do this now?
I guess it doesn't need to be
sandersd (OOO until July 31)
2015/03/06 22:36:58
After discussion with John, I've removed the TODO.
| |
| 356 void ContentDecryptorDelegate::Initialize( | 356 void ContentDecryptorDelegate::Initialize( |
| 357 const std::string& key_system, | 357 const std::string& key_system, |
| 358 bool allow_distinctive_identifier, | |
| 359 bool allow_persistent_state, | |
| 358 const media::SessionMessageCB& session_message_cb, | 360 const media::SessionMessageCB& session_message_cb, |
| 359 const media::SessionClosedCB& session_closed_cb, | 361 const media::SessionClosedCB& session_closed_cb, |
| 360 const media::SessionErrorCB& session_error_cb, | 362 const media::SessionErrorCB& session_error_cb, |
| 361 const media::SessionKeysChangeCB& session_keys_change_cb, | 363 const media::SessionKeysChangeCB& session_keys_change_cb, |
| 362 const media::SessionExpirationUpdateCB& session_expiration_update_cb, | 364 const media::SessionExpirationUpdateCB& session_expiration_update_cb, |
| 363 const base::Closure& fatal_plugin_error_cb) { | 365 const base::Closure& fatal_plugin_error_cb) { |
| 364 DCHECK(!key_system.empty()); | 366 DCHECK(!key_system.empty()); |
| 365 DCHECK(key_system_.empty()); | 367 DCHECK(key_system_.empty()); |
| 366 key_system_ = key_system; | 368 key_system_ = key_system; |
| 367 | 369 |
| 368 session_message_cb_ = session_message_cb; | 370 session_message_cb_ = session_message_cb; |
| 369 session_closed_cb_ = session_closed_cb; | 371 session_closed_cb_ = session_closed_cb; |
| 370 session_error_cb_ = session_error_cb; | 372 session_error_cb_ = session_error_cb; |
| 371 session_keys_change_cb_ = session_keys_change_cb; | 373 session_keys_change_cb_ = session_keys_change_cb; |
| 372 session_expiration_update_cb_ = session_expiration_update_cb; | 374 session_expiration_update_cb_ = session_expiration_update_cb; |
| 373 fatal_plugin_error_cb_ = fatal_plugin_error_cb; | 375 fatal_plugin_error_cb_ = fatal_plugin_error_cb; |
| 374 | 376 |
| 375 plugin_decryption_interface_->Initialize( | 377 plugin_decryption_interface_->Initialize( |
| 376 pp_instance_, StringVar::StringToPPVar(key_system_)); | 378 pp_instance_, StringVar::StringToPPVar(key_system_), |
| 379 PP_FromBool(allow_distinctive_identifier), | |
| 380 PP_FromBool(allow_persistent_state)); | |
| 377 } | 381 } |
| 378 | 382 |
| 379 void ContentDecryptorDelegate::InstanceCrashed() { | 383 void ContentDecryptorDelegate::InstanceCrashed() { |
| 380 fatal_plugin_error_cb_.Run(); | 384 fatal_plugin_error_cb_.Run(); |
| 381 SatisfyAllPendingCallbacksOnError(); | 385 SatisfyAllPendingCallbacksOnError(); |
| 382 } | 386 } |
| 383 | 387 |
| 384 void ContentDecryptorDelegate::SetServerCertificate( | 388 void ContentDecryptorDelegate::SetServerCertificate( |
| 385 const uint8_t* certificate, | 389 const uint8_t* certificate, |
| 386 uint32_t certificate_length, | 390 uint32_t certificate_length, |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1265 empty_frames); | 1269 empty_frames); |
| 1266 } | 1270 } |
| 1267 | 1271 |
| 1268 if (!video_decode_cb_.is_null()) | 1272 if (!video_decode_cb_.is_null()) |
| 1269 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1273 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
| 1270 | 1274 |
| 1271 cdm_promise_adapter_.Clear(); | 1275 cdm_promise_adapter_.Clear(); |
| 1272 } | 1276 } |
| 1273 | 1277 |
| 1274 } // namespace content | 1278 } // namespace content |
| OLD | NEW |