mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove the LayoutChan type.
It is a pointless abstraction.
This commit is contained in:
parent
2f9796fa69
commit
e94f3d4fe0
8 changed files with 26 additions and 45 deletions
|
@ -54,7 +54,7 @@ use js::glue::{CallObjectTracer, CallUnbarrieredObjectTracer, CallValueTracer};
|
|||
use js::jsapi::{GCTraceKindToAscii, Heap, TraceKind, JSObject, JSTracer};
|
||||
use js::jsval::JSVal;
|
||||
use js::rust::Runtime;
|
||||
use layout_interface::{LayoutChan, LayoutRPC};
|
||||
use layout_interface::LayoutRPC;
|
||||
use libc;
|
||||
use msg::constellation_msg::{FrameType, PipelineId, SubpageId, WindowSizeData, WindowSizeType, ReferrerPolicy};
|
||||
use net_traits::image::base::{Image, ImageMetadata};
|
||||
|
@ -296,7 +296,6 @@ no_jsmanaged_fields!(WorkerId);
|
|||
no_jsmanaged_fields!(QuirksMode);
|
||||
no_jsmanaged_fields!(Runtime);
|
||||
no_jsmanaged_fields!(Headers, Method);
|
||||
no_jsmanaged_fields!(LayoutChan);
|
||||
no_jsmanaged_fields!(WindowProxyHandler);
|
||||
no_jsmanaged_fields!(UntrustedNodeAddress);
|
||||
no_jsmanaged_fields!(LengthOrPercentageOrAuto);
|
||||
|
|
|
@ -92,7 +92,7 @@ use html5ever::tree_builder::{LimitedQuirks, NoQuirks, Quirks, QuirksMode};
|
|||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use js::jsapi::JS_GetRuntime;
|
||||
use js::jsapi::{JSContext, JSObject, JSRuntime};
|
||||
use layout_interface::{LayoutChan, Msg, ReflowQueryType};
|
||||
use layout_interface::{Msg, ReflowQueryType};
|
||||
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
|
||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||
use msg::constellation_msg::{PipelineId, ReferrerPolicy, SubpageId};
|
||||
|
@ -404,8 +404,7 @@ impl Document {
|
|||
self.quirks_mode.set(mode);
|
||||
|
||||
if mode == Quirks {
|
||||
let LayoutChan(ref layout_chan) = *self.window.layout_chan();
|
||||
layout_chan.send(Msg::SetQuirksMode).unwrap();
|
||||
self.window.layout_chan().send(Msg::SetQuirksMode).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ use hyper::header::ContentType;
|
|||
use hyper::mime::{Mime, TopLevel, SubLevel};
|
||||
use ipc_channel::ipc;
|
||||
use ipc_channel::router::ROUTER;
|
||||
use layout_interface::{LayoutChan, Msg};
|
||||
use layout_interface::Msg;
|
||||
use net_traits::{AsyncResponseListener, AsyncResponseTarget, Metadata, NetworkError};
|
||||
use network_listener::{NetworkListener, PreInvoke};
|
||||
use script_traits::{MozBrowserEvent, ScriptMsg as ConstellationMsg};
|
||||
|
@ -318,8 +318,7 @@ impl AsyncResponseListener for StylesheetContext {
|
|||
let document = document.r();
|
||||
|
||||
let win = window_from_node(elem);
|
||||
let LayoutChan(ref layout_chan) = *win.layout_chan();
|
||||
layout_chan.send(Msg::AddStylesheet(sheet.clone())).unwrap();
|
||||
win.layout_chan().send(Msg::AddStylesheet(sheet.clone())).unwrap();
|
||||
|
||||
*elem.stylesheet.borrow_mut() = Some(sheet);
|
||||
document.invalidate_stylesheets();
|
||||
|
|
|
@ -14,7 +14,7 @@ use dom::element::Element;
|
|||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{ChildrenMutation, Node, document_from_node, window_from_node};
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use layout_interface::{LayoutChan, Msg};
|
||||
use layout_interface::Msg;
|
||||
use std::sync::Arc;
|
||||
use string_cache::Atom;
|
||||
use style::media_queries::parse_media_query_list;
|
||||
|
@ -68,8 +68,7 @@ impl HTMLStyleElement {
|
|||
sheet.set_media(Some(media));
|
||||
let sheet = Arc::new(sheet);
|
||||
|
||||
let LayoutChan(ref layout_chan) = *win.layout_chan();
|
||||
layout_chan.send(Msg::AddStylesheet(sheet.clone())).unwrap();
|
||||
win.layout_chan().send(Msg::AddStylesheet(sheet.clone())).unwrap();
|
||||
*self.stylesheet.borrow_mut() = Some(sheet);
|
||||
let doc = document_from_node(self);
|
||||
doc.r().invalidate_stylesheets();
|
||||
|
|
|
@ -54,7 +54,7 @@ use euclid::size::Size2D;
|
|||
use heapsize::{HeapSizeOf, heap_size_of};
|
||||
use html5ever::tree_builder::QuirksMode;
|
||||
use js::jsapi::{JSContext, JSObject, JSRuntime};
|
||||
use layout_interface::{LayoutChan, Msg};
|
||||
use layout_interface::Msg;
|
||||
use libc::{self, c_void, uintptr_t};
|
||||
use parse::html::parse_html_fragment;
|
||||
use ref_slice::ref_slice;
|
||||
|
@ -195,9 +195,8 @@ impl OpaqueStyleAndLayoutData {
|
|||
pub fn dispose(self, node: &Node) {
|
||||
debug_assert!(thread_state::get().is_script());
|
||||
let win = window_from_node(node);
|
||||
let LayoutChan(ref chan) = *win.layout_chan();
|
||||
node.style_and_layout_data.set(None);
|
||||
chan.send(Msg::ReapStyleAndLayoutData(self)).unwrap();
|
||||
win.layout_chan().send(Msg::ReapStyleAndLayoutData(self)).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ use js::jsapi::{JS_GetRuntime, JS_GC, MutableHandleValue, SetWindowProxy};
|
|||
use js::rust::CompileOptionsWrapper;
|
||||
use js::rust::Runtime;
|
||||
use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow};
|
||||
use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowQueryType, MarginStyleResponse};
|
||||
use layout_interface::{LayoutRPC, Msg, Reflow, ReflowQueryType, MarginStyleResponse};
|
||||
use libc;
|
||||
use msg::constellation_msg::{LoadData, PanicMsg, PipelineId, SubpageId};
|
||||
use msg::constellation_msg::{WindowSizeData, WindowSizeType};
|
||||
|
@ -209,7 +209,7 @@ pub struct Window {
|
|||
|
||||
/// A handle for communicating messages to the layout thread.
|
||||
#[ignore_heap_size_of = "channels are hard"]
|
||||
layout_chan: LayoutChan,
|
||||
layout_chan: Sender<Msg>,
|
||||
|
||||
/// A handle to perform RPC calls into the layout, quickly.
|
||||
#[ignore_heap_size_of = "trait objects are hard"]
|
||||
|
@ -1057,8 +1057,7 @@ impl Window {
|
|||
query_type: query_type,
|
||||
};
|
||||
|
||||
let LayoutChan(ref chan) = self.layout_chan;
|
||||
chan.send(Msg::Reflow(reflow)).unwrap();
|
||||
self.layout_chan.send(Msg::Reflow(reflow)).unwrap();
|
||||
|
||||
debug!("script: layout forked");
|
||||
|
||||
|
@ -1300,7 +1299,7 @@ impl Window {
|
|||
self.devtools_chan.clone()
|
||||
}
|
||||
|
||||
pub fn layout_chan(&self) -> &LayoutChan {
|
||||
pub fn layout_chan(&self) -> &Sender<Msg> {
|
||||
&self.layout_chan
|
||||
}
|
||||
|
||||
|
@ -1484,15 +1483,14 @@ impl Window {
|
|||
scheduler_chan: IpcSender<TimerEventRequest>,
|
||||
panic_chan: IpcSender<PanicMsg>,
|
||||
timer_event_chan: IpcSender<TimerEvent>,
|
||||
layout_chan: LayoutChan,
|
||||
layout_chan: Sender<Msg>,
|
||||
id: PipelineId,
|
||||
parent_info: Option<(PipelineId, SubpageId)>,
|
||||
window_size: Option<WindowSizeData>)
|
||||
-> Root<Window> {
|
||||
let layout_rpc: Box<LayoutRPC> = {
|
||||
let (rpc_send, rpc_recv) = channel();
|
||||
let LayoutChan(ref lchan) = layout_chan;
|
||||
lchan.send(Msg::GetRPC(rpc_send)).unwrap();
|
||||
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
|
||||
rpc_recv.recv().unwrap()
|
||||
};
|
||||
let error_reporter = CSSErrorReporter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue