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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2402563002: Keep reference to CDM to avoid it's premature destruction (Closed)
Patch Set: nits Created 4 years, 2 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/webcontentdecryptionmodule_impl.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index 16f3bbdbec91f6973d68da6e9dcb52e15f4c662f..8fcae51c904b86ce45a47e463d2ef69341a3ce10 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -69,6 +69,7 @@ class GLES2Interface;
namespace media {
class ChunkDemuxer;
class GpuVideoAcceleratorFactories;
+class MediaKeys;
class MediaLog;
class UrlIndex;
class VideoFrameCompositor;
@@ -306,9 +307,9 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// tracks separately in WebSourceBufferImpl.
void OnFFmpegMediaTracksUpdated(std::unique_ptr<MediaTracks> tracks);
- // Sets |cdm_context| on the pipeline and fires |cdm_attached_cb| when done.
- // Parameter order is reversed for easy binding.
- void SetCdm(const CdmAttachedCB& cdm_attached_cb, CdmContext* cdm_context);
+ // Sets CdmContext from |cdm| on the pipeline and calls OnCdmAttached()
+ // when done.
+ void SetCdm(blink::WebContentDecryptionModule* cdm);
// Called when a CDM has been attached to the |pipeline_|.
void OnCdmAttached(bool success);
@@ -486,8 +487,13 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
std::unique_ptr<blink::WebContentDecryptionModuleResult> set_cdm_result_;
- // Whether a CDM has been successfully attached.
- bool is_cdm_attached_;
+ // If a CDM is attached keep a reference to it, so that it is not destroyed
+ // until after the pipeline is done with it.
+ scoped_refptr<MediaKeys> cdm_;
+
+ // Keep track of the CDM while it is in the process of attaching to the
+ // pipeline.
+ scoped_refptr<MediaKeys> pending_cdm_;
#if defined(OS_ANDROID) // WMPI_CAST
WebMediaPlayerCast cast_impl_;
« no previous file with comments | « media/blink/webcontentdecryptionmodule_impl.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698