diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-10-08 10:18:13 +0200 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-11-20 13:33:14 +0100 |
commit | 4d147d2c56465405e7c3281073ef57fe1bd1c062 (patch) | |
tree | 7098eaa3bcccf06c44696023352eec78736b7027 /components/script/script_thread.rs | |
parent | 9c329a79354cb8b6c1000aa7c78364a5541de421 (diff) | |
download | servo-4d147d2c56465405e7c3281073ef57fe1bd1c062.tar.gz servo-4d147d2c56465405e7c3281073ef57fe1bd1c062.zip |
Register media instance with session and prepare communication with embedder
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index ec1f5852060..e7b39d26420 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -3993,6 +3993,19 @@ impl ScriptThread { .remove(&browsing_context_id); }) } + + pub fn get_media_session( + browsing_context_id: TopLevelBrowsingContextId, + ) -> Option<DomRoot<MediaSession>> { + SCRIPT_THREAD_ROOT.with(|root| { + let script_thread = unsafe { &*root.get().unwrap() }; + script_thread + .media_sessions + .borrow() + .get(&browsing_context_id) + .map(|s| DomRoot::from_ref(&**s)) + }) + } } impl Drop for ScriptThread { |