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

@ -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(),
};