diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 114d5ca3a0d..b606192cb54 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1789,65 +1789,66 @@ impl Window { impl Window { #[allow(unsafe_code)] - pub fn new(runtime: Rc, - script_chan: MainThreadScriptChan, - dom_task_source: DOMManipulationTaskSource, - user_task_source: UserInteractionTaskSource, - network_task_source: NetworkingTaskSource, - history_task_source: HistoryTraversalTaskSource, - file_task_source: FileReadingTaskSource, - performance_timeline_task_source: PerformanceTimelineTaskSource, - image_cache_chan: Sender, - image_cache: Arc, - resource_threads: ResourceThreads, - bluetooth_thread: IpcSender, - mem_profiler_chan: MemProfilerChan, - time_profiler_chan: TimeProfilerChan, - devtools_chan: Option>, - constellation_chan: ScriptToConstellationChan, - control_chan: IpcSender, - scheduler_chan: IpcSender, - timer_event_chan: IpcSender, - layout_chan: Sender, - id: PipelineId, - parent_info: Option<(PipelineId, FrameType)>, - window_size: Option, - origin: MutableOrigin, - navigation_start: u64, - navigation_start_precise: f64, - webgl_chan: WebGLChan, - webvr_chan: Option>) - -> Root { + pub fn new( + runtime: Rc, + script_chan: MainThreadScriptChan, + 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, + image_cache: Arc, + resource_threads: ResourceThreads, + bluetooth_thread: IpcSender, + mem_profiler_chan: MemProfilerChan, + time_profiler_chan: TimeProfilerChan, + devtools_chan: Option>, + constellation_chan: ScriptToConstellationChan, + control_chan: IpcSender, + scheduler_chan: IpcSender, + timer_event_chan: IpcSender, + layout_chan: Sender, + pipelineid: PipelineId, + parent_info: Option<(PipelineId, FrameType)>, + window_size: Option, + origin: MutableOrigin, + navigation_start: u64, + navigation_start_precise: f64, + webgl_chan: WebGLChan, + webvr_chan: Option>, + ) -> Root { let layout_rpc: Box = { 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, - devtools_chan, - mem_profiler_chan, - time_profiler_chan, - constellation_chan, - 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, + let win = box Self { + globalscope: GlobalScope::new_inherited( + pipelineid, + devtools_chan, + mem_profiler_chan, + time_profiler_chan, + constellation_chan, + scheduler_chan, + resource_threads, + timer_event_chan, + 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(), };