diff options
author | xhwang <xhwang@chromium.org> | 2015-11-02 18:09:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-03 02:10:09 +0000 |
commit | b24facba10f213d4448bf108ba0d01821b2ba05d (patch) | |
tree | dc37dde6542fb240c51058ddde8b01e091a8aa66 /content/browser/renderer_host/render_process_host_impl.h | |
parent | 098cffd5ec2661f0e283584729f325feb95ecc73 (diff) | |
download | chromium_src-b24facba10f213d4448bf108ba0d01821b2ba05d.zip chromium_src-b24facba10f213d4448bf108ba0d01821b2ba05d.tar.gz chromium_src-b24facba10f213d4448bf108ba0d01821b2ba05d.tar.bz2 |
media: Make MediaKeys ref-counted.
MediaKeys (CDM) is created and owned by the EME stack (e.g. CdmSessionAdapter)
but is dereferenced by the media pipeline (e.g. DecryptingVideoDecoder). During
teardown, we need to make sure the CDM is not dereferenced by the media pipeline
after it's destructed.
In the Render process, this is guaranteed by the order of destruction of
MediaKeys and Media elements in the Blink layer.
However, when the CDM and the media pipeline are running out-of-process, because
the order of IPC messages on different IPC channels is nondeterministic, we need
some extra mechanism to ensure that the media pipeline doesn't dereference a
destructed CDM. Currently on Android, this is achieved by using an extra
PlayerTracker interface. However, in some situations, e.g. when the media
pipeline and CDM are running on different threads, the destruction handling code
could be pretty complicated.
When a MojoMediaApplication is hosted in a non-Render process, we face the same
issue.
Starting with this CL, we'll make MediaKeys ref-counted, so that the media
pipeline that uses it will also hold a ref-count to it. This will greatly
simplify the lifetime management between the CDM and the media pipeline.
BUG=511040
TEST=All existing use cases still work.
Review URL: https://codereview.chromium.org/1407933010
Cr-Commit-Position: refs/heads/master@{#357514}
Diffstat (limited to 'content/browser/renderer_host/render_process_host_impl.h')
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 026809a..c9bf7f6 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h @@ -159,8 +159,8 @@ class CONTENT_EXPORT RenderProcessHostImpl void SendUpdateValueState( unsigned int target, const gpu::ValueState& state) override; #if defined(ENABLE_BROWSER_CDMS) - media::BrowserCdm* GetBrowserCdm(int render_frame_id, - int cdm_id) const override; + scoped_refptr<media::MediaKeys> GetCdm(int render_frame_id, + int cdm_id) const override; #endif // IPC::Sender via RenderProcessHost. |