mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Clean up arguments passed to ScriptThread
This commit is contained in:
parent
040816b78d
commit
0a3797d130
3 changed files with 14 additions and 61 deletions
|
@ -576,17 +576,6 @@ impl UnprivilegedPipelineContent {
|
||||||
inherited_secure_context: self.load_data.inherited_secure_context.clone(),
|
inherited_secure_context: self.load_data.inherited_secure_context.clone(),
|
||||||
},
|
},
|
||||||
self.load_data.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,
|
self.user_agent,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -755,15 +755,6 @@ impl ScriptThreadFactory for ScriptThread {
|
||||||
fn create(
|
fn create(
|
||||||
state: InitialScriptState,
|
state: InitialScriptState,
|
||||||
load_data: LoadData,
|
load_data: LoadData,
|
||||||
profile_script_events: bool,
|
|
||||||
print_pwm: bool,
|
|
||||||
relayout_event: bool,
|
|
||||||
prepare_for_screenshot: bool,
|
|
||||||
unminify_js: bool,
|
|
||||||
local_script_source: Option<String>,
|
|
||||||
userscripts_path: Option<String>,
|
|
||||||
headless: bool,
|
|
||||||
replace_surrogates: bool,
|
|
||||||
user_agent: Cow<'static, str>,
|
user_agent: Cow<'static, str>,
|
||||||
) -> (Sender<message::Msg>, Receiver<message::Msg>) {
|
) -> (Sender<message::Msg>, Receiver<message::Msg>) {
|
||||||
let (script_chan, script_port) = unbounded();
|
let (script_chan, script_port) = unbounded();
|
||||||
|
@ -788,21 +779,8 @@ impl ScriptThreadFactory for ScriptThread {
|
||||||
let window_size = state.window_size;
|
let window_size = state.window_size;
|
||||||
let layout_is_busy = state.layout_is_busy.clone();
|
let layout_is_busy = state.layout_is_busy.clone();
|
||||||
|
|
||||||
let script_thread = ScriptThread::new(
|
let script_thread =
|
||||||
state,
|
ScriptThread::new(state, script_port, script_chan.clone(), user_agent);
|
||||||
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,
|
|
||||||
);
|
|
||||||
|
|
||||||
SCRIPT_THREAD_ROOT.with(|root| {
|
SCRIPT_THREAD_ROOT.with(|root| {
|
||||||
root.set(Some(&script_thread as *const _));
|
root.set(Some(&script_thread as *const _));
|
||||||
|
@ -1273,17 +1251,12 @@ impl ScriptThread {
|
||||||
state: InitialScriptState,
|
state: InitialScriptState,
|
||||||
port: Receiver<MainThreadScriptMsg>,
|
port: Receiver<MainThreadScriptMsg>,
|
||||||
chan: Sender<MainThreadScriptMsg>,
|
chan: Sender<MainThreadScriptMsg>,
|
||||||
profile_script_events: bool,
|
|
||||||
print_pwm: bool,
|
|
||||||
relayout_event: bool,
|
|
||||||
prepare_for_screenshot: bool,
|
|
||||||
unminify_js: bool,
|
|
||||||
local_script_source: Option<String>,
|
|
||||||
userscripts_path: Option<String>,
|
|
||||||
headless: bool,
|
|
||||||
replace_surrogates: bool,
|
|
||||||
user_agent: Cow<'static, str>,
|
user_agent: Cow<'static, str>,
|
||||||
) -> ScriptThread {
|
) -> 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 boxed_script_sender = Box::new(MainThreadScriptChan(chan.clone()));
|
||||||
|
|
||||||
let runtime = new_rt_and_cx(Some(NetworkingTaskSource(
|
let runtime = new_rt_and_cx(Some(NetworkingTaskSource(
|
||||||
|
@ -1392,17 +1365,17 @@ impl ScriptThread {
|
||||||
webrender_document: state.webrender_document,
|
webrender_document: state.webrender_document,
|
||||||
webrender_api_sender: state.webrender_api_sender,
|
webrender_api_sender: state.webrender_api_sender,
|
||||||
|
|
||||||
profile_script_events,
|
profile_script_events: opts.debug.profile_script_events,
|
||||||
print_pwm,
|
print_pwm: opts.print_pwm,
|
||||||
|
relayout_event: opts.debug.relayout_event,
|
||||||
|
|
||||||
relayout_event,
|
|
||||||
prepare_for_screenshot,
|
prepare_for_screenshot,
|
||||||
unminify_js,
|
unminify_js: opts.unminify_js,
|
||||||
local_script_source,
|
local_script_source: opts.local_script_source.clone(),
|
||||||
|
|
||||||
userscripts_path,
|
userscripts_path: opts.userscripts.clone(),
|
||||||
headless,
|
headless: opts.headless,
|
||||||
replace_surrogates,
|
replace_surrogates: opts.debug.replace_surrogates,
|
||||||
user_agent,
|
user_agent,
|
||||||
player_context: state.player_context,
|
player_context: state.player_context,
|
||||||
event_loop_waker: state.event_loop_waker,
|
event_loop_waker: state.event_loop_waker,
|
||||||
|
|
|
@ -700,15 +700,6 @@ pub trait ScriptThreadFactory {
|
||||||
fn create(
|
fn create(
|
||||||
state: InitialScriptState,
|
state: InitialScriptState,
|
||||||
load_data: LoadData,
|
load_data: LoadData,
|
||||||
profile_script_events: bool,
|
|
||||||
print_pwm: bool,
|
|
||||||
relayout_event: bool,
|
|
||||||
prepare_for_screenshot: bool,
|
|
||||||
unminify_js: bool,
|
|
||||||
local_script_source: Option<String>,
|
|
||||||
userscripts_path: Option<String>,
|
|
||||||
headless: bool,
|
|
||||||
replace_surrogates: bool,
|
|
||||||
user_agent: Cow<'static, str>,
|
user_agent: Cow<'static, str>,
|
||||||
) -> (Sender<Self::Message>, Receiver<Self::Message>);
|
) -> (Sender<Self::Message>, Receiver<Self::Message>);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue