Move boxing to runnable initialization

This commit is contained in:
Connor Brewster 2016-07-13 11:10:13 -06:00
parent 5f7324a9a5
commit ad30275d04
10 changed files with 20 additions and 20 deletions

View file

@ -73,7 +73,7 @@ impl VirtualMethods for HTMLDetailsElement {
let window = window_from_node(self);
let task_source = window.dom_manipulation_task_source();
let details = Trusted::new(self);
let runnable = DetailsNotificationRunnable {
let runnable = box DetailsNotificationRunnable {
element: details,
toggle_number: counter
};

View file

@ -474,7 +474,7 @@ impl HTMLFormElement {
self.generation_id.set(GenerationId(prev_id + 1));
// Step 2
let nav = PlannedNavigation {
let nav = box PlannedNavigation {
load_data: load_data,
pipeline_id: window.pipeline(),
script_chan: window.main_thread_script_chan().clone(),

View file

@ -140,7 +140,7 @@ impl HTMLImageElement {
// Return the image via a message to the script thread, which marks the element
// as dirty and triggers a reflow.
let image_response = message.to().unwrap();
let runnable = ImageResponseHandlerRunnable::new(
let runnable = box ImageResponseHandlerRunnable::new(
trusted_node.clone(), image_response);
let runnable = wrapper.wrap_runnable(runnable);
let _ = script_chan.send(CommonScriptMsg::RunnableMsg(
@ -179,7 +179,7 @@ impl HTMLImageElement {
}
}
let runnable = ImgParseErrorRunnable {
let runnable = box ImgParseErrorRunnable {
img: Trusted::new(self),
src: src.into(),
};

View file

@ -237,7 +237,7 @@ impl HTMLMediaElement {
}
}
let task = Task {
let task = box Task {
elem: Trusted::new(self),
};
let win = window_from_node(self);
@ -261,7 +261,7 @@ impl HTMLMediaElement {
}
}
let task = Task {
let task = box Task {
elem: Trusted::new(self),
};
let win = window_from_node(self);
@ -270,7 +270,7 @@ impl HTMLMediaElement {
fn queue_fire_simple_event(&self, type_: &'static str) {
let win = window_from_node(self);
let task = FireSimpleEventTask::new(self, type_);
let task = box FireSimpleEventTask::new(self, type_);
let _ = win.dom_manipulation_task_source().queue(task, win.r());
}
@ -498,7 +498,7 @@ impl HTMLMediaElement {
fn queue_dedicated_media_source_failure_steps(&self) {
let window = window_from_node(self);
let _ = window.dom_manipulation_task_source().queue(DedicatedMediaSourceFailureTask::new(self), window.r());
let _ = window.dom_manipulation_task_source().queue(box DedicatedMediaSourceFailureTask::new(self), window.r());
}
// https://html.spec.whatwg.org/multipage/#dedicated-media-source-failure-steps

View file

@ -161,7 +161,7 @@ impl Storage {
let window = global_ref.as_window();
let task_source = window.dom_manipulation_task_source();
let trusted_storage = Trusted::new(self);
task_source.queue(StorageEventRunnable::new(trusted_storage, key, old_value, new_value), window).unwrap();
task_source.queue(box StorageEventRunnable::new(trusted_storage, key, old_value, new_value), window).unwrap();
}
}