mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
constellation: Broadcast preference changes to all content processes (#38716)
Building on the preference observer work from #38649, we now automatically install an observer when multiprocess mode is enabled. This observer notifies the constellation of updated preferences, which in turn notifies each content process so the changes will be reflected into script/layout as expected. There's a unit test that verifies this works correctly by checking a preference-gated WebIDL property before and after the preference is toggled. Testing: New unit test added. Fixes: #35966 Depends on #38649. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
61692b26c2
commit
ed6bf196c9
16 changed files with 191 additions and 60 deletions
|
@ -31,6 +31,7 @@ net_traits = { workspace = true }
|
|||
pixels = { path = "../../pixels" }
|
||||
profile_traits = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
servo_config = { path = "../../config" }
|
||||
servo_url = { path = "../../url" }
|
||||
strum = { workspace = true }
|
||||
strum_macros = { workspace = true }
|
||||
|
|
|
@ -28,6 +28,7 @@ use ipc_channel::ipc::IpcSender;
|
|||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use profile_traits::mem::MemoryReportResult;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::prefs::PrefValue;
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
pub use structured_data::*;
|
||||
use strum_macros::IntoStaticStr;
|
||||
|
@ -102,6 +103,8 @@ pub enum EmbedderToConstellationMessage {
|
|||
SendImageKeysForPipeline(PipelineId, Vec<ImageKey>),
|
||||
/// Set WebDriver input event handled sender.
|
||||
SetWebDriverResponseSender(IpcSender<WebDriverCommandResponse>),
|
||||
/// A set of preferences were updated with the given new values.
|
||||
PreferencesUpdated(Vec<(&'static str, PrefValue)>),
|
||||
}
|
||||
|
||||
/// A description of a paint metric that is sent from the Servo renderer to the
|
||||
|
|
|
@ -35,6 +35,7 @@ net_traits = { workspace = true }
|
|||
pixels = { path = "../../pixels" }
|
||||
profile_traits = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
servo_config = { path = "../../config" }
|
||||
servo_url = { path = "../../url" }
|
||||
strum = { workspace = true, features = ["derive"] }
|
||||
strum_macros = { workspace = true }
|
||||
|
|
|
@ -43,6 +43,7 @@ use net_traits::storage_thread::StorageType;
|
|||
use pixels::PixelFormat;
|
||||
use profile_traits::mem;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::prefs::PrefValue;
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use strum_macros::IntoStaticStr;
|
||||
use style_traits::{CSSPixel, SpeculativePainter};
|
||||
|
@ -257,6 +258,8 @@ pub enum ScriptThreadMessage {
|
|||
EvaluateJavaScript(PipelineId, JavaScriptEvaluationId, String),
|
||||
/// A new batch of keys for the image cache for the specific pipeline.
|
||||
SendImageKeysBatch(PipelineId, Vec<ImageKey>),
|
||||
/// Preferences were updated in the parent process.
|
||||
PreferencesUpdated(Vec<(String, PrefValue)>),
|
||||
}
|
||||
|
||||
impl fmt::Debug for ScriptThreadMessage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue