Reformat Window::new

This commit is contained in:
Anthony Ramine 2017-09-13 09:49:30 +02:00
parent 72f0fda836
commit 0822a74f94

View file

@ -1789,13 +1789,14 @@ impl Window {
impl Window {
#[allow(unsafe_code)]
pub fn new(runtime: Rc<Runtime>,
pub fn new(
runtime: Rc<Runtime>,
script_chan: MainThreadScriptChan,
dom_task_source: DOMManipulationTaskSource,
user_task_source: UserInteractionTaskSource,
network_task_source: NetworkingTaskSource,
history_task_source: HistoryTraversalTaskSource,
file_task_source: FileReadingTaskSource,
dom_manipulation_task_source: DOMManipulationTaskSource,
user_interaction_task_source: UserInteractionTaskSource,
networking_task_source: NetworkingTaskSource,
history_traversal_task_source: HistoryTraversalTaskSource,
file_reading_task_source: FileReadingTaskSource,
performance_timeline_task_source: PerformanceTimelineTaskSource,
image_cache_chan: Sender<ImageCacheMsg>,
image_cache: Arc<ImageCache>,
@ -1809,28 +1810,27 @@ impl Window {
scheduler_chan: IpcSender<TimerSchedulerMsg>,
timer_event_chan: IpcSender<TimerEvent>,
layout_chan: Sender<Msg>,
id: PipelineId,
pipelineid: PipelineId,
parent_info: Option<(PipelineId, FrameType)>,
window_size: Option<WindowSizeData>,
origin: MutableOrigin,
navigation_start: u64,
navigation_start_precise: f64,
webgl_chan: WebGLChan,
webvr_chan: Option<IpcSender<WebVRMsg>>)
-> Root<Window> {
webvr_chan: Option<IpcSender<WebVRMsg>>,
) -> Root<Self> {
let layout_rpc: Box<LayoutRPC + Send> = {
let (rpc_send, rpc_recv) = channel();
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
rpc_recv.recv().unwrap()
};
let error_reporter = CSSErrorReporter {
pipelineid: id,
pipelineid,
script_chan: Arc::new(Mutex::new(control_chan)),
};
let win = box Window {
globalscope:
GlobalScope::new_inherited(
id,
let win = box Self {
globalscope: GlobalScope::new_inherited(
pipelineid,
devtools_chan,
mem_profiler_chan,
time_profiler_chan,
@ -1838,16 +1838,17 @@ impl Window {
scheduler_chan,
resource_threads,
timer_event_chan,
origin),
script_chan: script_chan,
dom_manipulation_task_source: dom_task_source,
user_interaction_task_source: user_task_source,
networking_task_source: network_task_source,
history_traversal_task_source: history_task_source,
file_reading_task_source: file_task_source,
origin,
),
script_chan,
dom_manipulation_task_source,
user_interaction_task_source,
networking_task_source,
history_traversal_task_source,
file_reading_task_source,
performance_timeline_task_source,
image_cache_chan: image_cache_chan,
image_cache: image_cache.clone(),
image_cache_chan,
image_cache,
navigator: Default::default(),
history: Default::default(),
custom_element_registry: Default::default(),
@ -1860,34 +1861,33 @@ impl Window {
session_storage: Default::default(),
local_storage: Default::default(),
status: DOMRefCell::new(DOMString::new()),
parent_info: parent_info,
parent_info,
dom_static: GlobalStaticData::new(),
js_runtime: DOMRefCell::new(Some(runtime.clone())),
bluetooth_thread: bluetooth_thread,
bluetooth_thread,
bluetooth_extra_permission_data: BluetoothExtraPermissionData::new(),
page_clip_rect: Cell::new(max_rect()),
resize_event: Cell::new(None),
layout_chan: layout_chan,
layout_rpc: layout_rpc,
resize_event: Default::default(),
layout_chan,
layout_rpc,
window_size: Cell::new(window_size),
current_viewport: Cell::new(Rect::zero()),
suppress_reflow: Cell::new(true),
pending_reflow_count: Cell::new(0),
pending_reflow_count: Default::default(),
current_state: Cell::new(WindowState::Alive),
devtools_marker_sender: DOMRefCell::new(None),
devtools_markers: DOMRefCell::new(HashSet::new()),
webdriver_script_chan: DOMRefCell::new(None),
devtools_marker_sender: Default::default(),
devtools_markers: Default::default(),
webdriver_script_chan: Default::default(),
ignore_further_async_events: Default::default(),
error_reporter: error_reporter,
scroll_offsets: DOMRefCell::new(HashMap::new()),
error_reporter,
scroll_offsets: Default::default(),
media_query_lists: WeakMediaQueryListVec::new(),
test_runner: Default::default(),
webgl_chan: webgl_chan,
webvr_chan: webvr_chan,
permission_state_invocation_results: DOMRefCell::new(HashMap::new()),
pending_layout_images: DOMRefCell::new(HashMap::new()),
unminified_js_dir: DOMRefCell::new(None),
webgl_chan,
webvr_chan,
permission_state_invocation_results: Default::default(),
pending_layout_images: Default::default(),
unminified_js_dir: Default::default(),
test_worklet: Default::default(),
paint_worklet: Default::default(),
};