Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2703993002: media: Resolve pending SetCdm() when WebMediaPlayerImpl is destructed (Closed)
Patch Set: comments addressed Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/renderers/renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 0fa7375bcc2d696445a008bc170d00aff3074539..e20f8c0765ee5f1335f8d53ac41ada15532c4b96 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -241,6 +241,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
params.max_keyframe_distance_to_disable_background_video()),
enable_instant_source_buffer_gc_(
params.enable_instant_source_buffer_gc()) {
+ DVLOG(1) << __func__;
DCHECK(!adjust_allocated_memory_cb_.is_null());
DCHECK(renderer_factory_);
DCHECK(client_);
@@ -270,8 +271,15 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
}
WebMediaPlayerImpl::~WebMediaPlayerImpl() {
+ DVLOG(1) << __func__;
DCHECK(main_task_runner_->BelongsToCurrentThread());
+ if (set_cdm_result_) {
+ DVLOG(2) << "Resolve pending SetCdm() when media player is destroyed.";
+ set_cdm_result_->complete();
+ set_cdm_result_.reset();
+ }
+
suppress_destruction_errors_ = true;
delegate_->PlayerGone(delegate_id_);
@@ -299,6 +307,7 @@ WebMediaPlayerImpl::~WebMediaPlayerImpl() {
void WebMediaPlayerImpl::load(LoadType load_type,
const blink::WebMediaPlayerSource& source,
CORSMode cors_mode) {
+ DVLOG(1) << __func__;
// Only URL or MSE blob URL is supported.
DCHECK(source.isURL());
blink::WebURL url = source.getAsURL();
@@ -958,6 +967,7 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
void WebMediaPlayerImpl::setContentDecryptionModule(
blink::WebContentDecryptionModule* cdm,
blink::WebContentDecryptionModuleResult result) {
+ DVLOG(1) << __func__ << ": cdm = " << cdm;
DCHECK(main_task_runner_->BelongsToCurrentThread());
// Once the CDM is set it can't be cleared as there may be frames being
@@ -1062,6 +1072,7 @@ void WebMediaPlayerImpl::SetCdm(blink::WebContentDecryptionModule* cdm) {
}
void WebMediaPlayerImpl::OnCdmAttached(bool success) {
+ DVLOG(1) << __func__ << ": success = " << success;
DCHECK(main_task_runner_->BelongsToCurrentThread());
DCHECK(pending_cdm_);
« no previous file with comments | « no previous file | media/renderers/renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698