diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-04-02 00:59:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 22:59:50 +0000 |
commit | 4402b7cf8f56aa6e62a13dd1997b570e7331b72e (patch) | |
tree | fa68aa51981c263fd3ee66e816fd600322b35b19 /components/script/script_thread.rs | |
parent | 0d38d6239a4356928c2a7ec0a3cd53ecc32096b0 (diff) | |
download | servo-4402b7cf8f56aa6e62a13dd1997b570e7331b72e.tar.gz servo-4402b7cf8f56aa6e62a13dd1997b570e7331b72e.zip |
libservo: Remove a couple `EmbedderMethods` (#36276)
- Remove `EmbedderMethods::get_user_agent_string`. This is now part of
the `Preferences` data structure, which should allow it to be
per-`WebView` in the future.
- Remove `EmbedderMethods::get_version_string`. This was used to include
some data along with WebRender captures about the Servo version. This
isn't really necessary and it was done to replace code in the past
that output the WebRender version, so also isn't what the original
code did. I think we can just remove this entirely.
The idea with these changes is that `EmbedderMethods` can be removed
in a followup and the rest of the methods can be added to
`ServoDelegate`. These two methods are ones that cannot be added to a
delegate as they are used during `Servo` initialization.
Testing: There is currently no testing for libservo. These changes are
meant
as preparation for adding a suite of `WebView` unit tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 8c0eec13628..35b45fee6dd 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -17,7 +17,6 @@ //! a page runs its course and the script thread returns to processing events in the main event //! loop. -use std::borrow::Cow; use std::cell::{Cell, RefCell}; use std::collections::{HashMap, HashSet}; use std::default::Default; @@ -308,9 +307,6 @@ pub struct ScriptThread { #[no_trace] user_content_manager: UserContentManager, - /// An optional string allowing the user agent to be set for testing. - user_agent: Cow<'static, str>, - /// Application window's GL Context for Media player #[no_trace] player_context: WindowGLContext, @@ -390,7 +386,6 @@ impl ScriptThreadFactory for ScriptThread { layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, load_data: LoadData, - user_agent: Cow<'static, str>, ) { thread::Builder::new() .name(format!("Script{:?}", state.id)) @@ -408,8 +403,7 @@ impl ScriptThreadFactory for ScriptThread { let memory_profiler_sender = state.memory_profiler_sender.clone(); let window_size = state.window_size; - let script_thread = - ScriptThread::new(state, layout_factory, system_font_service, user_agent); + let script_thread = ScriptThread::new(state, layout_factory, system_font_service); SCRIPT_THREAD_ROOT.with(|root| { root.set(Some(&script_thread as *const _)); @@ -736,7 +730,6 @@ impl ScriptThread { .pipeline_to_constellation_sender .clone(), image_cache: script_thread.image_cache.clone(), - user_agent: script_thread.user_agent.clone(), #[cfg(feature = "webgpu")] gpu_id_hub: script_thread.gpu_id_hub.clone(), inherited_secure_context: script_thread.inherited_secure_context, @@ -826,7 +819,6 @@ impl ScriptThread { state: InitialScriptState, layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, - user_agent: Cow<'static, str>, ) -> ScriptThread { let (self_sender, self_receiver) = unbounded(); let runtime = Runtime::new(Some(SendableTaskSource { @@ -938,7 +930,6 @@ impl ScriptThread { unminify_js: opts.unminify_js, local_script_source: opts.local_script_source.clone(), unminify_css: opts.unminify_css, - user_agent, user_content_manager: state.user_content_manager, player_context: state.player_context, node_ids: Default::default(), @@ -3109,7 +3100,6 @@ impl ScriptThread { self.unminify_css, self.local_script_source.clone(), self.user_content_manager.clone(), - self.user_agent.clone(), self.player_context.clone(), #[cfg(feature = "webgpu")] self.gpu_id_hub.clone(), |