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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1070853004: media: CdmFactory creates CDM (MediaKeys) asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use ScopedVector Created 5 years, 8 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 | « media/blink/webmediaplayer_impl.h ('k') | media/cdm/default_cdm_factory.h » ('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 fe30c5efea2ed3e040d45e2b3130f0929f7325bb..ab62772c2b205e9920bca514ee9a677d865f4d58 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -137,11 +137,12 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
compositor_(new VideoFrameCompositor(
BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnNaturalSizeChanged),
BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnOpacityChanged))),
- encrypted_media_support_(
- cdm_factory,
- client,
- params.media_permission(),
- base::Bind(&WebMediaPlayerImpl::SetCdm, AsWeakPtr())),
+ encrypted_media_support_(cdm_factory,
+ client,
+ params.media_permission(),
+ base::Bind(&WebMediaPlayerImpl::SetCdm,
+ AsWeakPtr(),
+ base::Bind(&IgnoreCdmAttached))),
renderer_factory_(renderer_factory.Pass()) {
// Threaded compositing isn't enabled universally yet.
if (!compositor_task_runner_.get())
@@ -151,9 +152,9 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED));
if (params.initial_cdm()) {
- SetCdm(
- ToWebContentDecryptionModuleImpl(params.initial_cdm())->GetCdmContext(),
- base::Bind(&IgnoreCdmAttached));
+ SetCdm(base::Bind(&IgnoreCdmAttached),
+ ToWebContentDecryptionModuleImpl(params.initial_cdm())
+ ->GetCdmContext());
}
// TODO(xhwang): When we use an external Renderer, many methods won't work,
@@ -660,8 +661,8 @@ void WebMediaPlayerImpl::setContentDecryptionModule(
return;
}
- SetCdm(ToWebContentDecryptionModuleImpl(cdm)->GetCdmContext(),
- BIND_TO_RENDER_LOOP1(&WebMediaPlayerImpl::OnCdmAttached, result));
+ SetCdm(BIND_TO_RENDER_LOOP1(&WebMediaPlayerImpl::OnCdmAttached, result),
+ ToWebContentDecryptionModuleImpl(cdm)->GetCdmContext());
}
void WebMediaPlayerImpl::OnEncryptedMediaInitData(
@@ -695,8 +696,8 @@ void WebMediaPlayerImpl::OnWaitingForDecryptionKey() {
client_->didResumePlaybackBlockedForKey();
}
-void WebMediaPlayerImpl::SetCdm(CdmContext* cdm_context,
- const CdmAttachedCB& cdm_attached_cb) {
+void WebMediaPlayerImpl::SetCdm(const CdmAttachedCB& cdm_attached_cb,
+ CdmContext* cdm_context) {
pipeline_.SetCdm(cdm_context, cdm_attached_cb);
}
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | media/cdm/default_cdm_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698