diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/htmldetailselement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlformelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlimageelement.rs | 4 | ||||
-rw-r--r-- | components/script/dom/htmlmediaelement.rs | 8 | ||||
-rw-r--r-- | components/script/dom/storage.rs | 2 | ||||
-rw-r--r-- | components/script/network_listener.rs | 4 | ||||
-rw-r--r-- | components/script/script_thread.rs | 6 | ||||
-rw-r--r-- | components/script/task_source/dom_manipulation.rs | 6 | ||||
-rw-r--r-- | components/script/task_source/mod.rs | 2 | ||||
-rw-r--r-- | components/script/task_source/user_interaction.rs | 4 |
10 files changed, 20 insertions, 20 deletions
diff --git a/components/script/dom/htmldetailselement.rs b/components/script/dom/htmldetailselement.rs index a116c09a755..619c8263e3f 100644 --- a/components/script/dom/htmldetailselement.rs +++ b/components/script/dom/htmldetailselement.rs @@ -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 }; diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index eb23c52c775..f2615ff0374 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -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(), diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 7a47293eb42..52d5c9d7222 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -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(), }; diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index 16c41811384..b95244f02bf 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -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 diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs index 20b5d4924a8..11dfc3ab5d2 100644 --- a/components/script/dom/storage.rs +++ b/components/script/dom/storage.rs @@ -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(); } } diff --git a/components/script/network_listener.rs b/components/script/network_listener.rs index 272dfb0a975..1dd0d8f0a34 100644 --- a/components/script/network_listener.rs +++ b/components/script/network_listener.rs @@ -19,14 +19,14 @@ pub struct NetworkListener<Listener: PreInvoke + Send + 'static> { impl<Listener: PreInvoke + Send + 'static> NetworkListener<Listener> { pub fn notify<A: Action<Listener> + Send + 'static>(&self, action: A) { - let runnable = ListenerRunnable { + let runnable = box ListenerRunnable { context: self.context.clone(), action: action, }; let result = if let Some(ref wrapper) = self.wrapper { self.script_chan.send(CommonScriptMsg::RunnableMsg(NetworkEvent, wrapper.wrap_runnable(runnable))) } else { - self.script_chan.send(CommonScriptMsg::RunnableMsg(NetworkEvent, box runnable)) + self.script_chan.send(CommonScriptMsg::RunnableMsg(NetworkEvent, runnable)) }; if let Err(err) = result { warn!("failed to deliver network data: {:?}", err); diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 3f79912bea2..788ec212a72 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -174,10 +174,10 @@ pub struct RunnableWrapper { } impl RunnableWrapper { - pub fn wrap_runnable<T: Runnable + Send + 'static>(&self, runnable: T) -> Box<Runnable + Send> { + pub fn wrap_runnable<T: Runnable + Send + 'static>(&self, runnable: Box<T>) -> Box<Runnable + Send> { box CancellableRunnable { cancelled: self.cancelled.clone(), - inner: box runnable, + inner: runnable, } } } @@ -1226,7 +1226,7 @@ impl ScriptThread { doc.mut_loader().inhibit_events(); // https://html.spec.whatwg.org/multipage/#the-end step 7 - let handler = DocumentProgressHandler::new(Trusted::new(doc)); + let handler = box DocumentProgressHandler::new(Trusted::new(doc)); self.dom_manipulation_task_source.queue(handler, doc.window()).unwrap(); self.constellation_chan.send(ConstellationMsg::LoadComplete(pipeline)).unwrap(); diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs index 5deef052c3e..b8bad662353 100644 --- a/components/script/task_source/dom_manipulation.rs +++ b/components/script/task_source/dom_manipulation.rs @@ -16,7 +16,7 @@ use task_source::TaskSource; pub struct DOMManipulationTaskSource(pub Sender<MainThreadScriptMsg>); impl TaskSource for DOMManipulationTaskSource { - fn queue<T: Runnable + Send + 'static>(&self, msg: T, window: &Window) -> Result<(), ()> { + fn queue<T: Runnable + Send + 'static>(&self, msg: Box<T>, window: &Window) -> Result<(), ()> { let msg = DOMManipulationTask(window.get_runnable_wrapper().wrap_runnable(msg)); self.0.send(MainThreadScriptMsg::DOMManipulation(msg)).map_err(|_| ()) } @@ -30,7 +30,7 @@ impl DOMManipulationTaskSource { cancelable: EventCancelable, window: &Window) { let target = Trusted::new(target); - let runnable = EventRunnable { + let runnable = box EventRunnable { target: target, name: name, bubbles: bubbles, @@ -41,7 +41,7 @@ impl DOMManipulationTaskSource { pub fn queue_simple_event(&self, target: &EventTarget, name: Atom, window: &Window) { let target = Trusted::new(target); - let runnable = SimpleEventRunnable { + let runnable = box SimpleEventRunnable { target: target, name: name, }; diff --git a/components/script/task_source/mod.rs b/components/script/task_source/mod.rs index 393a358fadb..48fc775d959 100644 --- a/components/script/task_source/mod.rs +++ b/components/script/task_source/mod.rs @@ -13,5 +13,5 @@ use script_thread::Runnable; use std::result::Result; pub trait TaskSource { - fn queue<T: Runnable + Send + 'static>(&self, msg: T, window: &Window) -> Result<(), ()>; + fn queue<T: Runnable + Send + 'static>(&self, msg: Box<T>, window: &Window) -> Result<(), ()>; } diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs index 7bd8f58b006..2f4c0923801 100644 --- a/components/script/task_source/user_interaction.rs +++ b/components/script/task_source/user_interaction.rs @@ -16,7 +16,7 @@ use task_source::TaskSource; pub struct UserInteractionTaskSource(pub Sender<MainThreadScriptMsg>); impl TaskSource for UserInteractionTaskSource { - fn queue<T: Runnable + Send + 'static>(&self, msg: T, window: &Window) -> Result<(), ()> { + fn queue<T: Runnable + Send + 'static>(&self, msg: Box<T>, window: &Window) -> Result<(), ()> { let msg = UserInteractionTask(window.get_runnable_wrapper().wrap_runnable(msg)); self.0.send(MainThreadScriptMsg::UserInteraction(msg)).map_err(|_| ()) } @@ -30,7 +30,7 @@ impl UserInteractionTaskSource { cancelable: EventCancelable, window: &Window) { let target = Trusted::new(target); - let runnable = EventRunnable { + let runnable = box EventRunnable { target: target, name: name, bubbles: bubbles, |