mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Introduce MainThreadScriptMsg::DispatchJobQueue
This removes the last remaining use of Task::run_with_script_thread
This commit is contained in:
parent
1d52df0562
commit
8e78f18d2d
4 changed files with 16 additions and 67 deletions
|
@ -6,7 +6,6 @@ use dom::bindings::inheritance::Castable;
|
|||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::event::{EventBubbles, EventCancelable, EventTask, SimpleEventTask};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::window::Window;
|
||||
use script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
|
||||
use script_thread::{MainThreadScriptMsg, Task, TaskCanceller};
|
||||
|
@ -43,21 +42,6 @@ impl TaskSource for DOMManipulationTaskSource {
|
|||
}
|
||||
|
||||
impl DOMManipulationTaskSource {
|
||||
pub fn queue_main_thread_task<T>(
|
||||
&self,
|
||||
task: Box<T>,
|
||||
global: &GlobalScope,
|
||||
) -> Result<(), ()>
|
||||
where
|
||||
T: Task + Send + 'static,
|
||||
{
|
||||
let msg = MainThreadScriptMsg::MainThreadTask(
|
||||
ScriptThreadEventCategory::ScriptEvent,
|
||||
global.task_canceller().wrap_task(task),
|
||||
);
|
||||
self.0.send(msg).map_err(|_| ())
|
||||
}
|
||||
|
||||
pub fn queue_event(&self,
|
||||
target: &EventTarget,
|
||||
name: Atom,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue