diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index c868ce6e8c8..b1fcca0097e 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -576,17 +576,6 @@ impl UnprivilegedPipelineContent { inherited_secure_context: self.load_data.inherited_secure_context.clone(), }, self.load_data.clone(), - self.opts.debug.profile_script_events, - self.opts.print_pwm, - self.opts.debug.relayout_event, - self.opts.output_file.is_some() || - self.opts.exit_after_load || - self.opts.webdriver_port.is_some(), - self.opts.unminify_js, - self.opts.local_script_source, - self.opts.userscripts, - self.opts.headless, - self.opts.debug.replace_surrogates, self.user_agent, ); diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index b417f453cdf..a248765403f 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -755,15 +755,6 @@ impl ScriptThreadFactory for ScriptThread { fn create( state: InitialScriptState, load_data: LoadData, - profile_script_events: bool, - print_pwm: bool, - relayout_event: bool, - prepare_for_screenshot: bool, - unminify_js: bool, - local_script_source: Option, - userscripts_path: Option, - headless: bool, - replace_surrogates: bool, user_agent: Cow<'static, str>, ) -> (Sender, Receiver) { let (script_chan, script_port) = unbounded(); @@ -788,21 +779,8 @@ impl ScriptThreadFactory for ScriptThread { let window_size = state.window_size; let layout_is_busy = state.layout_is_busy.clone(); - let script_thread = ScriptThread::new( - state, - script_port, - script_chan.clone(), - profile_script_events, - print_pwm, - relayout_event, - prepare_for_screenshot, - unminify_js, - local_script_source, - userscripts_path, - headless, - replace_surrogates, - user_agent, - ); + let script_thread = + ScriptThread::new(state, script_port, script_chan.clone(), user_agent); SCRIPT_THREAD_ROOT.with(|root| { root.set(Some(&script_thread as *const _)); @@ -1273,17 +1251,12 @@ impl ScriptThread { state: InitialScriptState, port: Receiver, chan: Sender, - profile_script_events: bool, - print_pwm: bool, - relayout_event: bool, - prepare_for_screenshot: bool, - unminify_js: bool, - local_script_source: Option, - userscripts_path: Option, - headless: bool, - replace_surrogates: bool, user_agent: Cow<'static, str>, ) -> ScriptThread { + let opts = opts::get(); + let prepare_for_screenshot = + opts.output_file.is_some() || opts.exit_after_load || opts.webdriver_port.is_some(); + let boxed_script_sender = Box::new(MainThreadScriptChan(chan.clone())); let runtime = new_rt_and_cx(Some(NetworkingTaskSource( @@ -1392,17 +1365,17 @@ impl ScriptThread { webrender_document: state.webrender_document, webrender_api_sender: state.webrender_api_sender, - profile_script_events, - print_pwm, + profile_script_events: opts.debug.profile_script_events, + print_pwm: opts.print_pwm, + relayout_event: opts.debug.relayout_event, - relayout_event, prepare_for_screenshot, - unminify_js, - local_script_source, + unminify_js: opts.unminify_js, + local_script_source: opts.local_script_source.clone(), - userscripts_path, - headless, - replace_surrogates, + userscripts_path: opts.userscripts.clone(), + headless: opts.headless, + replace_surrogates: opts.debug.replace_surrogates, user_agent, player_context: state.player_context, event_loop_waker: state.event_loop_waker, diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 14144d8880b..4eaf90ea7fc 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -700,15 +700,6 @@ pub trait ScriptThreadFactory { fn create( state: InitialScriptState, load_data: LoadData, - profile_script_events: bool, - print_pwm: bool, - relayout_event: bool, - prepare_for_screenshot: bool, - unminify_js: bool, - local_script_source: Option, - userscripts_path: Option, - headless: bool, - replace_surrogates: bool, user_agent: Cow<'static, str>, ) -> (Sender, Receiver); }