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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2402563002: Keep reference to CDM to avoid it's premature destruction (Closed)
Patch Set: MediaKeys 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
Index: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index 16f3bbdbec91f6973d68da6e9dcb52e15f4c662f..661dbb598e5fe37f3dff3be893fb7ce026c68dc3 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,9 @@ 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_;
#if defined(OS_ANDROID) // WMPI_CAST
WebMediaPlayerCast cast_impl_;

Powered by Google App Engine
This is Rietveld 408576698