diff options
author | Peter Hall <peterjoel@gmail.com> | 2019-02-14 12:53:59 +0000 |
---|---|---|
committer | Peter Hall <peterjoel@gmail.com> | 2019-03-20 15:01:26 +0000 |
commit | 8bfd4dc1e2f9c71ff3d1f9964565c43a6ae02278 (patch) | |
tree | 3e59f25c2588711f4185c6fbba16af293d1d3453 /components/constellation | |
parent | 34fda66dfa5528f2b10a873e9a67417c6986c712 (diff) | |
download | servo-8bfd4dc1e2f9c71ff3d1f9964565c43a6ae02278.tar.gz servo-8bfd4dc1e2f9c71ff3d1f9964565c43a6ae02278.zip |
#8539 Config preferences backend restructure
Diffstat (limited to 'components/constellation')
-rw-r--r-- | components/constellation/constellation.rs | 8 | ||||
-rw-r--r-- | components/constellation/pipeline.rs | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index e4120579912..9cd1008a177 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -150,8 +150,7 @@ use script_traits::{IFrameSizeMsg, WindowSizeData, WindowSizeType}; use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory}; use script_traits::{SWManagerMsg, ScopeThings, UpdatePipelineIdReason, WebDriverCommandMsg}; use serde::{Deserialize, Serialize}; -use servo_config::opts; -use servo_config::prefs::PREFS; +use servo_config::{opts, pref}; use servo_rand::{random, Rng, SeedableRng, ServoRng}; use servo_remutex::ReentrantMutex; use servo_url::{Host, ImmutableOrigin, ServoUrl}; @@ -3506,10 +3505,7 @@ where let pipelines_to_evict = { let session_history = self.get_joint_session_history(top_level_browsing_context_id); - let history_length = PREFS - .get("session-history.max-length") - .as_u64() - .unwrap_or(20) as usize; + let history_length = pref!(session_history.max_length) as usize; // The past is stored with older entries at the front. // We reverse the iter so that newer entries are at the front and then diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index be369c0c08e..71d3f0aea62 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -31,7 +31,7 @@ use script_traits::{LayoutControlMsg, LayoutMsg, LoadData}; use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders}; use script_traits::{ScriptThreadFactory, TimerSchedulerMsg, WindowSizeData}; use servo_config::opts::{self, Opts}; -use servo_config::prefs::{Pref, PREFS}; +use servo_config::{prefs, prefs::PrefValue}; use servo_url::ServoUrl; use std::collections::{HashMap, HashSet}; #[cfg(not(windows))] @@ -286,7 +286,7 @@ impl Pipeline { load_data: state.load_data.clone(), script_port: script_port, opts: (*opts::get()).clone(), - prefs: PREFS.cloned(), + prefs: prefs::pref_map().iter().collect(), pipeline_port: pipeline_port, pipeline_namespace_id: state.pipeline_namespace_id, layout_content_process_shutdown_chan: layout_content_process_shutdown_chan, @@ -482,7 +482,7 @@ pub struct UnprivilegedPipelineContent { load_data: LoadData, script_port: IpcReceiver<ConstellationControlMsg>, opts: Opts, - prefs: HashMap<String, Pref>, + prefs: HashMap<String, PrefValue>, pipeline_port: IpcReceiver<LayoutControlMsg>, pipeline_namespace_id: PipelineNamespaceId, layout_content_process_shutdown_chan: IpcSender<()>, @@ -681,7 +681,7 @@ impl UnprivilegedPipelineContent { self.opts.clone() } - pub fn prefs(&self) -> HashMap<String, Pref> { + pub fn prefs(&self) -> HashMap<String, PrefValue> { self.prefs.clone() } |