Bug 1363321 - Part 1 - Always copy crash restore settings to Java on startup. r=jchen

Those settings need to be stored in our shared preferences since they're needed before Gecko is available, however in order to allow them to be easily configured, we also expose them in about:config and sync them to the shared prefs via a change listener.

This however means that changes in the *default* value of those prefs won't be picked up. Therefore we now simply unconditionally copy the setting state into the shared preferences on startup and omit the change listener instead, as they're exposed in about:config only and there is in fact no pressing need for changes there to immediately take effect.

MozReview-Commit-ID: 7c950F1nkdj

--HG--
extra : rebase_source : 4be6e5124294a71b5d214b9ab10ada4e88aee3bb
This commit is contained in:
Jan Henning 2017-05-10 20:20:50 +02:00
Родитель 78c83f5606
Коммит 02495c3a98
1 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -121,14 +121,10 @@ SessionStore.prototype = {
// Copy changes in Gecko settings to their Java counterparts,
// so the startup code can access them
Services.prefs.addObserver(PREFS_RESTORE_FROM_CRASH, function() {
SharedPreferences.forApp().setBoolPref(PREFS_RESTORE_FROM_CRASH,
Services.prefs.getBoolPref(PREFS_RESTORE_FROM_CRASH));
});
Services.prefs.addObserver(PREFS_MAX_CRASH_RESUMES, function() {
SharedPreferences.forApp().setIntPref(PREFS_MAX_CRASH_RESUMES,
Services.prefs.getIntPref(PREFS_MAX_CRASH_RESUMES));
});
SharedPreferences.forApp().setBoolPref(PREFS_RESTORE_FROM_CRASH,
Services.prefs.getBoolPref(PREFS_RESTORE_FROM_CRASH));
SharedPreferences.forApp().setIntPref(PREFS_MAX_CRASH_RESUMES,
Services.prefs.getIntPref(PREFS_MAX_CRASH_RESUMES));
},
_updateMaxTabsUndo: function ss_updateMaxTabsUndo() {