Lines 38-47
diff --git dom/ipc/ContentChild.cpp dom/ipc/ContentChild.cpp
Link Here
|
38 |
index f61ab07b81e2..af1ef9cf4c7e 100644 |
38 |
index f61ab07b81e2..af1ef9cf4c7e 100644 |
39 |
--- dom/ipc/ContentChild.cpp |
39 |
--- dom/ipc/ContentChild.cpp |
40 |
+++ dom/ipc/ContentChild.cpp |
40 |
+++ dom/ipc/ContentChild.cpp |
41 |
@@ -1185,8 +1185,6 @@ void |
41 |
@@ -1094,8 +1094,6 @@ void ContentChild::InitGraphicsDeviceData(const Conten |
42 |
ContentChild::InitXPCOM(const XPCOMInitData& aXPCOMInit, |
42 |
void ContentChild::InitXPCOM( |
43 |
const mozilla::dom::ipc::StructuredCloneData& aInitialData) |
43 |
const XPCOMInitData& aXPCOMInit, |
44 |
{ |
44 |
const mozilla::dom::ipc::StructuredCloneData& aInitialData) { |
45 |
- Preferences::SetLatePreferences(&aXPCOMInit.prefs()); |
45 |
- Preferences::SetLatePreferences(&aXPCOMInit.prefs()); |
46 |
- |
46 |
- |
47 |
// Do this as early as possible to get the parent process to initialize the |
47 |
// Do this as early as possible to get the parent process to initialize the |
Lines 59-65
index 208bb47a970b..4ce5c6bf23d5 100644
Link Here
|
59 |
#include "mozilla/Sprintf.h" |
59 |
#include "mozilla/Sprintf.h" |
60 |
|
60 |
|
61 |
#ifdef MOZ_WEBRTC |
61 |
#ifdef MOZ_WEBRTC |
62 |
@@ -2009,7 +2008,7 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR |
62 |
@@ -1863,7 +1862,7 @@ bool ContentParent::LaunchSubprocess( |
63 |
|
63 |
|
64 |
// Serialize the early prefs. |
64 |
// Serialize the early prefs. |
65 |
nsAutoCStringN<1024> prefs; |
65 |
nsAutoCStringN<1024> prefs; |
Lines 68-74
index 208bb47a970b..4ce5c6bf23d5 100644
Link Here
|
68 |
|
68 |
|
69 |
// Set up the shared memory. |
69 |
// Set up the shared memory. |
70 |
base::SharedMemory shm; |
70 |
base::SharedMemory shm; |
71 |
@@ -2228,7 +2227,6 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority) |
71 |
@@ -2034,7 +2033,6 @@ void ContentParent::InitInternal(ProcessPriority aInit |
72 |
|
72 |
|
73 |
XPCOMInitData xpcomInit; |
73 |
XPCOMInitData xpcomInit; |
74 |
|
74 |
|
Lines 81-87
deleted file mode 100644
Link Here
|
81 |
index 808b797d9bee..000000000000 |
81 |
index 808b797d9bee..000000000000 |
82 |
--- dom/ipc/ContentPrefs.cpp |
82 |
--- dom/ipc/ContentPrefs.cpp |
83 |
+++ /dev/null |
83 |
+++ /dev/null |
84 |
@@ -1,362 +0,0 @@ |
84 |
@@ -1,360 +0,0 @@ |
85 |
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
85 |
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
86 |
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
86 |
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
87 |
-/* This Source Code Form is subject to the terms of the Mozilla Public |
87 |
-/* This Source Code Form is subject to the terms of the Mozilla Public |
Lines 103-446
index 808b797d9bee..000000000000
Link Here
|
103 |
- ******************************************************************************/ |
103 |
- ******************************************************************************/ |
104 |
- |
104 |
- |
105 |
-const char* mozilla::dom::ContentPrefs::gEarlyPrefs[] = { |
105 |
-const char* mozilla::dom::ContentPrefs::gEarlyPrefs[] = { |
106 |
- "accessibility.monoaudio.enable", |
106 |
- "accessibility.monoaudio.enable", |
107 |
- "accessibility.mouse_focuses_formcontrol", |
107 |
- "accessibility.mouse_focuses_formcontrol", |
108 |
- "accessibility.tabfocus_applies_to_xul", |
108 |
- "accessibility.tabfocus_applies_to_xul", |
109 |
- "app.update.channel", |
109 |
- "app.update.channel", |
110 |
- "browser.autofocus", |
110 |
- "browser.autofocus", |
111 |
- "browser.dom.window.dump.enabled", |
111 |
- "browser.dom.window.dump.enabled", |
112 |
- "browser.sessionhistory.max_entries", |
112 |
- "browser.sessionhistory.max_entries", |
113 |
- "browser.sessionhistory.max_total_viewers", |
113 |
- "browser.sessionhistory.max_total_viewers", |
114 |
-#if defined(NIGHTLY_BUILD) || defined(DEBUG) |
114 |
-#if defined(NIGHTLY_BUILD) || defined(DEBUG) |
115 |
- "browser.startup.record", |
115 |
- "browser.startup.record", |
116 |
-#endif |
116 |
-#endif |
117 |
-#if defined(ANDROID) |
117 |
-#if defined(ANDROID) |
118 |
- "consoleservice.logcat", |
118 |
- "consoleservice.logcat", |
119 |
-#endif |
119 |
-#endif |
120 |
- "content.cors.disable", |
120 |
- "content.cors.disable", |
121 |
- "content.cors.no_private_data", |
121 |
- "content.cors.no_private_data", |
122 |
- "content.notify.backoffcount", |
122 |
- "content.notify.backoffcount", |
123 |
- "content.notify.interval", |
123 |
- "content.notify.interval", |
124 |
- "content.notify.ontimer", |
124 |
- "content.notify.ontimer", |
125 |
- "content.sink.enable_perf_mode", |
125 |
- "content.sink.enable_perf_mode", |
126 |
- "content.sink.event_probe_rate", |
126 |
- "content.sink.event_probe_rate", |
127 |
- "content.sink.initial_perf_time", |
127 |
- "content.sink.initial_perf_time", |
128 |
- "content.sink.interactive_deflect_count", |
128 |
- "content.sink.interactive_deflect_count", |
129 |
- "content.sink.interactive_parse_time", |
129 |
- "content.sink.interactive_parse_time", |
130 |
- "content.sink.interactive_time", |
130 |
- "content.sink.interactive_time", |
131 |
- "content.sink.pending_event_mode", |
131 |
- "content.sink.pending_event_mode", |
132 |
- "content.sink.perf_deflect_count", |
132 |
- "content.sink.perf_deflect_count", |
133 |
- "content.sink.perf_parse_time", |
133 |
- "content.sink.perf_parse_time", |
134 |
- "device.storage.prompt.testing", |
134 |
- "device.storage.prompt.testing", |
135 |
- "device.storage.writable.name", |
135 |
- "device.storage.writable.name", |
136 |
- "devtools.enabled", |
136 |
- "devtools.enabled", |
137 |
- "dom.allow_XUL_XBL_for_file", |
137 |
- "dom.allow_XUL_XBL_for_file", |
138 |
- "dom.allow_cut_copy", |
138 |
- "dom.allow_cut_copy", |
139 |
- "dom.animations-api.core.enabled", |
139 |
- "dom.animations-api.core.enabled", |
140 |
- "dom.animations-api.element-animate.enabled", |
140 |
- "dom.animations-api.element-animate.enabled", |
141 |
- "dom.animations-api.pending-member.enabled", |
141 |
- "dom.animations-api.pending-member.enabled", |
142 |
- "dom.enable_frame_timing", |
142 |
- "dom.enable_frame_timing", |
143 |
- "dom.enable_performance", |
143 |
- "dom.enable_performance", |
144 |
- "dom.enable_performance_navigation_timing", |
144 |
- "dom.enable_performance_navigation_timing", |
145 |
- "dom.enable_resource_timing", |
145 |
- "dom.enable_resource_timing", |
146 |
- "dom.event.handling-user-input-time-limit", |
146 |
- "dom.event.handling-user-input-time-limit", |
147 |
- "dom.event.touch.coalescing.enabled", |
147 |
- "dom.event.touch.coalescing.enabled", |
148 |
- "dom.forms.autocomplete.formautofill", |
148 |
- "dom.forms.autocomplete.formautofill", |
149 |
- "dom.forms.inputmode", |
149 |
- "dom.forms.inputmode", |
150 |
- "dom.input.skip_cursor_move_for_same_value_set", |
150 |
- "dom.input.skip_cursor_move_for_same_value_set", |
151 |
- "dom.ipc.processPriorityManager.backgroundGracePeriodMS", |
151 |
- "dom.ipc.processPriorityManager.backgroundGracePeriodMS", |
152 |
- "dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS", |
152 |
- "dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS", |
153 |
- "dom.ipc.useNativeEventProcessing.content", |
153 |
- "dom.ipc.useNativeEventProcessing.content", |
154 |
- "dom.max_chrome_script_run_time", |
154 |
- "dom.max_chrome_script_run_time", |
155 |
- "dom.max_ext_content_script_run_time", |
155 |
- "dom.max_ext_content_script_run_time", |
156 |
- "dom.max_script_run_time", |
156 |
- "dom.max_script_run_time", |
157 |
- "dom.mozBrowserFramesEnabled", |
157 |
- "dom.mozBrowserFramesEnabled", |
158 |
- "dom.performance.enable_notify_performance_timing", |
158 |
- "dom.performance.enable_notify_performance_timing", |
159 |
- "dom.performance.enable_user_timing_logging", |
159 |
- "dom.performance.enable_user_timing_logging", |
160 |
- "dom.placeholder.show_on_focus", |
160 |
- "dom.placeholder.show_on_focus", |
161 |
- "dom.requestIdleCallback.enabled", |
161 |
- "dom.requestIdleCallback.enabled", |
162 |
- "dom.script_loader.bytecode_cache.enabled", |
162 |
- "dom.script_loader.bytecode_cache.enabled", |
163 |
- "dom.script_loader.bytecode_cache.strategy", |
163 |
- "dom.script_loader.bytecode_cache.strategy", |
164 |
- "dom.storage.testing", |
164 |
- "dom.storage.testing", |
165 |
- "dom.url.encode_decode_hash", |
165 |
- "dom.url.encode_decode_hash", |
166 |
- "dom.url.getters_decode_hash", |
166 |
- "dom.url.getters_decode_hash", |
167 |
- "dom.use_watchdog", |
167 |
- "dom.use_watchdog", |
168 |
- "dom.vibrator.enabled", |
168 |
- "dom.vibrator.enabled", |
169 |
- "dom.vibrator.max_vibrate_list_len", |
169 |
- "dom.vibrator.max_vibrate_list_len", |
170 |
- "dom.vibrator.max_vibrate_ms", |
170 |
- "dom.vibrator.max_vibrate_ms", |
171 |
- "dom.webcomponents.customelements.enabled", |
171 |
- "dom.webcomponents.customelements.enabled", |
172 |
- "dom.webcomponents.shadowdom.enabled", |
172 |
- "dom.webcomponents.shadowdom.enabled", |
173 |
- "focusmanager.testmode", |
173 |
- "focusmanager.testmode", |
174 |
- "font.size.inflation.disabledInMasterProcess", |
174 |
- "font.size.inflation.disabledInMasterProcess", |
175 |
- "font.size.inflation.emPerLine", |
175 |
- "font.size.inflation.emPerLine", |
176 |
- "font.size.inflation.forceEnabled", |
176 |
- "font.size.inflation.forceEnabled", |
177 |
- "font.size.inflation.lineThreshold", |
177 |
- "font.size.inflation.lineThreshold", |
178 |
- "font.size.inflation.mappingIntercept", |
178 |
- "font.size.inflation.mappingIntercept", |
179 |
- "font.size.inflation.maxRatio", |
179 |
- "font.size.inflation.maxRatio", |
180 |
- "font.size.inflation.minTwips", |
180 |
- "font.size.inflation.minTwips", |
181 |
- "font.size.systemFontScale", |
181 |
- "font.size.systemFontScale", |
182 |
- "full-screen-api.allow-trusted-requests-only", |
182 |
- "full-screen-api.allow-trusted-requests-only", |
183 |
- "full-screen-api.enabled", |
183 |
- "full-screen-api.enabled", |
184 |
- "full-screen-api.unprefix.enabled", |
184 |
- "full-screen-api.unprefix.enabled", |
185 |
-#ifdef FUZZING |
185 |
-#ifdef FUZZING |
186 |
- "fuzzing.enabled", |
186 |
- "fuzzing.enabled", |
187 |
-#endif |
187 |
-#endif |
188 |
- "gfx.font_rendering.opentype_svg.enabled", |
188 |
- "gfx.font_rendering.opentype_svg.enabled", |
189 |
- "hangmonitor.timeout", |
189 |
- "hangmonitor.timeout", |
190 |
- "html5.flushtimer.initialdelay", |
190 |
- "html5.flushtimer.initialdelay", |
191 |
- "html5.flushtimer.subsequentdelay", |
191 |
- "html5.flushtimer.subsequentdelay", |
192 |
- "html5.offmainthread", |
192 |
- "html5.offmainthread", |
193 |
- "intl.charset.fallback.tld", |
193 |
- "intl.charset.fallback.tld", |
194 |
- "intl.charset.fallback.utf8_for_file", |
194 |
- "intl.charset.fallback.utf8_for_file", |
195 |
- "intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", |
195 |
- "intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", |
196 |
- "javascript.enabled", |
196 |
- "javascript.enabled", |
197 |
- "javascript.options.array_prototype_values", |
197 |
- "javascript.options.array_prototype_values", |
198 |
- "javascript.options.asmjs", |
198 |
- "javascript.options.asmjs", |
199 |
- "javascript.options.asyncstack", |
199 |
- "javascript.options.asyncstack", |
200 |
- "javascript.options.baselinejit", |
200 |
- "javascript.options.baselinejit", |
201 |
- "javascript.options.baselinejit.threshold", |
201 |
- "javascript.options.baselinejit.threshold", |
202 |
- "javascript.options.baselinejit.unsafe_eager_compilation", |
202 |
- "javascript.options.baselinejit.unsafe_eager_compilation", |
203 |
- "javascript.options.discardSystemSource", |
203 |
- "javascript.options.discardSystemSource", |
204 |
- "javascript.options.dump_stack_on_debuggee_would_run", |
204 |
- "javascript.options.dump_stack_on_debuggee_would_run", |
205 |
- "javascript.options.gczeal", |
205 |
- "javascript.options.gczeal", |
206 |
- "javascript.options.gczeal.frequency", |
206 |
- "javascript.options.gczeal.frequency", |
207 |
- "javascript.options.ion", |
207 |
- "javascript.options.ion", |
208 |
- "javascript.options.ion.offthread_compilation", |
208 |
- "javascript.options.ion.offthread_compilation", |
209 |
- "javascript.options.ion.threshold", |
209 |
- "javascript.options.ion.threshold", |
210 |
- "javascript.options.ion.unsafe_eager_compilation", |
210 |
- "javascript.options.ion.unsafe_eager_compilation", |
211 |
- "javascript.options.jit.full_debug_checks", |
211 |
- "javascript.options.jit.full_debug_checks", |
212 |
- "javascript.options.native_regexp", |
212 |
- "javascript.options.native_regexp", |
213 |
- "javascript.options.parallel_parsing", |
213 |
- "javascript.options.parallel_parsing", |
214 |
- "javascript.options.shared_memory", |
214 |
- "javascript.options.shared_memory", |
215 |
- "javascript.options.spectre.index_masking", |
215 |
- "javascript.options.spectre.index_masking", |
216 |
- "javascript.options.spectre.jit_to_C++_calls", |
216 |
- "javascript.options.spectre.jit_to_C++_calls", |
217 |
- "javascript.options.spectre.object_mitigations.barriers", |
217 |
- "javascript.options.spectre.object_mitigations.barriers", |
218 |
- "javascript.options.spectre.object_mitigations.misc", |
218 |
- "javascript.options.spectre.object_mitigations.misc", |
219 |
- "javascript.options.spectre.string_mitigations", |
219 |
- "javascript.options.spectre.string_mitigations", |
220 |
- "javascript.options.spectre.value_masking", |
220 |
- "javascript.options.spectre.value_masking", |
221 |
- "javascript.options.streams", |
221 |
- "javascript.options.streams", |
222 |
- "javascript.options.strict", |
222 |
- "javascript.options.strict", |
223 |
- "javascript.options.strict.debug", |
223 |
- "javascript.options.strict.debug", |
224 |
- "javascript.options.throw_on_asmjs_validation_failure", |
224 |
- "javascript.options.throw_on_asmjs_validation_failure", |
225 |
- "javascript.options.throw_on_debuggee_would_run", |
225 |
- "javascript.options.throw_on_debuggee_would_run", |
226 |
- "javascript.options.wasm", |
226 |
- "javascript.options.wasm", |
227 |
- "javascript.options.wasm_baselinejit", |
227 |
- "javascript.options.wasm_baselinejit", |
228 |
- "javascript.options.wasm_ionjit", |
228 |
- "javascript.options.wasm_ionjit", |
229 |
- "javascript.options.werror", |
229 |
- "javascript.options.werror", |
230 |
- "javascript.use_us_english_locale", |
230 |
- "javascript.use_us_english_locale", |
231 |
- "jsloader.shareGlobal", |
231 |
- "jsloader.shareGlobal", |
232 |
- "layout.css.all-shorthand.enabled", |
232 |
- "layout.css.all-shorthand.enabled", |
233 |
- "layout.css.background-blend-mode.enabled", |
233 |
- "layout.css.background-blend-mode.enabled", |
234 |
- "layout.css.box-decoration-break.enabled", |
234 |
- "layout.css.box-decoration-break.enabled", |
235 |
- "layout.css.color-adjust.enabled", |
235 |
- "layout.css.color-adjust.enabled", |
236 |
- "layout.css.column-span.enabled", |
236 |
- "layout.css.column-span.enabled", |
237 |
- "layout.css.contain.enabled", |
237 |
- "layout.css.contain.enabled", |
238 |
- "layout.css.control-characters.visible", |
238 |
- "layout.css.control-characters.visible", |
239 |
- "layout.css.emulate-moz-box-with-flex", |
239 |
- "layout.css.emulate-moz-box-with-flex", |
240 |
- "layout.css.expensive-style-struct-assertions.enabled", |
240 |
- "layout.css.expensive-style-struct-assertions.enabled", |
241 |
- "layout.css.float-logical-values.enabled", |
241 |
- "layout.css.float-logical-values.enabled", |
242 |
- "layout.css.font-display.enabled", |
242 |
- "layout.css.font-display.enabled", |
243 |
- "layout.css.font-variations.enabled", |
243 |
- "layout.css.font-variations.enabled", |
244 |
- "layout.css.frames-timing.enabled", |
244 |
- "layout.css.frames-timing.enabled", |
245 |
- "layout.css.getBoxQuads.enabled", |
245 |
- "layout.css.getBoxQuads.enabled", |
246 |
- "layout.css.grid-template-subgrid-value.enabled", |
246 |
- "layout.css.grid-template-subgrid-value.enabled", |
247 |
- "layout.css.grid.enabled", |
247 |
- "layout.css.grid.enabled", |
248 |
- "layout.css.image-orientation.enabled", |
248 |
- "layout.css.image-orientation.enabled", |
249 |
- "layout.css.individual-transform.enabled", |
249 |
- "layout.css.individual-transform.enabled", |
250 |
- "layout.css.initial-letter.enabled", |
250 |
- "layout.css.initial-letter.enabled", |
251 |
- "layout.css.isolation.enabled", |
251 |
- "layout.css.isolation.enabled", |
252 |
- "layout.css.mix-blend-mode.enabled", |
252 |
- "layout.css.mix-blend-mode.enabled", |
253 |
- "layout.css.moz-document.content.enabled", |
253 |
- "layout.css.moz-document.content.enabled", |
254 |
- "layout.css.osx-font-smoothing.enabled", |
254 |
- "layout.css.osx-font-smoothing.enabled", |
255 |
- "layout.css.overflow-clip-box.enabled", |
255 |
- "layout.css.overflow-clip-box.enabled", |
256 |
- "layout.css.overscroll-behavior.enabled", |
256 |
- "layout.css.overscroll-behavior.enabled", |
257 |
- "layout.css.prefixes.animations", |
257 |
- "layout.css.prefixes.animations", |
258 |
- "layout.css.prefixes.border-image", |
258 |
- "layout.css.prefixes.border-image", |
259 |
- "layout.css.prefixes.box-sizing", |
259 |
- "layout.css.prefixes.box-sizing", |
260 |
- "layout.css.prefixes.device-pixel-ratio-webkit", |
260 |
- "layout.css.prefixes.device-pixel-ratio-webkit", |
261 |
- "layout.css.prefixes.font-features", |
261 |
- "layout.css.prefixes.font-features", |
262 |
- "layout.css.prefixes.gradients", |
262 |
- "layout.css.prefixes.gradients", |
263 |
- "layout.css.prefixes.transforms", |
263 |
- "layout.css.prefixes.transforms", |
264 |
- "layout.css.prefixes.transitions", |
264 |
- "layout.css.prefixes.transitions", |
265 |
- "layout.css.prefixes.webkit", |
265 |
- "layout.css.prefixes.webkit", |
266 |
- "layout.css.scope-pseudo.enabled", |
266 |
- "layout.css.scope-pseudo.enabled", |
267 |
- "layout.css.scoped-style.enabled", |
267 |
- "layout.css.scoped-style.enabled", |
268 |
- "layout.css.scroll-behavior.property-enabled", |
268 |
- "layout.css.scroll-behavior.property-enabled", |
269 |
- "layout.css.scroll-snap.enabled", |
269 |
- "layout.css.scroll-snap.enabled", |
270 |
-#ifdef MOZ_STYLO |
270 |
-#ifdef MOZ_STYLO |
271 |
- "layout.css.servo.chrome.enabled", |
271 |
- "layout.css.servo.chrome.enabled", |
272 |
- "layout.css.servo.enabled", |
272 |
- "layout.css.servo.enabled", |
273 |
-#endif |
273 |
-#endif |
274 |
- "layout.css.shape-outside.enabled", |
274 |
- "layout.css.shape-outside.enabled", |
275 |
- "layout.css.text-align-unsafe-value.enabled", |
275 |
- "layout.css.text-align-unsafe-value.enabled", |
276 |
- "layout.css.text-combine-upright-digits.enabled", |
276 |
- "layout.css.text-combine-upright-digits.enabled", |
277 |
- "layout.css.text-combine-upright.enabled", |
277 |
- "layout.css.text-combine-upright.enabled", |
278 |
- "layout.css.text-justify.enabled", |
278 |
- "layout.css.text-justify.enabled", |
279 |
- "layout.css.touch_action.enabled", |
279 |
- "layout.css.touch_action.enabled", |
280 |
- "layout.css.visited_links_enabled", |
280 |
- "layout.css.visited_links_enabled", |
281 |
- "layout.idle_period.required_quiescent_frames", |
281 |
- "layout.idle_period.required_quiescent_frames", |
282 |
- "layout.idle_period.time_limit", |
282 |
- "layout.idle_period.time_limit", |
283 |
- "layout.interruptible-reflow.enabled", |
283 |
- "layout.interruptible-reflow.enabled", |
284 |
- "mathml.disabled", |
284 |
- "mathml.disabled", |
285 |
- "media.audio-max-decode-error", |
285 |
- "media.audio-max-decode-error", |
286 |
- "media.cache_readahead_limit", |
286 |
- "media.cache_readahead_limit", |
287 |
- "media.cache_resume_threshold", |
287 |
- "media.cache_resume_threshold", |
288 |
- "media.cache_size", |
288 |
- "media.cache_size", |
289 |
- "media.clearkey.persistent-license.enabled", |
289 |
- "media.clearkey.persistent-license.enabled", |
290 |
- "media.cubeb.backend", |
290 |
- "media.cubeb.backend", |
291 |
- "media.cubeb.sandbox", |
291 |
- "media.cubeb.sandbox", |
292 |
- "media.cubeb_latency_msg_frames", |
292 |
- "media.cubeb_latency_msg_frames", |
293 |
- "media.cubeb_latency_playback_ms", |
293 |
- "media.cubeb_latency_playback_ms", |
294 |
- "media.decoder-doctor.wmf-disabled-is-failure", |
294 |
- "media.decoder-doctor.wmf-disabled-is-failure", |
295 |
- "media.decoder.recycle.enabled", |
295 |
- "media.decoder.recycle.enabled", |
296 |
- "media.decoder.skip-to-next-key-frame.enabled", |
296 |
- "media.decoder.skip-to-next-key-frame.enabled", |
297 |
- "media.dormant-on-pause-timeout-ms", |
297 |
- "media.dormant-on-pause-timeout-ms", |
298 |
- "media.eme.audio.blank", |
298 |
- "media.eme.audio.blank", |
299 |
- "media.eme.chromium-api.video-shmems", |
299 |
- "media.eme.chromium-api.video-shmems", |
300 |
- "media.eme.enabled", |
300 |
- "media.eme.enabled", |
301 |
- "media.eme.video.blank", |
301 |
- "media.eme.video.blank", |
302 |
- "media.ffmpeg.enabled", |
302 |
- "media.ffmpeg.enabled", |
303 |
- "media.ffmpeg.low-latency.enabled", |
303 |
- "media.ffmpeg.low-latency.enabled", |
304 |
- "media.ffvpx.enabled", |
304 |
- "media.ffvpx.enabled", |
305 |
- "media.ffvpx.low-latency.enabled", |
305 |
- "media.ffvpx.low-latency.enabled", |
306 |
- "media.flac.enabled", |
306 |
- "media.flac.enabled", |
307 |
- "media.forcestereo.enabled", |
307 |
- "media.forcestereo.enabled", |
308 |
- "media.gmp.decoder.enabled", |
308 |
- "media.gmp.decoder.enabled", |
309 |
- "media.gmp.insecure.allow", |
309 |
- "media.gmp.insecure.allow", |
310 |
- "media.gpu-process-decoder", |
310 |
- "media.gpu-process-decoder", |
311 |
- "media.hls.enabled", |
311 |
- "media.hls.enabled", |
312 |
- "media.libavcodec.allow-obsolete", |
312 |
- "media.libavcodec.allow-obsolete", |
313 |
- "media.memory_cache_max_size", |
313 |
- "media.memory_cache_max_size", |
314 |
- "media.memory_caches_combined_limit_kb", |
314 |
- "media.memory_caches_combined_limit_kb", |
315 |
- "media.memory_caches_combined_limit_pc_sysmem", |
315 |
- "media.memory_caches_combined_limit_pc_sysmem", |
316 |
- "media.mp4.enabled", |
316 |
- "media.mp4.enabled", |
317 |
- "media.navigator.mediadatadecoder_enabled", |
317 |
- "media.navigator.mediadatadecoder_enabled", |
318 |
- "media.ogg.enabled", |
318 |
- "media.ogg.enabled", |
319 |
- "media.ogg.flac.enabled", |
319 |
- "media.ogg.flac.enabled", |
320 |
- "media.playback.warnings-as-errors", |
320 |
- "media.playback.warnings-as-errors", |
321 |
- "media.playback.warnings-as-errors.stagefright-vs-rust", |
321 |
- "media.playback.warnings-as-errors.stagefright-vs-rust", |
322 |
- "media.resampling.enabled", |
322 |
- "media.resampling.enabled", |
323 |
- "media.resume-bkgnd-video-on-tabhover", |
323 |
- "media.resume-bkgnd-video-on-tabhover", |
324 |
- "media.ruin-av-sync.enabled", |
324 |
- "media.ruin-av-sync.enabled", |
325 |
- "media.rust.mp4parser", |
325 |
- "media.rust.mp4parser", |
326 |
- "media.rust.test_mode", |
326 |
- "media.rust.test_mode", |
327 |
- "media.seamless-looping", |
327 |
- "media.seamless-looping", |
328 |
- "media.suspend-bkgnd-video.delay-ms", |
328 |
- "media.suspend-bkgnd-video.delay-ms", |
329 |
- "media.suspend-bkgnd-video.enabled", |
329 |
- "media.suspend-bkgnd-video.enabled", |
330 |
- "media.use-blank-decoder", |
330 |
- "media.use-blank-decoder", |
331 |
- "media.video-max-decode-error", |
331 |
- "media.video-max-decode-error", |
332 |
- "media.video_stats.enabled", |
332 |
- "media.video_stats.enabled", |
333 |
- "media.videocontrols.lock-video-orientation", |
333 |
- "media.videocontrols.lock-video-orientation", |
334 |
- "media.volume_scale", |
334 |
- "media.volume_scale", |
335 |
- "media.webspeech.recognition.enable", |
335 |
- "media.webspeech.recognition.enable", |
336 |
- "media.webspeech.recognition.force_enable", |
336 |
- "media.webspeech.recognition.force_enable", |
337 |
- "media.webspeech.synth.force_global_queue", |
337 |
- "media.webspeech.synth.force_global_queue", |
338 |
- "media.webspeech.test.enable", |
338 |
- "media.webspeech.test.enable", |
339 |
- "media.webspeech.test.fake_fsm_events", |
339 |
- "media.webspeech.test.fake_fsm_events", |
340 |
- "media.webspeech.test.fake_recognition_service", |
340 |
- "media.webspeech.test.fake_recognition_service", |
341 |
- "media.wmf.allow-unsupported-resolutions", |
341 |
- "media.wmf.allow-unsupported-resolutions", |
342 |
- "media.wmf.enabled", |
342 |
- "media.wmf.enabled", |
343 |
- "media.wmf.skip-blacklist", |
343 |
- "media.wmf.skip-blacklist", |
344 |
- "media.wmf.vp9.enabled", |
344 |
- "media.wmf.vp9.enabled", |
345 |
- "network.IDN.blacklist_chars", |
345 |
- "network.IDN.blacklist_chars", |
346 |
- "network.IDN.restriction_profile", |
346 |
- "network.IDN.restriction_profile", |
347 |
- "network.IDN.use_whitelist", |
347 |
- "network.IDN.use_whitelist", |
348 |
- "network.IDN_show_punycode", |
348 |
- "network.IDN_show_punycode", |
349 |
- "network.buffer.cache.count", |
349 |
- "network.buffer.cache.count", |
350 |
- "network.buffer.cache.size", |
350 |
- "network.buffer.cache.size", |
351 |
- "network.captive-portal-service.enabled", |
351 |
- "network.captive-portal-service.enabled", |
352 |
- "network.cookie.cookieBehavior", |
352 |
- "network.cookie.cookieBehavior", |
353 |
- "network.cookie.lifetimePolicy", |
353 |
- "network.cookie.lifetimePolicy", |
354 |
- "network.dns.disablePrefetch", |
354 |
- "network.dns.disablePrefetch", |
355 |
- "network.dns.disablePrefetchFromHTTPS", |
355 |
- "network.dns.disablePrefetchFromHTTPS", |
356 |
- "network.file.disable_unc_paths", |
356 |
- "network.file.disable_unc_paths", |
357 |
- "network.file.path_blacklist", |
357 |
- "network.file.path_blacklist", |
358 |
- "network.http.tailing.enabled", |
358 |
- "network.http.tailing.enabled", |
359 |
- "network.jar.block-remote-files", |
359 |
- "network.jar.block-remote-files", |
360 |
- "network.loadinfo.skip_type_assertion", |
360 |
- "network.loadinfo.skip_type_assertion", |
361 |
- "network.notify.changed", |
361 |
- "network.notify.changed", |
362 |
- "network.offline-mirrors-connectivity", |
362 |
- "network.offline-mirrors-connectivity", |
363 |
- "network.protocol-handler.external.jar", |
363 |
- "network.protocol-handler.external.jar", |
364 |
- "network.proxy.type", |
364 |
- "network.proxy.type", |
365 |
- "network.security.ports.banned", |
365 |
- "network.security.ports.banned", |
366 |
- "network.security.ports.banned.override", |
366 |
- "network.security.ports.banned.override", |
367 |
- "network.standard-url.enable-rust", |
367 |
- "network.standard-url.enable-rust", |
368 |
- "network.standard-url.max-length", |
368 |
- "network.standard-url.max-length", |
369 |
- "network.standard-url.punycode-host", |
369 |
- "network.standard-url.punycode-host", |
370 |
- "network.sts.max_time_for_events_between_two_polls", |
370 |
- "network.sts.max_time_for_events_between_two_polls", |
371 |
- "network.sts.max_time_for_pr_close_during_shutdown", |
371 |
- "network.sts.max_time_for_pr_close_during_shutdown", |
372 |
- "network.tcp.keepalive.enabled", |
372 |
- "network.tcp.keepalive.enabled", |
373 |
- "network.tcp.keepalive.idle_time", |
373 |
- "network.tcp.keepalive.idle_time", |
374 |
- "network.tcp.keepalive.probe_count", |
374 |
- "network.tcp.keepalive.probe_count", |
375 |
- "network.tcp.keepalive.retry_interval", |
375 |
- "network.tcp.keepalive.retry_interval", |
376 |
- "network.tcp.sendbuffer", |
376 |
- "network.tcp.sendbuffer", |
377 |
- "nglayout.debug.invalidation", |
377 |
- "nglayout.debug.invalidation", |
378 |
- "privacy.donottrackheader.enabled", |
378 |
- "privacy.donottrackheader.enabled", |
379 |
- "privacy.firstparty.isolate", |
379 |
- "privacy.firstparty.isolate", |
380 |
- "privacy.firstparty.isolate.restrict_opener_access", |
380 |
- "privacy.firstparty.isolate.restrict_opener_access", |
381 |
- "privacy.reduceTimerPrecision", |
381 |
- "privacy.reduceTimerPrecision", |
382 |
- "privacy.resistFingerprinting", |
382 |
- "privacy.resistFingerprinting", |
383 |
- "privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts", |
383 |
- "privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts", |
384 |
- "privacy.resistFingerprinting.reduceTimerPrecision.jitter", |
384 |
- "privacy.resistFingerprinting.reduceTimerPrecision.jitter", |
385 |
- "privacy.resistFingerprinting.reduceTimerPrecision.microseconds", |
385 |
- "privacy.resistFingerprinting.reduceTimerPrecision.microseconds", |
386 |
- "privacy.resistFingerprinting.target_video_res", |
386 |
- "privacy.resistFingerprinting.target_video_res", |
387 |
- "privacy.resistFingerprinting.video_dropped_ratio", |
387 |
- "privacy.resistFingerprinting.video_dropped_ratio", |
388 |
- "privacy.resistFingerprinting.video_frames_per_sec", |
388 |
- "privacy.resistFingerprinting.video_frames_per_sec", |
389 |
- "privacy.trackingprotection.lower_network_priority", |
389 |
- "privacy.spoof_english", |
390 |
- "privacy.window.maxInnerHeight", |
390 |
- "privacy.trackingprotection.lower_network_priority", |
391 |
- "privacy.window.maxInnerWidth", |
391 |
- "privacy.window.maxInnerHeight", |
392 |
- "security.csp.enable", |
392 |
- "privacy.window.maxInnerWidth", |
393 |
- "security.data_uri.block_toplevel_data_uri_navigations", |
393 |
- "security.csp.enable", |
394 |
- "security.data_uri.unique_opaque_origin", |
394 |
- "security.data_uri.block_toplevel_data_uri_navigations", |
395 |
- "security.fileuri.strict_origin_policy", |
395 |
- "security.data_uri.unique_opaque_origin", |
396 |
- "security.mixed_content.block_active_content", |
396 |
- "security.fileuri.strict_origin_policy", |
397 |
- "security.mixed_content.block_display_content", |
397 |
- "security.mixed_content.block_active_content", |
398 |
- "security.mixed_content.block_object_subrequest", |
398 |
- "security.mixed_content.block_display_content", |
399 |
- "security.mixed_content.hsts_priming_cache_timeout", |
399 |
- "security.mixed_content.block_object_subrequest", |
400 |
- "security.mixed_content.send_hsts_priming", |
400 |
- "security.mixed_content.hsts_priming_cache_timeout", |
401 |
- "security.mixed_content.upgrade_display_content", |
401 |
- "security.mixed_content.send_hsts_priming", |
402 |
- "security.mixed_content.use_hsts", |
402 |
- "security.mixed_content.upgrade_display_content", |
403 |
- "security.sandbox.content.level", |
403 |
- "security.mixed_content.use_hsts", |
404 |
- "security.sandbox.content.tempDirSuffix", |
404 |
- "security.sandbox.content.level", |
405 |
- "security.sandbox.logging.enabled", |
405 |
- "security.sandbox.content.tempDirSuffix", |
406 |
- "security.sandbox.mac.track.violations", |
406 |
- "security.sandbox.logging.enabled", |
407 |
- "security.sandbox.windows.log.stackTraceDepth", |
407 |
- "security.sandbox.mac.track.violations", |
408 |
- "svg.disabled", |
408 |
- "security.sandbox.windows.log.stackTraceDepth", |
409 |
- "svg.display-lists.hit-testing.enabled", |
409 |
- "svg.disabled", |
410 |
- "svg.display-lists.painting.enabled", |
410 |
- "svg.display-lists.hit-testing.enabled", |
411 |
- "svg.new-getBBox.enabled", |
411 |
- "svg.display-lists.painting.enabled", |
412 |
- "svg.path-caching.enabled", |
412 |
- "svg.new-getBBox.enabled", |
413 |
- "svg.transform-box.enabled", |
413 |
- "svg.path-caching.enabled", |
414 |
- "toolkit.asyncshutdown.crash_timeout", |
414 |
- "svg.transform-box.enabled", |
415 |
- "toolkit.asyncshutdown.log", |
415 |
- "toolkit.asyncshutdown.crash_timeout", |
416 |
- "toolkit.osfile.log", |
416 |
- "toolkit.asyncshutdown.log", |
417 |
- "toolkit.osfile.log.redirect", |
417 |
- "toolkit.osfile.log", |
418 |
- "toolkit.telemetry.enabled", |
418 |
- "toolkit.osfile.log.redirect", |
419 |
- "toolkit.telemetry.idleTimeout", |
419 |
- "toolkit.telemetry.enabled", |
420 |
- "toolkit.telemetry.initDelay", |
420 |
- "toolkit.telemetry.idleTimeout", |
421 |
- "toolkit.telemetry.log.dump", |
421 |
- "toolkit.telemetry.initDelay", |
422 |
- "toolkit.telemetry.log.level", |
422 |
- "toolkit.telemetry.log.dump", |
423 |
- "toolkit.telemetry.minSubsessionLength", |
423 |
- "toolkit.telemetry.log.level", |
424 |
- "toolkit.telemetry.scheduler.idleTickInterval", |
424 |
- "toolkit.telemetry.minSubsessionLength", |
425 |
- "toolkit.telemetry.scheduler.tickInterval", |
425 |
- "toolkit.telemetry.scheduler.idleTickInterval", |
426 |
- "toolkit.telemetry.testing.overridePreRelease", |
426 |
- "toolkit.telemetry.scheduler.tickInterval", |
427 |
- "toolkit.telemetry.unified", |
427 |
- "toolkit.telemetry.testing.overridePreRelease", |
428 |
- "ui.key.menuAccessKeyFocuses", |
428 |
- "toolkit.telemetry.unified", |
429 |
- "ui.popup.disable_autohide", |
429 |
- "ui.key.menuAccessKeyFocuses", |
430 |
- "ui.use_activity_cursor", |
430 |
- "ui.popup.disable_autohide", |
431 |
- "view_source.editor.external", |
431 |
- "ui.use_activity_cursor", |
432 |
- "zoom.maxPercent", |
432 |
- "view_source.editor.external", |
433 |
- "zoom.minPercent" |
433 |
- "zoom.maxPercent", |
434 |
-}; |
434 |
- "zoom.minPercent"}; |
435 |
- |
435 |
- |
436 |
-const char** mozilla::dom::ContentPrefs::GetEarlyPrefs(size_t* aCount) |
436 |
-const char** mozilla::dom::ContentPrefs::GetEarlyPrefs(size_t* aCount) { |
437 |
-{ |
|
|
438 |
- *aCount = ArrayLength(ContentPrefs::gEarlyPrefs); |
437 |
- *aCount = ArrayLength(ContentPrefs::gEarlyPrefs); |
439 |
- return gEarlyPrefs; |
438 |
- return gEarlyPrefs; |
440 |
-} |
439 |
-} |
441 |
- |
440 |
- |
442 |
-const char* mozilla::dom::ContentPrefs::GetEarlyPref(size_t aIndex) |
441 |
-const char* mozilla::dom::ContentPrefs::GetEarlyPref(size_t aIndex) { |
443 |
-{ |
|
|
444 |
- MOZ_ASSERT(aIndex < ArrayLength(ContentPrefs::gEarlyPrefs)); |
442 |
- MOZ_ASSERT(aIndex < ArrayLength(ContentPrefs::gEarlyPrefs)); |
445 |
- return gEarlyPrefs[aIndex]; |
443 |
- return gEarlyPrefs[aIndex]; |
446 |
-} |
444 |
-} |
Lines 465-480
index 72ce8d236c11..000000000000
Link Here
|
465 |
-namespace dom { |
463 |
-namespace dom { |
466 |
- |
464 |
- |
467 |
-class ContentPrefs { |
465 |
-class ContentPrefs { |
468 |
-public: |
466 |
- public: |
469 |
- static const char** GetEarlyPrefs(size_t* aCount); |
467 |
- static const char** GetEarlyPrefs(size_t* aCount); |
470 |
- static const char* GetEarlyPref(size_t aIndex); |
468 |
- static const char* GetEarlyPref(size_t aIndex); |
471 |
- |
469 |
- |
472 |
-private: |
470 |
- private: |
473 |
- static const char* gEarlyPrefs[]; |
471 |
- static const char* gEarlyPrefs[]; |
474 |
-}; |
472 |
-}; |
475 |
- |
473 |
- |
476 |
-} |
474 |
-} // namespace dom |
477 |
-} |
475 |
-} // namespace mozilla |
478 |
- |
476 |
- |
479 |
-#endif |
477 |
-#endif |
480 |
diff --git dom/ipc/ContentProcess.cpp dom/ipc/ContentProcess.cpp |
478 |
diff --git dom/ipc/ContentProcess.cpp dom/ipc/ContentProcess.cpp |
Lines 489-495
index 2441c8cb9224..c00283dc5084 100644
Link Here
|
489 |
#include "base/shared_memory.h" |
487 |
#include "base/shared_memory.h" |
490 |
#include "mozilla/Preferences.h" |
488 |
#include "mozilla/Preferences.h" |
491 |
#include "mozilla/Scheduler.h" |
489 |
#include "mozilla/Scheduler.h" |
492 |
@@ -226,8 +225,8 @@ ContentProcess::Init(int aArgc, char* aArgv[]) |
490 |
@@ -212,8 +211,8 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) { |
493 |
NS_ERROR("failed to map shared memory in the child"); |
491 |
NS_ERROR("failed to map shared memory in the child"); |
494 |
return false; |
492 |
return false; |
495 |
} |
493 |
} |
Lines 499-505
index 2441c8cb9224..c00283dc5084 100644
Link Here
|
499 |
+ prefsLen); |
497 |
+ prefsLen); |
500 |
|
498 |
|
501 |
Scheduler::SetPrefs(schedulerPrefs); |
499 |
Scheduler::SetPrefs(schedulerPrefs); |
502 |
mContent.Init(IOThreadChild::message_loop(), |
500 |
mContent.Init(IOThreadChild::message_loop(), ParentPid(), |
503 |
diff --git dom/ipc/PContent.ipdl dom/ipc/PContent.ipdl |
501 |
diff --git dom/ipc/PContent.ipdl dom/ipc/PContent.ipdl |
504 |
index 5d077976569a..fb967ffc53a9 100644 |
502 |
index 5d077976569a..fb967ffc53a9 100644 |
505 |
--- dom/ipc/PContent.ipdl |
503 |
--- dom/ipc/PContent.ipdl |
Lines 549-555
diff --git layout/style/nsCSSProps.h layout/style/nsCSSProps.h
Link Here
|
549 |
index dce44bf61b35..80288336a08b 100644 |
547 |
index dce44bf61b35..80288336a08b 100644 |
550 |
--- layout/style/nsCSSProps.h |
548 |
--- layout/style/nsCSSProps.h |
551 |
+++ layout/style/nsCSSProps.h |
549 |
+++ layout/style/nsCSSProps.h |
552 |
@@ -645,7 +645,7 @@ public: |
550 |
@@ -640,7 +640,7 @@ class nsCSSProps { |
553 |
// In the child process, assert that we're not trying to parse stylesheets |
551 |
// In the child process, assert that we're not trying to parse stylesheets |
554 |
// before we've gotten all our prefs. |
552 |
// before we've gotten all our prefs. |
555 |
MOZ_ASSERT_IF(!XRE_IsParentProcess(), |
553 |
MOZ_ASSERT_IF(!XRE_IsParentProcess(), |
Lines 570-612
index fe780686f2eb..488095f49236 100644
Link Here
|
570 |
#include "mozilla/dom/PContent.h" |
568 |
#include "mozilla/dom/PContent.h" |
571 |
#include "mozilla/HashFunctions.h" |
569 |
#include "mozilla/HashFunctions.h" |
572 |
#include "mozilla/Logging.h" |
570 |
#include "mozilla/Logging.h" |
573 |
@@ -131,6 +130,29 @@ enum class PrefType : uint8_t |
571 |
@@ -129,6 +128,25 @@ enum class PrefType : uint8_t { |
574 |
Bool = 3, |
572 |
Bool = 3, |
575 |
}; |
573 |
}; |
576 |
|
574 |
|
577 |
+// This is used for pref names and string pref values. We encode the string |
575 |
+// This is used for pref names and string pref values. We encode the string |
578 |
+// length, then a '/', then the string chars. This encoding means there are no |
576 |
+// length, then a '/', then the string chars. This encoding means there are no |
579 |
+// special chars that are forbidden or require escaping. |
577 |
+// special chars that are forbidden or require escaping. |
580 |
+static void |
578 |
+static void SerializeAndAppendString(const char* aChars, nsCString& aStr) { |
581 |
+SerializeAndAppendString(const char* aChars, nsCString& aStr) |
|
|
582 |
+{ |
583 |
+ aStr.AppendInt(uint32_t(strlen(aChars))); |
579 |
+ aStr.AppendInt(uint32_t(strlen(aChars))); |
584 |
+ aStr.Append('/'); |
580 |
+ aStr.Append('/'); |
585 |
+ aStr.Append(aChars); |
581 |
+ aStr.Append(aChars); |
586 |
+} |
582 |
+} |
587 |
+ |
583 |
+ |
588 |
+static char* |
584 |
+static char* DeserializeString(char* aChars, nsCString& aStr) { |
589 |
+DeserializeString(char* aChars, nsCString& aStr) |
|
|
590 |
+{ |
591 |
+ char* p = aChars; |
585 |
+ char* p = aChars; |
592 |
+ uint32_t length = strtol(p, &p, 10); |
586 |
+ uint32_t length = strtol(p, &p, 10); |
593 |
+ MOZ_ASSERT(p[0] == '/'); |
587 |
+ MOZ_ASSERT(p[0] == '/'); |
594 |
+ p++; // move past the '/' |
588 |
+ p++; // move past the '/' |
595 |
+ aStr.Assign(p, length); |
589 |
+ aStr.Assign(p, length); |
596 |
+ p += length; // move past the string itself |
590 |
+ p += length; // move past the string itself |
597 |
+ return p; |
591 |
+ return p; |
598 |
+} |
592 |
+} |
599 |
+ |
593 |
+ |
600 |
// Keep this in sync with PrefValue in prefs_parser/src/lib.rs. |
594 |
// Keep this in sync with PrefValue in prefs_parser/src/lib.rs. |
601 |
union PrefValue { |
595 |
union PrefValue { |
602 |
const char* mStringVal; |
596 |
const char* mStringVal; |
603 |
@@ -223,6 +245,64 @@ union PrefValue { |
597 |
@@ -215,6 +233,61 @@ union PrefValue { |
604 |
MOZ_CRASH(); |
598 |
MOZ_CRASH(); |
605 |
} |
599 |
} |
606 |
} |
600 |
} |
607 |
+ |
601 |
+ |
608 |
+ void SerializeAndAppend(PrefType aType, nsCString& aStr) |
602 |
+ void SerializeAndAppend(PrefType aType, nsCString& aStr) { |
609 |
+ { |
|
|
610 |
+ switch (aType) { |
603 |
+ switch (aType) { |
611 |
+ case PrefType::Bool: |
604 |
+ case PrefType::Bool: |
612 |
+ aStr.Append(mBoolVal ? 'T' : 'F'); |
605 |
+ aStr.Append(mBoolVal ? 'T' : 'F'); |
Lines 627-636
index fe780686f2eb..488095f49236 100644
Link Here
|
627 |
+ } |
620 |
+ } |
628 |
+ } |
621 |
+ } |
629 |
+ |
622 |
+ |
630 |
+ static char* Deserialize(PrefType aType, |
623 |
+ static char* Deserialize(PrefType aType, char* aStr, |
631 |
+ char* aStr, |
624 |
+ dom::MaybePrefValue* aDomValue) { |
632 |
+ dom::MaybePrefValue* aDomValue) |
|
|
633 |
+ { |
634 |
+ char* p = aStr; |
625 |
+ char* p = aStr; |
635 |
+ |
626 |
+ |
636 |
+ switch (aType) { |
627 |
+ switch (aType) { |
Lines 665-671
index fe780686f2eb..488095f49236 100644
Link Here
|
665 |
}; |
656 |
}; |
666 |
|
657 |
|
667 |
#ifdef DEBUG |
658 |
#ifdef DEBUG |
668 |
@@ -694,6 +774,159 @@ public: |
659 |
@@ -656,6 +729,157 @@ class Pref { |
669 |
return false; |
660 |
return false; |
670 |
} |
661 |
} |
671 |
|
662 |
|
Lines 721-728
index fe780686f2eb..488095f49236 100644
Link Here
|
721 |
+ // - "S-:10/my.string2:5/1.234:\n" |
712 |
+ // - "S-:10/my.string2:5/1.234:\n" |
722 |
+ // - "S-:10/my.string3::7/string!\n" |
713 |
+ // - "S-:10/my.string3::7/string!\n" |
723 |
+ |
714 |
+ |
724 |
+ void SerializeAndAppend(nsCString& aStr) |
715 |
+ void SerializeAndAppend(nsCString& aStr) { |
725 |
+ { |
|
|
726 |
+ switch (Type()) { |
716 |
+ switch (Type()) { |
727 |
+ case PrefType::Bool: |
717 |
+ case PrefType::Bool: |
728 |
+ aStr.Append('B'); |
718 |
+ aStr.Append('B'); |
Lines 759-766
index fe780686f2eb..488095f49236 100644
Link Here
|
759 |
+ aStr.Append('\n'); |
749 |
+ aStr.Append('\n'); |
760 |
+ } |
750 |
+ } |
761 |
+ |
751 |
+ |
762 |
+ static char* Deserialize(char* aStr, dom::Pref* aDomPref) |
752 |
+ static char* Deserialize(char* aStr, dom::Pref* aDomPref) { |
763 |
+ { |
|
|
764 |
+ char* p = aStr; |
753 |
+ char* p = aStr; |
765 |
+ |
754 |
+ |
766 |
+ // The type. |
755 |
+ // The type. |
Lines 775-781
index fe780686f2eb..488095f49236 100644
Link Here
|
775 |
+ NS_ERROR("bad pref type"); |
764 |
+ NS_ERROR("bad pref type"); |
776 |
+ type = PrefType::None; |
765 |
+ type = PrefType::None; |
777 |
+ } |
766 |
+ } |
778 |
+ p++; // move past the type char |
767 |
+ p++; // move past the type char |
779 |
+ |
768 |
+ |
780 |
+ // Locked? |
769 |
+ // Locked? |
781 |
+ bool isLocked; |
770 |
+ bool isLocked; |
Lines 787-803
index fe780686f2eb..488095f49236 100644
Link Here
|
787 |
+ NS_ERROR("bad pref locked status"); |
776 |
+ NS_ERROR("bad pref locked status"); |
788 |
+ isLocked = false; |
777 |
+ isLocked = false; |
789 |
+ } |
778 |
+ } |
790 |
+ p++; // move past the isLocked char |
779 |
+ p++; // move past the isLocked char |
791 |
+ |
780 |
+ |
792 |
+ MOZ_ASSERT(*p == ':'); |
781 |
+ MOZ_ASSERT(*p == ':'); |
793 |
+ p++; // move past the ':' |
782 |
+ p++; // move past the ':' |
794 |
+ |
783 |
+ |
795 |
+ // The pref name. |
784 |
+ // The pref name. |
796 |
+ nsCString name; |
785 |
+ nsCString name; |
797 |
+ p = DeserializeString(p, name); |
786 |
+ p = DeserializeString(p, name); |
798 |
+ |
787 |
+ |
799 |
+ MOZ_ASSERT(*p == ':'); |
788 |
+ MOZ_ASSERT(*p == ':'); |
800 |
+ p++; // move past the ':' preceding the default value |
789 |
+ p++; // move past the ':' preceding the default value |
801 |
+ |
790 |
+ |
802 |
+ dom::MaybePrefValue maybeDefaultValue; |
791 |
+ dom::MaybePrefValue maybeDefaultValue; |
803 |
+ if (*p != ':') { |
792 |
+ if (*p != ':') { |
Lines 806-812
index fe780686f2eb..488095f49236 100644
Link Here
|
806 |
+ } |
795 |
+ } |
807 |
+ |
796 |
+ |
808 |
+ MOZ_ASSERT(*p == ':'); |
797 |
+ MOZ_ASSERT(*p == ':'); |
809 |
+ p++; // move past the ':' between the default and user values |
798 |
+ p++; // move past the ':' between the default and user values |
810 |
+ |
799 |
+ |
811 |
+ dom::MaybePrefValue maybeUserValue; |
800 |
+ dom::MaybePrefValue maybeUserValue; |
812 |
+ if (*p != '\n') { |
801 |
+ if (*p != '\n') { |
Lines 815-837
index fe780686f2eb..488095f49236 100644
Link Here
|
815 |
+ } |
804 |
+ } |
816 |
+ |
805 |
+ |
817 |
+ MOZ_ASSERT(*p == '\n'); |
806 |
+ MOZ_ASSERT(*p == '\n'); |
818 |
+ p++; // move past the '\n' following the user value |
807 |
+ p++; // move past the '\n' following the user value |
819 |
+ |
808 |
+ |
820 |
+ *aDomPref = dom::Pref(name, isLocked, maybeDefaultValue, maybeUserValue); |
809 |
+ *aDomPref = dom::Pref(name, isLocked, maybeDefaultValue, maybeUserValue); |
821 |
+ |
810 |
+ |
822 |
+ return p; |
811 |
+ return p; |
823 |
+ } |
812 |
+ } |
824 |
+ |
813 |
+ |
825 |
void AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf, PrefsSizes& aSizes) |
814 |
void AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf, PrefsSizes& aSizes) { |
826 |
{ |
|
|
827 |
// Note: mName is allocated in gPrefNameArena, measured elsewhere. |
815 |
// Note: mName is allocated in gPrefNameArena, measured elsewhere. |
828 |
@@ -880,41 +1113,9 @@ pref_savePrefs() |
816 |
aSizes.mPrefValues += aMallocSizeOf(this); |
|
|
817 |
@@ -817,57 +1041,17 @@ static PrefSaveData pref_savePrefs() { |
829 |
|
818 |
|
830 |
#ifdef DEBUG |
819 |
#ifdef DEBUG |
831 |
|
820 |
|
832 |
-// For content processes, what prefs have been initialized? |
821 |
-// For content processes, what prefs have been initialized? |
833 |
-enum class ContentProcessPhase |
822 |
-enum class ContentProcessPhase { |
834 |
-{ |
|
|
835 |
- eNoPrefsSet, |
823 |
- eNoPrefsSet, |
836 |
- eEarlyPrefsSet, |
824 |
- eEarlyPrefsSet, |
837 |
- eEarlyAndLatePrefsSet, |
825 |
- eEarlyAndLatePrefsSet, |
Lines 840-875
index fe780686f2eb..488095f49236 100644
Link Here
|
840 |
// Note that this never changes in the parent process, and is only read in |
828 |
// Note that this never changes in the parent process, and is only read in |
841 |
// content processes. |
829 |
// content processes. |
842 |
-static ContentProcessPhase gPhase = ContentProcessPhase::eNoPrefsSet; |
830 |
-static ContentProcessPhase gPhase = ContentProcessPhase::eNoPrefsSet; |
843 |
- |
831 |
+static bool gContentProcessPrefsAreInited = false; |
844 |
-struct StringComparator |
832 |
|
845 |
-{ |
833 |
-struct StringComparator { |
846 |
- const char* mPrefName; |
834 |
- const char* mPrefName; |
847 |
- |
835 |
- |
848 |
- explicit StringComparator(const char* aPrefName) |
836 |
- explicit StringComparator(const char* aPrefName) : mPrefName(aPrefName) {} |
849 |
- : mPrefName(aPrefName) |
|
|
850 |
- { |
851 |
- } |
852 |
- |
837 |
- |
853 |
- int operator()(const char* aPrefName) const |
838 |
- int operator()(const char* aPrefName) const { |
854 |
- { |
|
|
855 |
- return strcmp(mPrefName, aPrefName); |
839 |
- return strcmp(mPrefName, aPrefName); |
856 |
- } |
840 |
- } |
857 |
-}; |
841 |
-}; |
858 |
- |
842 |
- |
859 |
-static bool |
843 |
-static bool IsEarlyPref(const char* aPrefName) { |
860 |
-IsEarlyPref(const char* aPrefName) |
|
|
861 |
-{ |
862 |
- size_t prefsLen; |
844 |
- size_t prefsLen; |
863 |
- size_t found; |
845 |
- size_t found; |
864 |
- const char** list = mozilla::dom::ContentPrefs::GetEarlyPrefs(&prefsLen); |
846 |
- const char** list = mozilla::dom::ContentPrefs::GetEarlyPrefs(&prefsLen); |
865 |
- return BinarySearchIf(list, 0, prefsLen, StringComparator(aPrefName), &found); |
847 |
- return BinarySearchIf(list, 0, prefsLen, StringComparator(aPrefName), &found); |
866 |
-} |
848 |
-} |
867 |
+static bool gContentProcessPrefsAreInited = false; |
849 |
- |
868 |
|
850 |
#endif // DEBUG |
869 |
#endif // DEBUG |
|
|
870 |
|
851 |
|
871 |
@@ -923,23 +1124,7 @@ pref_HashTableLookupInner(const char* aPrefName) |
852 |
static PrefEntry* pref_HashTableLookupInner(const char* aPrefName) { |
872 |
{ |
|
|
873 |
MOZ_ASSERT(NS_IsMainThread() || mozilla::ServoStyleSet::IsInServoTraversal()); |
853 |
MOZ_ASSERT(NS_IsMainThread() || mozilla::ServoStyleSet::IsInServoTraversal()); |
874 |
|
854 |
|
875 |
-#ifdef DEBUG |
855 |
-#ifdef DEBUG |
Lines 878-910
index fe780686f2eb..488095f49236 100644
Link Here
|
878 |
- MOZ_CRASH_UNSAFE_PRINTF("accessing pref %s before early prefs are set", |
858 |
- MOZ_CRASH_UNSAFE_PRINTF("accessing pref %s before early prefs are set", |
879 |
- aPrefName); |
859 |
- aPrefName); |
880 |
- } |
860 |
- } |
881 |
- |
861 |
+ MOZ_ASSERT_IF(!XRE_IsParentProcess(), gContentProcessPrefsAreInited); |
|
|
862 |
|
882 |
- if (gPhase == ContentProcessPhase::eEarlyPrefsSet && |
863 |
- if (gPhase == ContentProcessPhase::eEarlyPrefsSet && |
883 |
- !IsEarlyPref(aPrefName)) { |
864 |
- !IsEarlyPref(aPrefName)) { |
884 |
- // If you hit this crash, you have an early access of a non-early pref. |
865 |
- // If you hit this crash, you have an early access of a non-early pref. |
885 |
- // Consider moving the access later or add the pref to the whitelist of |
866 |
- // Consider moving the access later or add the pref to the whitelist of |
886 |
- // early prefs in ContentPrefs.cpp and get review from a DOM peer. |
867 |
- // early prefs in ContentPrefs.cpp and get review from a DOM peer. |
887 |
- MOZ_CRASH_UNSAFE_PRINTF( |
868 |
- MOZ_CRASH_UNSAFE_PRINTF( |
888 |
- "accessing non-early pref %s before late prefs are set", aPrefName); |
869 |
- "accessing non-early pref %s before late prefs are set", aPrefName); |
889 |
- } |
870 |
- } |
890 |
- } |
871 |
- } |
891 |
-#endif |
872 |
-#endif |
892 |
+ MOZ_ASSERT_IF(!XRE_IsParentProcess(), gContentProcessPrefsAreInited); |
873 |
- |
893 |
|
|
|
894 |
return static_cast<PrefEntry*>(gHashTable->Search(aPrefName)); |
874 |
return static_cast<PrefEntry*>(gHashTable->Search(aPrefName)); |
895 |
} |
875 |
} |
896 |
@@ -2932,8 +3117,8 @@ public: |
|
|
897 |
|
876 |
|
898 |
} // namespace |
877 |
@@ -2637,8 +2821,8 @@ class AddPreferencesMemoryReporterRunnable : public Ru |
|
|
878 |
|
879 |
} // namespace |
899 |
|
880 |
|
900 |
-// A list of prefs sent early from the parent, via shared memory. |
881 |
-// A list of prefs sent early from the parent, via shared memory. |
901 |
-static InfallibleTArray<dom::Pref>* gEarlyDomPrefs; |
882 |
-static InfallibleTArray<dom::Pref>* gEarlyDomPrefs; |
902 |
+// A list of changed prefs sent from the parent via shared memory. |
883 |
+// A list of changed prefs sent from the parent via shared memory. |
903 |
+static InfallibleTArray<dom::Pref>* gChangedDomPrefs; |
884 |
+static InfallibleTArray<dom::Pref>* gChangedDomPrefs; |
904 |
|
885 |
|
905 |
static const char kTelemetryPref[] = "toolkit.telemetry.enabled"; |
886 |
/* static */ already_AddRefed<Preferences> |
906 |
static const char kChannelPref[] = "app.update.channel"; |
887 |
Preferences::GetInstanceForService() { |
907 |
@@ -3050,12 +3235,12 @@ Preferences::GetInstanceForService() |
888 |
@@ -2668,12 +2852,12 @@ Preferences::GetInstanceForService() { |
908 |
} |
889 |
} |
909 |
|
890 |
|
910 |
if (!XRE_IsParentProcess()) { |
891 |
if (!XRE_IsParentProcess()) { |
Lines 922-940
index fe780686f2eb..488095f49236 100644
Link Here
|
922 |
|
903 |
|
923 |
} else { |
904 |
} else { |
924 |
// Check if there is a deployment configuration file. If so, set up the |
905 |
// Check if there is a deployment configuration file. If so, set up the |
925 |
@@ -3179,149 +3364,44 @@ NS_IMPL_ISUPPORTS(Preferences, |
906 |
@@ -2782,143 +2966,45 @@ Preferences::~Preferences() { |
|
|
907 |
NS_IMPL_ISUPPORTS(Preferences, nsIPrefService, nsIObserver, nsIPrefBranch, |
926 |
nsISupportsWeakReference) |
908 |
nsISupportsWeakReference) |
927 |
|
909 |
|
928 |
/* static */ void |
910 |
-/* static */ void Preferences::SerializeEarlyPreferences(nsCString& aStr) { |
929 |
-Preferences::SerializeEarlyPreferences(nsCString& aStr) |
911 |
+/* static */ void Preferences::SerializePreferences(nsCString& aStr) { |
930 |
+Preferences::SerializePreferences(nsCString& aStr) |
|
|
931 |
{ |
932 |
MOZ_RELEASE_ASSERT(InitStaticMembers()); |
912 |
MOZ_RELEASE_ASSERT(InitStaticMembers()); |
933 |
|
913 |
|
934 |
- nsAutoCStringN<256> boolPrefs, intPrefs, stringPrefs; |
914 |
- nsAutoCStringN<256> boolPrefs, intPrefs, stringPrefs; |
935 |
- size_t numEarlyPrefs; |
915 |
- size_t numEarlyPrefs; |
936 |
- dom::ContentPrefs::GetEarlyPrefs(&numEarlyPrefs); |
916 |
- dom::ContentPrefs::GetEarlyPrefs(&numEarlyPrefs); |
937 |
- |
917 |
+ aStr.Truncate(); |
|
|
918 |
|
938 |
- for (unsigned int i = 0; i < numEarlyPrefs; i++) { |
919 |
- for (unsigned int i = 0; i < numEarlyPrefs; i++) { |
939 |
- const char* prefName = dom::ContentPrefs::GetEarlyPref(i); |
920 |
- const char* prefName = dom::ContentPrefs::GetEarlyPref(i); |
940 |
- MOZ_ASSERT_IF(i > 0, |
921 |
- MOZ_ASSERT_IF(i > 0, |
Lines 943-976
index fe780686f2eb..488095f49236 100644
Link Here
|
943 |
- Pref* pref = pref_HashTableLookup(prefName); |
924 |
- Pref* pref = pref_HashTableLookup(prefName); |
944 |
- if (!pref || !pref->MustSendToContentProcesses()) { |
925 |
- if (!pref || !pref->MustSendToContentProcesses()) { |
945 |
- continue; |
926 |
- continue; |
946 |
- } |
927 |
+ for (auto iter = gHashTable->Iter(); !iter.Done(); iter.Next()) { |
947 |
+ aStr.Truncate(); |
928 |
+ Pref* pref = static_cast<PrefEntry*>(iter.Get())->mPref; |
948 |
|
929 |
+ if (pref->MustSendToContentProcesses() && pref->HasAdvisablySizedValues()) { |
|
|
930 |
+ pref->SerializeAndAppend(aStr); |
931 |
} |
932 |
- |
949 |
- switch (pref->Type()) { |
933 |
- switch (pref->Type()) { |
950 |
- case PrefType::Bool: |
934 |
- case PrefType::Bool: |
951 |
- boolPrefs.Append( |
935 |
- boolPrefs.Append( |
952 |
- nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName))); |
936 |
- nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName))); |
953 |
- break; |
937 |
- break; |
954 |
- case PrefType::Int: |
938 |
- case PrefType::Int: |
955 |
- intPrefs.Append( |
939 |
- intPrefs.Append( |
956 |
- nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName))); |
940 |
- nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName))); |
957 |
- break; |
941 |
- break; |
958 |
- case PrefType::String: { |
942 |
- case PrefType::String: { |
959 |
- nsAutoCString value; |
943 |
- nsAutoCString value; |
960 |
- Preferences::GetCString(prefName, value); |
944 |
- Preferences::GetCString(prefName, value); |
961 |
- stringPrefs.Append( |
945 |
- stringPrefs.Append( |
962 |
- nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get())); |
946 |
- nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get())); |
963 |
- } break; |
947 |
- } break; |
964 |
- case PrefType::None: |
948 |
- case PrefType::None: |
965 |
- break; |
949 |
- break; |
966 |
- default: |
950 |
- default: |
967 |
- printf_stderr("preference type: %d\n", int(pref->Type())); |
951 |
- printf_stderr("preference type: %d\n", int(pref->Type())); |
968 |
- MOZ_CRASH(); |
952 |
- MOZ_CRASH(); |
969 |
+ for (auto iter = gHashTable->Iter(); !iter.Done(); iter.Next()) { |
953 |
- } |
970 |
+ Pref* pref = static_cast<PrefEntry*>(iter.Get())->mPref; |
|
|
971 |
+ if (pref->MustSendToContentProcesses() && pref->HasAdvisablySizedValues()) { |
972 |
+ pref->SerializeAndAppend(aStr); |
973 |
} |
974 |
} |
954 |
} |
975 |
|
955 |
|
976 |
- aStr.Truncate(); |
956 |
- aStr.Truncate(); |
Lines 983-992
index fe780686f2eb..488095f49236 100644
Link Here
|
983 |
aStr.Append('\0'); |
963 |
aStr.Append('\0'); |
984 |
} |
964 |
} |
985 |
|
965 |
|
986 |
/* static */ void |
966 |
-/* static */ void Preferences::DeserializeEarlyPreferences(char* aStr, |
987 |
-Preferences::DeserializeEarlyPreferences(char* aStr, size_t aStrLen) |
967 |
- size_t aStrLen) { |
988 |
+Preferences::DeserializePreferences(char* aStr, size_t aPrefsLen) |
968 |
+/* static */ void Preferences::DeserializePreferences(char* aStr, |
989 |
{ |
969 |
+ size_t aPrefsLen) { |
990 |
MOZ_ASSERT(!XRE_IsParentProcess()); |
970 |
MOZ_ASSERT(!XRE_IsParentProcess()); |
991 |
|
971 |
|
992 |
- MOZ_ASSERT(!gEarlyDomPrefs); |
972 |
- MOZ_ASSERT(!gEarlyDomPrefs); |
Lines 1011-1036
index fe780686f2eb..488095f49236 100644
Link Here
|
1011 |
- MOZ_ASSERT(p[0] == '|'); |
991 |
- MOZ_ASSERT(p[0] == '|'); |
1012 |
- p++; |
992 |
- p++; |
1013 |
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)), |
993 |
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)), |
1014 |
- /* isLocked */ false, |
994 |
- /* isLocked */ false, value, dom::MaybePrefValue()); |
1015 |
- value, |
|
|
1016 |
- dom::MaybePrefValue()); |
1017 |
- gEarlyDomPrefs->AppendElement(pref); |
995 |
- gEarlyDomPrefs->AppendElement(pref); |
1018 |
- } |
996 |
+ while (*p != '\0') { |
|
|
997 |
+ dom::Pref pref; |
998 |
+ p = Pref::Deserialize(p, &pref); |
999 |
+ gChangedDomPrefs->AppendElement(pref); |
1000 |
} |
1019 |
- p++; |
1001 |
- p++; |
1020 |
- |
1002 |
|
1021 |
- // Get the int prefs. |
1003 |
- // Get the int prefs. |
1022 |
- while (*p != '\n') { |
1004 |
- while (*p != '\n') { |
1023 |
- int32_t index = strtol(p, &p, 10); |
1005 |
- int32_t index = strtol(p, &p, 10); |
1024 |
- MOZ_ASSERT(p[0] == ':'); |
1006 |
- MOZ_ASSERT(p[0] == ':'); |
1025 |
- p++; |
1007 |
- p++; |
1026 |
- dom::MaybePrefValue value( |
1008 |
- dom::MaybePrefValue value( |
1027 |
- dom::PrefValue(static_cast<int32_t>(strtol(p, &p, 10)))); |
1009 |
- dom::PrefValue(static_cast<int32_t>(strtol(p, &p, 10)))); |
1028 |
- MOZ_ASSERT(p[0] == '|'); |
1010 |
- MOZ_ASSERT(p[0] == '|'); |
1029 |
- p++; |
1011 |
- p++; |
1030 |
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)), |
1012 |
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)), |
1031 |
- /* isLocked */ false, |
1013 |
- /* isLocked */ false, value, dom::MaybePrefValue()); |
1032 |
- value, |
|
|
1033 |
- dom::MaybePrefValue()); |
1034 |
- gEarlyDomPrefs->AppendElement(pref); |
1014 |
- gEarlyDomPrefs->AppendElement(pref); |
1035 |
- } |
1015 |
- } |
1036 |
- p++; |
1016 |
- p++; |
Lines 1045-1053
index fe780686f2eb..488095f49236 100644
Link Here
|
1045 |
- p++; |
1025 |
- p++; |
1046 |
- dom::MaybePrefValue value(dom::PrefValue(nsCString(p, length))); |
1026 |
- dom::MaybePrefValue value(dom::PrefValue(nsCString(p, length))); |
1047 |
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)), |
1027 |
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)), |
1048 |
- /* isLocked */ false, |
1028 |
- /* isLocked */ false, value, dom::MaybePrefValue()); |
1049 |
- value, |
|
|
1050 |
- dom::MaybePrefValue()); |
1051 |
- gEarlyDomPrefs->AppendElement(pref); |
1029 |
- gEarlyDomPrefs->AppendElement(pref); |
1052 |
- p += length + 1; |
1030 |
- p += length + 1; |
1053 |
- MOZ_ASSERT(*(p - 1) == '|'); |
1031 |
- MOZ_ASSERT(*(p - 1) == '|'); |
Lines 1055-1102
index fe780686f2eb..488095f49236 100644
Link Here
|
1055 |
- p++; |
1033 |
- p++; |
1056 |
- |
1034 |
- |
1057 |
- MOZ_ASSERT(*p == '\0'); |
1035 |
- MOZ_ASSERT(*p == '\0'); |
1058 |
+ while (*p != '\0') { |
1036 |
- |
1059 |
+ dom::Pref pref; |
|
|
1060 |
+ p = Pref::Deserialize(p, &pref); |
1061 |
+ gChangedDomPrefs->AppendElement(pref); |
1062 |
+ } |
1063 |
|
1064 |
// We finished parsing on a '\0'. That should be the last char in the shared |
1037 |
// We finished parsing on a '\0'. That should be the last char in the shared |
1065 |
- // memory. |
1038 |
- // memory. |
1066 |
- MOZ_ASSERT(aStr + aStrLen - 1 == p); |
1039 |
- MOZ_ASSERT(aStr + aStrLen - 1 == p); |
1067 |
- |
|
|
1068 |
-#ifdef DEBUG |
1069 |
- MOZ_ASSERT(gPhase == ContentProcessPhase::eNoPrefsSet); |
1070 |
- gPhase = ContentProcessPhase::eEarlyPrefsSet; |
1071 |
-#endif |
1072 |
-} |
1073 |
- |
1074 |
-/* static */ void |
1075 |
-Preferences::SetLatePreferences(const nsTArray<dom::Pref>* aDomPrefs) |
1076 |
-{ |
1077 |
- MOZ_ASSERT(!XRE_IsParentProcess()); |
1078 |
- |
1079 |
- for (unsigned int i = 0; i < aDomPrefs->Length(); i++) { |
1080 |
- Preferences::SetPreference(aDomPrefs->ElementAt(i)); |
1081 |
- } |
1082 |
+ // memory. (aPrefsLen includes the '\0'.) |
1040 |
+ // memory. (aPrefsLen includes the '\0'.) |
1083 |
+ MOZ_ASSERT(p == aStr + aPrefsLen - 1); |
1041 |
+ MOZ_ASSERT(p == aStr + aPrefsLen - 1); |
1084 |
|
1042 |
|
1085 |
#ifdef DEBUG |
1043 |
#ifdef DEBUG |
1086 |
- MOZ_ASSERT(gPhase == ContentProcessPhase::eEarlyPrefsSet); |
1044 |
- MOZ_ASSERT(gPhase == ContentProcessPhase::eNoPrefsSet); |
1087 |
- gPhase = ContentProcessPhase::eEarlyAndLatePrefsSet; |
1045 |
- gPhase = ContentProcessPhase::eEarlyPrefsSet; |
1088 |
+ MOZ_ASSERT(!gContentProcessPrefsAreInited); |
1046 |
+ MOZ_ASSERT(!gContentProcessPrefsAreInited); |
1089 |
+ gContentProcessPrefsAreInited = true; |
1047 |
+ gContentProcessPrefsAreInited = true; |
1090 |
#endif |
1048 |
#endif |
1091 |
} |
1049 |
} |
1092 |
|
1050 |
|
1093 |
@@ -3558,36 +3638,12 @@ Preferences::GetPreference(dom::Pref* aDomPref) |
1051 |
-/* static */ void Preferences::SetLatePreferences( |
|
|
1052 |
- const nsTArray<dom::Pref>* aDomPrefs) { |
1053 |
- MOZ_ASSERT(!XRE_IsParentProcess()); |
1054 |
- |
1055 |
- for (unsigned int i = 0; i < aDomPrefs->Length(); i++) { |
1056 |
- Preferences::SetPreference(aDomPrefs->ElementAt(i)); |
1057 |
- } |
1058 |
- |
1059 |
-#ifdef DEBUG |
1060 |
- MOZ_ASSERT(gPhase == ContentProcessPhase::eEarlyPrefsSet); |
1061 |
- gPhase = ContentProcessPhase::eEarlyAndLatePrefsSet; |
1062 |
-#endif |
1063 |
-} |
1064 |
- |
1065 |
/* static */ void Preferences::InitializeUserPrefs() { |
1066 |
MOZ_ASSERT(XRE_IsParentProcess()); |
1067 |
MOZ_ASSERT(!sPreferences->mCurrentFile, "Should only initialize prefs once"); |
1068 |
@@ -3133,32 +3219,10 @@ Preferences::SavePrefFile(nsIFile* aFile) { |
1094 |
} |
1069 |
} |
1095 |
} |
1070 |
} |
1096 |
|
1071 |
|
1097 |
-void |
1072 |
-void Preferences::GetPreferences(InfallibleTArray<dom::Pref>* aDomPrefs) { |
1098 |
-Preferences::GetPreferences(InfallibleTArray<dom::Pref>* aDomPrefs) |
|
|
1099 |
-{ |
1100 |
- MOZ_ASSERT(XRE_IsParentProcess()); |
1073 |
- MOZ_ASSERT(XRE_IsParentProcess()); |
1101 |
- MOZ_ASSERT(NS_IsMainThread()); |
1074 |
- MOZ_ASSERT(NS_IsMainThread()); |
1102 |
- |
1075 |
- |
Lines 1119-1128
index fe780686f2eb..488095f49236 100644
Link Here
|
1119 |
-} |
1092 |
-} |
1120 |
- |
1093 |
- |
1121 |
#ifdef DEBUG |
1094 |
#ifdef DEBUG |
1122 |
bool |
1095 |
-bool Preferences::AreAllPrefsSetInContentProcess() { |
1123 |
-Preferences::AreAllPrefsSetInContentProcess() |
1096 |
+bool Preferences::ArePrefsInitedInContentProcess() { |
1124 |
+Preferences::ArePrefsInitedInContentProcess() |
|
|
1125 |
{ |
1126 |
MOZ_ASSERT(!XRE_IsParentProcess()); |
1097 |
MOZ_ASSERT(!XRE_IsParentProcess()); |
1127 |
- return gPhase == ContentProcessPhase::eEarlyAndLatePrefsSet; |
1098 |
- return gPhase == ContentProcessPhase::eEarlyAndLatePrefsSet; |
1128 |
+ return gContentProcessPrefsAreInited; |
1099 |
+ return gContentProcessPrefsAreInited; |
Lines 1133-1140
diff --git modules/libpref/Preferences.h modules/libpref/Preferences.h
Link Here
|
1133 |
index 0d976483daae..901425b5b663 100644 |
1104 |
index 0d976483daae..901425b5b663 100644 |
1134 |
--- modules/libpref/Preferences.h |
1105 |
--- modules/libpref/Preferences.h |
1135 |
+++ modules/libpref/Preferences.h |
1106 |
+++ modules/libpref/Preferences.h |
1136 |
@@ -328,15 +328,10 @@ public: |
1107 |
@@ -277,15 +277,10 @@ class Preferences final : public nsIPrefService, |
1137 |
const char* aPref, |
1108 |
static nsresult AddFloatVarCache(float* aVariable, const char* aPref, |
1138 |
float aDefault = 0.0f); |
1109 |
float aDefault = 0.0f); |
1139 |
|
1110 |
|
1140 |
- // When a content process is created these methods are used to pass prefs in |
1111 |
- // When a content process is created these methods are used to pass prefs in |
Lines 1153-1159
index 0d976483daae..901425b5b663 100644
Link Here
|
1153 |
|
1124 |
|
1154 |
// When a single pref is changed in the parent process, these methods are |
1125 |
// When a single pref is changed in the parent process, these methods are |
1155 |
// used to pass the update to content processes. |
1126 |
// used to pass the update to content processes. |
1156 |
@@ -344,7 +339,7 @@ public: |
1127 |
@@ -293,7 +288,7 @@ class Preferences final : public nsIPrefService, |
1157 |
static void SetPreference(const dom::Pref& aPref); |
1128 |
static void SetPreference(const dom::Pref& aPref); |
1158 |
|
1129 |
|
1159 |
#ifdef DEBUG |
1130 |
#ifdef DEBUG |