aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-10-04 12:54:16 +0200
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-11-20 13:32:10 +0100
commit7101a9d070dd3d7bb89475e125de65f85f93221e (patch)
tree939bb30764baaf32f37ad2246085bbe1df958b20 /components/script/script_thread.rs
parentf8246801ba47f66d205dae142d4d3498a304220e (diff)
downloadservo-7101a9d070dd3d7bb89475e125de65f85f93221e.tar.gz
servo-7101a9d070dd3d7bb89475e125de65f85f93221e.zip
Use BrowsingContextId for MediaSession registration
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 5aec6a8a57d..2bd7cc4907b 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -698,10 +698,10 @@ pub struct ScriptThread {
/// Code is running as a consequence of a user interaction
is_user_interacting: Cell<bool>,
- /// The MediaSessions registered for this Pipeline, if any.
- /// There can only be one active MediaSession. The constellation
- /// has the PipelineId of the active MediaSession, if any.
- media_sessions: DomRefCell<HashMap<PipelineId, Dom<MediaSession>>>,
+ /// The MediaSessions known by this thread, if any.
+ /// There can only be one active MediaSession.
+ /// The constellation has the BrowsingContextId of the active MediaSession, if any.
+ media_sessions: DomRefCell<HashMap<TopLevelBrowsingContextId, Dom<MediaSession>>>,
}
/// In the event of thread panic, all data on the stack runs its destructor. However, there
@@ -3956,23 +3956,26 @@ impl ScriptThread {
)
}
- pub fn register_media_session(media_session: &MediaSession, pipeline_id: PipelineId) {
+ pub fn register_media_session(
+ media_session: &MediaSession,
+ browsing_context_id: TopLevelBrowsingContextId,
+ ) {
SCRIPT_THREAD_ROOT.with(|root| {
let script_thread = unsafe { &*root.get().unwrap() };
script_thread
.media_sessions
.borrow_mut()
- .insert(pipeline_id, Dom::from_ref(media_session));
+ .insert(browsing_context_id, Dom::from_ref(media_session));
})
}
- pub fn remove_media_session(pipeline_id: PipelineId) {
+ pub fn remove_media_session(browsing_context_id: TopLevelBrowsingContextId) {
SCRIPT_THREAD_ROOT.with(|root| {
let script_thread = unsafe { &*root.get().unwrap() };
script_thread
.media_sessions
.borrow_mut()
- .remove(&pipeline_id);
+ .remove(&browsing_context_id);
})
}
}