зеркало из https://github.com/mozilla/gecko-dev.git
Bug 698565 (1/6) - stop excluding keys when calling JSON.stringify() [r=dietrich]
Stop excluding keys.
This commit is contained in:
Родитель
adc68fc9f4
Коммит
5ca5474f71
|
@ -117,11 +117,6 @@ const CAPABILITIES = [
|
||||||
"DNSPrefetch", "Auth", "WindowControl"
|
"DNSPrefetch", "Auth", "WindowControl"
|
||||||
];
|
];
|
||||||
|
|
||||||
// These keys are for internal use only - they shouldn't be part of the JSON
|
|
||||||
// that gets saved to disk nor part of the strings returned by the API.
|
|
||||||
const INTERNAL_KEYS = ["_tabStillLoading", "_hosts", "_formDataSaved",
|
|
||||||
"_shouldRestore", "_host", "_scheme"];
|
|
||||||
|
|
||||||
// These are tab events that we listen to.
|
// These are tab events that we listen to.
|
||||||
const TAB_EVENTS = ["TabOpen", "TabClose", "TabSelect", "TabShow", "TabHide",
|
const TAB_EVENTS = ["TabOpen", "TabClose", "TabSelect", "TabShow", "TabHide",
|
||||||
"TabPinned", "TabUnpinned"];
|
"TabPinned", "TabUnpinned"];
|
||||||
|
@ -4084,18 +4079,7 @@ SessionStoreService.prototype = {
|
||||||
* @returns the object's JSON representation
|
* @returns the object's JSON representation
|
||||||
*/
|
*/
|
||||||
_toJSONString: function sss_toJSONString(aJSObject) {
|
_toJSONString: function sss_toJSONString(aJSObject) {
|
||||||
// We never want to save __lastSessionWindowID across sessions, but we do
|
return JSON.stringify(aJSObject);
|
||||||
// want it exported to consumers when running (eg. Private Browsing).
|
|
||||||
let internalKeys = INTERNAL_KEYS;
|
|
||||||
if (this._loadState == STATE_QUITTING) {
|
|
||||||
internalKeys = internalKeys.slice();
|
|
||||||
internalKeys.push("__lastSessionWindowID");
|
|
||||||
}
|
|
||||||
function exclude(key, value) {
|
|
||||||
// returning undefined results in the exclusion of that key
|
|
||||||
return internalKeys.indexOf(key) == -1 ? value : undefined;
|
|
||||||
}
|
|
||||||
return JSON.stringify(aJSObject, exclude);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_sendRestoreCompletedNotifications: function sss_sendRestoreCompletedNotifications() {
|
_sendRestoreCompletedNotifications: function sss_sendRestoreCompletedNotifications() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче