mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
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>
This commit is contained in:
parent
0d38d6239a
commit
4402b7cf8f
27 changed files with 95 additions and 206 deletions
|
@ -161,7 +161,6 @@ impl App {
|
|||
window.rendering_context(),
|
||||
embedder,
|
||||
Rc::new(UpcastedWindow(window.clone())),
|
||||
self.servoshell_preferences.user_agent.clone(),
|
||||
user_content_manager,
|
||||
);
|
||||
servo.setup_logging();
|
||||
|
|
|
@ -68,8 +68,4 @@ impl EmbedderMethods for EmbedderCallbacks {
|
|||
registry.register("resource", resource::ResourceProtocolHandler::default());
|
||||
registry
|
||||
}
|
||||
|
||||
fn get_version_string(&self) -> Option<String> {
|
||||
crate::servo_version().into()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,6 @@ pub fn init(
|
|||
rendering_context.clone(),
|
||||
embedder_callbacks,
|
||||
window_callbacks.clone(),
|
||||
None,
|
||||
Default::default(),
|
||||
);
|
||||
|
||||
|
|
|
@ -130,7 +130,6 @@ pub fn init(
|
|||
rendering_context.clone(),
|
||||
embedder_callbacks,
|
||||
window_callbacks.clone(),
|
||||
None, /* user_agent */
|
||||
Default::default(),
|
||||
);
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@ use url::Url;
|
|||
#[cfg_attr(any(target_os = "android", target_env = "ohos"), allow(dead_code))]
|
||||
#[derive(Clone)]
|
||||
pub(crate) struct ServoShellPreferences {
|
||||
/// The user agent to use for servoshell.
|
||||
pub user_agent: Option<String>,
|
||||
/// A URL to load when starting servoshell.
|
||||
pub url: Option<String>,
|
||||
/// An override value for the device pixel ratio.
|
||||
|
@ -74,7 +72,6 @@ impl Default for ServoShellPreferences {
|
|||
searchpage: "https://duckduckgo.com/html/?q=%s".into(),
|
||||
tracing_filter: None,
|
||||
url: None,
|
||||
user_agent: None,
|
||||
output_image_path: None,
|
||||
exit_after_stable_image: false,
|
||||
userscripts_directory: None,
|
||||
|
@ -615,7 +612,6 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
|
|||
let exit_after_load = opt_match.opt_present("x") || output_image_path.is_some();
|
||||
let wait_for_stable_image = exit_after_load;
|
||||
let servoshell_preferences = ServoShellPreferences {
|
||||
user_agent: opt_match.opt_str("u"),
|
||||
url,
|
||||
no_native_titlebar,
|
||||
device_pixel_ratio_override,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue