New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add task source name #21583
Add task source name #21583
Changes from all commits
File filter...
Jump to…
| @@ -2837,7 +2837,14 @@ impl Document { | ||
| let trusted_pending = Trusted::new(pending); | ||
| let trusted_promise = TrustedPromise::new(promise.clone()); | ||
| let handler = ElementPerformFullscreenEnter::new(trusted_pending, trusted_promise, error); | ||
| let script_msg = CommonScriptMsg::Task(ScriptThreadEventCategory::EnterFullscreen, handler, pipeline_id); | ||
| // NOTE: This steps should be running in parallel | ||
| // https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen | ||
| let script_msg = CommonScriptMsg::Task( | ||
| ScriptThreadEventCategory::EnterFullscreen, | ||
| handler, | ||
| pipeline_id, | ||
| TaskSourceName::DOMManipulation, | ||
gterzian
Member
|
||
| ); | ||
| let msg = MainThreadScriptMsg::Common(script_msg); | ||
| window.main_thread_script_chan().send(msg).unwrap(); | ||
|
|
||
| @@ -2870,7 +2877,14 @@ impl Document { | ||
| let trusted_promise = TrustedPromise::new(promise.clone()); | ||
| let handler = ElementPerformFullscreenExit::new(trusted_element, trusted_promise); | ||
| let pipeline_id = Some(global.pipeline_id()); | ||
| let script_msg = CommonScriptMsg::Task(ScriptThreadEventCategory::ExitFullscreen, handler, pipeline_id); | ||
| // NOTE: This steps should be running in parallel | ||
| // https://fullscreen.spec.whatwg.org/#exit-fullscreen | ||
| let script_msg = CommonScriptMsg::Task( | ||
| ScriptThreadEventCategory::ExitFullscreen, | ||
| handler, | ||
| pipeline_id, | ||
| TaskSourceName::DOMManipulation, | ||
gterzian
Member
|
||
| ); | ||
| let msg = MainThreadScriptMsg::Common(script_msg); | ||
| window.main_thread_script_chan().send(msg).unwrap(); | ||
|
|
||
| @@ -42,6 +42,7 @@ use std::ops::Deref; | ||
| use std::rc::Rc; | ||
| use std::sync::mpsc; | ||
| use std::thread; | ||
| use task_source::TaskSourceName; | ||
| use webvr_traits::{WebVRDisplayData, WebVRDisplayEvent, WebVRFrameData, WebVRLayer, WebVRMsg}; | ||
|
|
||
| #[dom_struct] | ||
| @@ -517,7 +518,14 @@ impl VRDisplay { | ||
| let task = Box::new(task!(handle_vrdisplay_raf: move || { | ||
| this.root().handle_raf(&sender); | ||
| })); | ||
| js_sender.send(CommonScriptMsg::Task(WebVREvent, task, Some(pipeline_id))).unwrap(); | ||
| // NOTE: WebVR spec doesn't specify what task source we should use. Is | ||
| // dom-manipulation a good choice long term? | ||
| js_sender.send(CommonScriptMsg::Task( | ||
| WebVREvent, | ||
| task, | ||
| Some(pipeline_id), | ||
| TaskSourceName::DOMManipulation, | ||
gterzian
Member
|
||
| )).unwrap(); | ||
|
|
||
| // Run Sync Poses in parallell on Render thread | ||
| let msg = WebVRCommand::SyncPoses(display_id, near, far, sync_sender.clone()); | ||
| @@ -268,7 +268,13 @@ impl WebSocket { | ||
| let pipeline_id = self.global().pipeline_id(); | ||
| self.global() | ||
| .script_chan() | ||
| .send(CommonScriptMsg::Task(WebSocketEvent, task, Some(pipeline_id))) | ||
| // TODO: Use a dedicated `websocket-task-source` task source instead. | ||
| .send(CommonScriptMsg::Task( | ||
| WebSocketEvent, | ||
| task, | ||
| Some(pipeline_id), | ||
| TaskSourceName::Networking, | ||
gterzian
Member
|
||
| )) | ||
| .unwrap(); | ||
| } | ||
|
|
||
| @@ -66,6 +66,7 @@ use style::thread_state::{self, ThreadState}; | ||
| use swapper::Swapper; | ||
| use swapper::swapper; | ||
| use task::TaskBox; | ||
| use task_source::TaskSourceName; | ||
| use uuid::Uuid; | ||
|
|
||
| // Magic numbers | ||
| @@ -644,7 +645,14 @@ impl WorkletThread { | ||
| where | ||
| T: TaskBox + 'static, | ||
| { | ||
| let msg = CommonScriptMsg::Task(ScriptThreadEventCategory::WorkletEvent, Box::new(task), None); | ||
| // NOTE: It's unclear which task source should be used here: | ||
| // https://drafts.css-houdini.org/worklets/#dom-worklet-addmodule | ||
| let msg = CommonScriptMsg::Task( | ||
| ScriptThreadEventCategory::WorkletEvent, | ||
| Box::new(task), | ||
| None, | ||
| TaskSourceName::DOMManipulation, | ||
gterzian
Member
|
||
| ); | ||
| let msg = MainThreadScriptMsg::Common(msg); | ||
| self.global_init.to_script_thread_sender.send(msg).expect("Worklet thread outlived script thread."); | ||
| } | ||
Could you please add a TODO, and file a corresponding issue, pointing out that we should be using a new
unshipped-port-message-queuetask source that should be used here?See https://html.spec.whatwg.org/multipage/#unshipped-port-message-queue (I got to this following the spec link just above the
fn PostMessageand looking for the task source that would correspond to this specific tasks, it's often mentioned somewhere else than where the task itself is mentioned, often at the bottom of the relevant section...)