mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -5,8 +5,7 @@
|
|||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::fs::{File, create_dir_all};
|
||||
use std::io::Write;
|
||||
use std::fs::create_dir_all;
|
||||
use std::iter::once;
|
||||
use std::mem::take;
|
||||
use std::rc::Rc;
|
||||
|
@ -114,10 +113,6 @@ pub struct ServoRenderer {
|
|||
/// The GL bindings for webrender
|
||||
webrender_gl: Rc<dyn gleam::gl::Gl>,
|
||||
|
||||
/// The string representing the version of Servo that is running. This is used to tag
|
||||
/// WebRender capture output.
|
||||
version_string: String,
|
||||
|
||||
#[cfg(feature = "webxr")]
|
||||
/// Some XR devices want to run on the main thread.
|
||||
webxr_main_thread: webxr::MainThreadRegistry,
|
||||
|
@ -429,7 +424,6 @@ impl IOCompositor {
|
|||
window: Rc<dyn WindowMethods>,
|
||||
state: InitialCompositorState,
|
||||
convert_mouse_to_touch: bool,
|
||||
version_string: String,
|
||||
) -> Self {
|
||||
let compositor = IOCompositor {
|
||||
global: Rc::new(RefCell::new(ServoRenderer {
|
||||
|
@ -441,7 +435,6 @@ impl IOCompositor {
|
|||
webrender_api: state.webrender_api,
|
||||
webrender_document: state.webrender_document,
|
||||
webrender_gl: state.webrender_gl,
|
||||
version_string,
|
||||
#[cfg(feature = "webxr")]
|
||||
webxr_main_thread: state.webxr_main_thread,
|
||||
convert_mouse_to_touch,
|
||||
|
@ -1773,13 +1766,6 @@ impl IOCompositor {
|
|||
.borrow()
|
||||
.webrender_api
|
||||
.save_capture(capture_path.clone(), CaptureBits::all());
|
||||
|
||||
let version_file_path = capture_path.join("servo-version.txt");
|
||||
if let Err(error) = File::create(version_file_path)
|
||||
.and_then(|mut file| write!(file, "{}", self.global.borrow().version_string))
|
||||
{
|
||||
eprintln!("Unable to write servo version for WebRender Capture: {error:?}");
|
||||
}
|
||||
}
|
||||
|
||||
fn add_font_instance(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue