mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
MediaSessionAction message from embedder to script thread
This commit is contained in:
parent
7101a9d070
commit
6233f78de4
5 changed files with 97 additions and 3 deletions
|
@ -139,7 +139,7 @@ use script_traits::{
|
|||
DiscardBrowsingContext, DocumentActivity, EventResult, HistoryEntryReplacement,
|
||||
};
|
||||
use script_traits::{InitialScriptState, JsEvalResult, LayoutMsg, LoadData, LoadOrigin};
|
||||
use script_traits::{MouseButton, MouseEventType, NewLayoutInfo};
|
||||
use script_traits::{MediaSessionActionType, MouseButton, MouseEventType, NewLayoutInfo};
|
||||
use script_traits::{Painter, ProgressiveWebMetricType, ScriptMsg, ScriptThreadFactory};
|
||||
use script_traits::{ScriptToConstellationChan, TimerEvent, TimerSchedulerMsg};
|
||||
use script_traits::{TimerSource, TouchEventType, TouchId, UntrustedNodeAddress, WheelDelta};
|
||||
|
@ -1720,6 +1720,7 @@ impl ScriptThread {
|
|||
WebVREvents(id, ..) => Some(id),
|
||||
PaintMetric(..) => None,
|
||||
ExitFullScreen(id, ..) => Some(id),
|
||||
MediaSessionAction(..) => None,
|
||||
}
|
||||
},
|
||||
MixedMessage::FromDevtools(_) => None,
|
||||
|
@ -1949,6 +1950,9 @@ impl ScriptThread {
|
|||
ConstellationControlMsg::PaintMetric(pipeline_id, metric_type, metric_value) => {
|
||||
self.handle_paint_metric(pipeline_id, metric_type, metric_value)
|
||||
},
|
||||
ConstellationControlMsg::MediaSessionAction(browsing_context_id, action) => {
|
||||
self.handle_media_session_action(browsing_context_id, action)
|
||||
},
|
||||
msg @ ConstellationControlMsg::AttachLayout(..) |
|
||||
msg @ ConstellationControlMsg::Viewport(..) |
|
||||
msg @ ConstellationControlMsg::SetScrollState(..) |
|
||||
|
@ -3932,6 +3936,14 @@ impl ScriptThread {
|
|||
}
|
||||
}
|
||||
|
||||
fn handle_media_session_action(
|
||||
&self,
|
||||
browsing_context_id: TopLevelBrowsingContextId,
|
||||
action: MediaSessionActionType,
|
||||
) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
pub fn enqueue_microtask(job: Microtask) {
|
||||
SCRIPT_THREAD_ROOT.with(|root| {
|
||||
let script_thread = unsafe { &*root.get().unwrap() };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue