diff options
-rw-r--r-- | components/script/dom/bindings/global.rs | 6 | ||||
-rw-r--r-- | components/script/dom/document.rs | 14 | ||||
-rw-r--r-- | components/script/dom/htmlbodyelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 6 | ||||
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmllinkelement.rs | 4 | ||||
-rw-r--r-- | components/script/dom/htmlstyleelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmltextareaelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/node.rs | 2 | ||||
-rw-r--r-- | components/script/dom/window.rs | 16 | ||||
-rw-r--r-- | components/script/dom/worker.rs | 6 | ||||
-rw-r--r-- | components/script/dom/workerglobalscope.rs | 12 | ||||
-rw-r--r-- | components/script/script_thread.rs | 2 |
13 files changed, 38 insertions, 38 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index e50f8ace9d0..17a2688a910 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -74,7 +74,7 @@ impl<'a> GlobalRef<'a> { } /// Get a `mem::ProfilerChan` to send messages to the memory profiler thread. - pub fn mem_profiler_chan(&self) -> mem::ProfilerChan { + pub fn mem_profiler_chan(&self) -> &mem::ProfilerChan { match *self { GlobalRef::Window(window) => window.mem_profiler_chan(), GlobalRef::Worker(worker) => worker.mem_profiler_chan(), @@ -82,7 +82,7 @@ impl<'a> GlobalRef<'a> { } /// Get a `ConstellationChan` to send messages to the constellation channel when available. - pub fn constellation_chan(&self) -> ConstellationChan<ConstellationMsg> { + pub fn constellation_chan(&self) -> &ConstellationChan<ConstellationMsg> { match *self { GlobalRef::Window(window) => window.constellation_chan(), GlobalRef::Worker(worker) => worker.constellation_chan(), @@ -90,7 +90,7 @@ impl<'a> GlobalRef<'a> { } /// Get the scheduler channel to request timer events. - pub fn scheduler_chan(&self) -> IpcSender<TimerEventRequest> { + pub fn scheduler_chan(&self) -> &IpcSender<TimerEventRequest> { match *self { GlobalRef::Window(window) => window.scheduler_chan(), GlobalRef::Worker(worker) => worker.scheduler_chan(), diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index a3da74213e3..191ea0a92fa 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -401,7 +401,7 @@ impl Document { self.quirks_mode.set(mode); if mode == Quirks { - let LayoutChan(ref layout_chan) = self.window.layout_chan(); + let LayoutChan(ref layout_chan) = *self.window.layout_chan(); layout_chan.send(Msg::SetQuirksMode).unwrap(); } } @@ -615,7 +615,7 @@ impl Document { // Update the focus state for all elements in the focus chain. // https://html.spec.whatwg.org/multipage/#focus-chain if focus_type == FocusType::Element { - let ConstellationChan(ref chan) = self.window.constellation_chan(); + let ConstellationChan(ref chan) = *self.window.constellation_chan(); let event = ConstellationMsg::Focus(self.window.pipeline()); chan.send(event).unwrap(); } @@ -1260,7 +1260,7 @@ impl Document { pub fn trigger_mozbrowser_event(&self, event: MozBrowserEvent) { if htmliframeelement::mozbrowser_enabled() { if let Some((containing_pipeline_id, subpage_id)) = self.window.parent_info() { - let ConstellationChan(ref chan) = self.window.constellation_chan(); + let ConstellationChan(ref chan) = *self.window.constellation_chan(); let event = ConstellationMsg::MozBrowserEvent(containing_pipeline_id, subpage_id, event); @@ -1277,7 +1277,7 @@ impl Document { self.animation_frame_list.borrow_mut().insert(ident, callback); // TODO: Should tick animation only when document is visible - let ConstellationChan(ref chan) = self.window.constellation_chan(); + let ConstellationChan(ref chan) = *self.window.constellation_chan(); let event = ConstellationMsg::ChangeRunningAnimationsState(self.window.pipeline(), AnimationState::AnimationCallbacksPresent); chan.send(event).unwrap(); @@ -1289,7 +1289,7 @@ impl Document { pub fn cancel_animation_frame(&self, ident: u32) { self.animation_frame_list.borrow_mut().remove(&ident); if self.animation_frame_list.borrow().is_empty() { - let ConstellationChan(ref chan) = self.window.constellation_chan(); + let ConstellationChan(ref chan) = *self.window.constellation_chan(); let event = ConstellationMsg::ChangeRunningAnimationsState(self.window.pipeline(), AnimationState::NoAnimationCallbacksPresent); chan.send(event).unwrap(); @@ -1313,7 +1313,7 @@ impl Document { // the next frame (which is the common case), we won't send a NoAnimationCallbacksPresent // message quickly followed by an AnimationCallbacksPresent message. if self.animation_frame_list.borrow().is_empty() { - let ConstellationChan(ref chan) = self.window.constellation_chan(); + let ConstellationChan(ref chan) = *self.window.constellation_chan(); let event = ConstellationMsg::ChangeRunningAnimationsState(self.window.pipeline(), AnimationState::NoAnimationCallbacksPresent); chan.send(event).unwrap(); @@ -1473,7 +1473,7 @@ impl Document { pub fn notify_constellation_load(&self) { let pipeline_id = self.window.pipeline(); - let ConstellationChan(ref chan) = self.window.constellation_chan(); + let ConstellationChan(ref chan) = *self.window.constellation_chan(); let event = ConstellationMsg::DOMLoad(pipeline_id); chan.send(event).unwrap(); diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index ca133b88dbb..1c65a1f609f 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -154,7 +154,7 @@ impl VirtualMethods for HTMLBodyElement { let window = window_from_node(self); let document = window.Document(); document.set_reflow_timeout(time::precise_time_ns() + INITIAL_REFLOW_DELAY); - let ConstellationChan(ref chan) = window.constellation_chan(); + let ConstellationChan(ref chan) = *window.constellation_chan(); let event = ConstellationMsg::HeadParsed; chan.send(event).unwrap(); } diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 8036b1f6837..0ccf72ef66a 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -124,7 +124,7 @@ impl HTMLIFrameElement { let new_pipeline_id = self.pipeline_id.get().unwrap(); let private_iframe = self.privatebrowsing(); - let ConstellationChan(ref chan) = window.constellation_chan(); + let ConstellationChan(ref chan) = *window.constellation_chan(); let load_info = IFrameLoadInfo { url: url, containing_pipeline_id: window.pipeline(), @@ -371,7 +371,7 @@ pub fn Navigate(iframe: &HTMLIFrameElement, direction: NavigationDirection) -> E let pipeline_info = Some((window.pipeline(), iframe.subpage_id().unwrap())); - let ConstellationChan(ref chan) = window.constellation_chan(); + let ConstellationChan(ref chan) = *window.constellation_chan(); let msg = ConstellationMsg::Navigate(pipeline_info, direction); chan.send(msg).unwrap(); } @@ -575,7 +575,7 @@ impl VirtualMethods for HTMLIFrameElement { // // Since most of this cleanup doesn't happen on same-origin // iframes, and since that would cause a deadlock, don't do it. - let ConstellationChan(ref chan) = window.constellation_chan(); + let ConstellationChan(ref chan) = *window.constellation_chan(); let same_origin = if let Some(self_url) = self.get_url() { let win_url = window_from_node(self).get_url(); UrlHelper::SameOrigin(&self_url, &win_url) diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 74845a1afb9..45282f49911 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -122,7 +122,7 @@ static DEFAULT_MAX_LENGTH: i32 = -1; impl HTMLInputElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement { - let chan = document.window().constellation_chan(); + let chan = document.window().constellation_chan().clone(); HTMLInputElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index e2b2dc0edb0..023d8a36f58 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -242,7 +242,7 @@ impl HTMLLinkElement { let document = document_from_node(self); match document.base_url().join(href) { Ok(url) => { - let ConstellationChan(ref chan) = document.window().constellation_chan(); + let ConstellationChan(ref chan) = *document.window().constellation_chan(); let event = ConstellationMsg::NewFavicon(url.clone()); chan.send(event).unwrap(); @@ -318,7 +318,7 @@ impl AsyncResponseListener for StylesheetContext { let document = document.r(); let win = window_from_node(elem); - let LayoutChan(ref layout_chan) = win.r().layout_chan(); + let LayoutChan(ref layout_chan) = *win.layout_chan(); layout_chan.send(Msg::AddStylesheet(sheet.clone())).unwrap(); *elem.stylesheet.borrow_mut() = Some(sheet); diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index 067561d4181..e91b1a1e064 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -66,7 +66,7 @@ impl HTMLStyleElement { sheet.set_media(Some(media)); let sheet = Arc::new(sheet); - let LayoutChan(ref layout_chan) = win.layout_chan(); + let LayoutChan(ref layout_chan) = *win.layout_chan(); layout_chan.send(Msg::AddStylesheet(sheet.clone())).unwrap(); *self.stylesheet.borrow_mut() = Some(sheet); let doc = document_from_node(self); diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 0f764f12e7d..5ae40aec7da 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -100,7 +100,7 @@ impl HTMLTextAreaElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTextAreaElement { - let chan = document.window().constellation_chan(); + let chan = document.window().constellation_chan().clone(); HTMLTextAreaElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 0f2209c00ea..f9111d7f7f1 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -195,7 +195,7 @@ impl OpaqueStyleAndLayoutData { pub fn dispose(self, node: &Node) { debug_assert!(thread_state::get().is_script()); let win = window_from_node(node); - let LayoutChan(chan) = win.layout_chan(); + let LayoutChan(ref chan) = *win.layout_chan(); node.style_and_layout_data.set(None); chan.send(Msg::ReapStyleAndLayoutData(self)).unwrap(); } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 05115de0c58..94b6d2c7fb3 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1234,24 +1234,24 @@ impl Window { (*self.resource_thread).clone() } - pub fn mem_profiler_chan(&self) -> mem::ProfilerChan { - self.mem_profiler_chan.clone() + pub fn mem_profiler_chan(&self) -> &mem::ProfilerChan { + &self.mem_profiler_chan } pub fn devtools_chan(&self) -> Option<IpcSender<ScriptToDevtoolsControlMsg>> { self.devtools_chan.clone() } - pub fn layout_chan(&self) -> LayoutChan { - self.layout_chan.clone() + pub fn layout_chan(&self) -> &LayoutChan { + &self.layout_chan } - pub fn constellation_chan(&self) -> ConstellationChan<ConstellationMsg> { - self.constellation_chan.clone() + pub fn constellation_chan(&self) -> &ConstellationChan<ConstellationMsg> { + &self.constellation_chan } - pub fn scheduler_chan(&self) -> IpcSender<TimerEventRequest> { - self.scheduler_chan.clone() + pub fn scheduler_chan(&self) -> &IpcSender<TimerEventRequest> { + &self.scheduler_chan } pub fn schedule_callback(&self, callback: OneshotTimerCallback, duration: MsDuration) -> OneshotTimerHandle { diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index 0e31181a222..2590cfba5e7 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -75,8 +75,8 @@ impl Worker { }; let resource_thread = global.resource_thread(); - let constellation_chan = global.constellation_chan(); - let scheduler_chan = global.scheduler_chan(); + let constellation_chan = global.constellation_chan().clone(); + let scheduler_chan = global.scheduler_chan().clone(); let (sender, receiver) = channel(); let closing = Arc::new(AtomicBool::new(false)); @@ -103,7 +103,7 @@ impl Worker { let init = WorkerGlobalScopeInit { resource_thread: resource_thread, - mem_profiler_chan: global.mem_profiler_chan(), + mem_profiler_chan: global.mem_profiler_chan().clone(), to_devtools_sender: global.devtools_chan(), from_devtools_sender: optional_sender, constellation_chan: constellation_chan, diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index dc097cd602c..fbfd6a1a8bc 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -126,8 +126,8 @@ impl WorkerGlobalScope { } } - pub fn mem_profiler_chan(&self) -> mem::ProfilerChan { - self.mem_profiler_chan.clone() + pub fn mem_profiler_chan(&self) -> &mem::ProfilerChan { + &self.mem_profiler_chan } pub fn devtools_chan(&self) -> Option<IpcSender<ScriptToDevtoolsControlMsg>> { @@ -142,12 +142,12 @@ impl WorkerGlobalScope { &self.from_devtools_receiver } - pub fn constellation_chan(&self) -> ConstellationChan<ConstellationMsg> { - self.constellation_chan.clone() + pub fn constellation_chan(&self) -> &ConstellationChan<ConstellationMsg> { + &self.constellation_chan } - pub fn scheduler_chan(&self) -> IpcSender<TimerEventRequest> { - self.scheduler_chan.clone() + pub fn scheduler_chan(&self) -> &IpcSender<TimerEventRequest> { + &self.scheduler_chan } pub fn schedule_callback(&self, callback: OneshotTimerCallback, duration: MsDuration) -> OneshotTimerHandle { diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 54724914688..107902b88ee 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1966,7 +1966,7 @@ fn shut_down_layout(page_tree: &Rc<Page>) { // processed this message. let (response_chan, response_port) = channel(); let window = page.window(); - let LayoutChan(chan) = window.layout_chan(); + let LayoutChan(chan) = window.layout_chan().clone(); if chan.send(layout_interface::Msg::PrepareToExit(response_chan)).is_ok() { channels.push(chan); response_port.recv().unwrap(); |