From c412661b21577526c333b6f7449db700406fc765 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Sun, 24 Jul 2016 14:31:44 +0200 Subject: [PATCH] Backed out changeset c5efa902cbe5 (bug 1287091) --- .../ContextualIdentityService.jsm | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/toolkit/components/contextualidentity/ContextualIdentityService.jsm b/toolkit/components/contextualidentity/ContextualIdentityService.jsm index 009f05db494b..8a2c1871d538 100644 --- a/toolkit/components/contextualidentity/ContextualIdentityService.jsm +++ b/toolkit/components/contextualidentity/ContextualIdentityService.jsm @@ -67,7 +67,7 @@ this.ContextualIdentityService = { accessKey: "userContextShopping.accesskey", telemetryId: 4, }, - { userContextId: 5, + { userContextId: Math.pow(2, 31) - 1, public: false, icon: "", color: "", @@ -77,7 +77,6 @@ this.ContextualIdentityService = { _identities: null, _openedIdentities: new Set(), - _lastUserContextId: 0, _path: null, _dataReady: false, @@ -102,16 +101,7 @@ this.ContextualIdentityService = { } try { - let data = JSON.parse(gTextDecoder.decode(bytes)); - if (data.version != 1) { - dump("ERROR - ContextualIdentityService - Unknown version found in " + this._path + "\n"); - this.loadError(null); - return; - } - - this._identities = data.identities; - this._lastUserContextId = data.lastUserContextId; - + this._identities = JSON.parse(gTextDecoder.decode(bytes)); this._dataReady = true; } catch(error) { this.loadError(error); @@ -122,8 +112,7 @@ this.ContextualIdentityService = { }, loadError(error) { - if (error != null && - !(error instanceof OS.File.Error && error.becauseNoSuchFile) && + if (!(error instanceof OS.File.Error && error.becauseNoSuchFile) && !(error instanceof Components.Exception && error.result == Cr.NS_ERROR_FILE_NOT_FOUND)) { // Let's report the error. @@ -136,8 +125,6 @@ this.ContextualIdentityService = { } this._identities = this._defaultIdentities; - this._lastUserContextId = this._defaultIdentities.length; - this._dataReady = true; this.saveSoon(); @@ -148,13 +135,7 @@ this.ContextualIdentityService = { }, save() { - let object = { - version: 1, - lastUserContextId: this._lastUserContextId, - identities: this._identities - }; - - let bytes = gTextEncoder.encode(JSON.stringify(object)); + let bytes = gTextEncoder.encode(JSON.stringify(this._identities)); return OS.File.writeAtomic(this._path, bytes, { tmpPath: this._path + ".tmp" }); },