Share prefs to content processes

Without this `./mach run -b -- -M` would start fine but navigating to a site would fail with:

`thread 'ScriptThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(0) }' panicked at 'assertion failed: mozbrowser_enabled()', /Users/ulf/Documents/Code/servo/components/script/dom/htmliframeelement.rs:163`
This commit is contained in:
Ulf Nilsson 2016-04-09 12:55:24 +02:00
parent f9608022ca
commit d433fb01ed
3 changed files with 16 additions and 4 deletions

View file

@ -19,7 +19,7 @@ lazy_static! {
};
}
#[derive(PartialEq, Clone, Debug)]
#[derive(PartialEq, Clone, Debug, Deserialize, Serialize)]
pub enum PrefValue {
Boolean(bool),
String(String),
@ -83,7 +83,7 @@ impl ToJson for PrefValue {
}
}
#[derive(Debug)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum Pref {
NoDefault(Arc<PrefValue>),
WithDefault(Arc<PrefValue>, Option<Arc<PrefValue>>)
@ -157,6 +157,10 @@ pub fn read_prefs_from_file<T>(mut file: T)
Ok(prefs)
}
pub fn get_cloned() -> HashMap<String, Pref> {
PREFS.lock().unwrap().clone()
}
pub fn extend_prefs(extension: HashMap<String, Pref>) {
PREFS.lock().unwrap().extend(extension);
}