mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add the TaskSourceName to CommonScriptMsg::Task
Update QueuedTaskConversion and the TaskQueue to use it
This commit is contained in:
parent
b211e45bb0
commit
e286fdcc53
18 changed files with 134 additions and 71 deletions
|
@ -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,
|
||||
);
|
||||
let msg = MainThreadScriptMsg::Common(msg);
|
||||
self.global_init.to_script_thread_sender.send(msg).expect("Worklet thread outlived script thread.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue