| 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 "content/renderer/media/cdm/ppapi_decryptor.h" | 5 #include "content/renderer/media/cdm/ppapi_decryptor.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 198 } |
| 199 | 199 |
| 200 CdmDelegate()->RemoveSession(session_id, std::move(promise)); | 200 CdmDelegate()->RemoveSession(session_id, std::move(promise)); |
| 201 } | 201 } |
| 202 | 202 |
| 203 media::CdmContext* PpapiDecryptor::GetCdmContext() { | 203 media::CdmContext* PpapiDecryptor::GetCdmContext() { |
| 204 return this; | 204 return this; |
| 205 } | 205 } |
| 206 | 206 |
| 207 media::Decryptor* PpapiDecryptor::GetDecryptor() { | 207 media::Decryptor* PpapiDecryptor::GetDecryptor() { |
| 208 return this; | 208 base::AutoLock auto_lock(lock_); |
| 209 return had_fatal_plugin_error_ ? nullptr : this; |
| 209 } | 210 } |
| 210 | 211 |
| 211 int PpapiDecryptor::GetCdmId() const { | 212 int PpapiDecryptor::GetCdmId() const { |
| 212 return kInvalidCdmId; | 213 return kInvalidCdmId; |
| 213 } | 214 } |
| 214 | 215 |
| 215 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type, | 216 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type, |
| 216 const NewKeyCB& new_key_cb) { | 217 const NewKeyCB& new_key_cb) { |
| 217 if (!render_task_runner_->BelongsToCurrentThread()) { | 218 if (!render_task_runner_->BelongsToCurrentThread()) { |
| 218 render_task_runner_->PostTask( | 219 render_task_runner_->PostTask( |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 430 |
| 430 void PpapiDecryptor::AttemptToResumePlayback() { | 431 void PpapiDecryptor::AttemptToResumePlayback() { |
| 431 if (!new_audio_key_cb_.is_null()) | 432 if (!new_audio_key_cb_.is_null()) |
| 432 new_audio_key_cb_.Run(); | 433 new_audio_key_cb_.Run(); |
| 433 | 434 |
| 434 if (!new_video_key_cb_.is_null()) | 435 if (!new_video_key_cb_.is_null()) |
| 435 new_video_key_cb_.Run(); | 436 new_video_key_cb_.Run(); |
| 436 } | 437 } |
| 437 | 438 |
| 438 void PpapiDecryptor::OnFatalPluginError() { | 439 void PpapiDecryptor::OnFatalPluginError() { |
| 440 DVLOG(1) << __func__; |
| 439 DCHECK(render_task_runner_->BelongsToCurrentThread()); | 441 DCHECK(render_task_runner_->BelongsToCurrentThread()); |
| 440 pepper_cdm_wrapper_.reset(); | 442 pepper_cdm_wrapper_.reset(); |
| 443 |
| 444 base::AutoLock auto_lock(lock_); |
| 445 had_fatal_plugin_error_ = true; |
| 441 } | 446 } |
| 442 | 447 |
| 443 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() { | 448 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() { |
| 444 DCHECK(render_task_runner_->BelongsToCurrentThread()); | 449 DCHECK(render_task_runner_->BelongsToCurrentThread()); |
| 445 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL; | 450 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL; |
| 446 } | 451 } |
| 447 | 452 |
| 448 } // namespace content | 453 } // namespace content |
| OLD | NEW |