Bug 875712 - When a system update removes a system app, delete the app data from the registry after deleting the private data, not before, r=fabrice
authorAntonio M. Amaya <amac@tid.es>
Fri, 24 May 2013 12:07:10 +0200
changeset 133035 a34c219c6b5289d9329d3273e71eea4585a33e49
parent 133034 211b562004015b4195262d3d10098b1649392c90
child 133036 dd0ca766bdb0bc16b719d1f25128b99b634a4f6d
push id24736
push userphilringnalda@gmail.com
push dateMon, 27 May 2013 16:55:16 +0000
treeherdermozilla-central@2ca0856eb5ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs875712
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 875712 - When a system update removes a system app, delete the app data from the registry after deleting the private data, not before, r=fabrice
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -379,24 +379,24 @@ this.DOMApplicationRegistry = {
           aNext();
           return;
         }
 
         // b : core apps are not removable.
         for (let id in this.webapps) {
           if (id in aData || this.webapps[id].removable)
             continue;
-          delete this.webapps[id];
           // Remove the permissions, cookies and private data for this app.
           let localId = this.webapps[id].localId;
           let permMgr = Cc["@mozilla.org/permissionmanager;1"]
                           .getService(Ci.nsIPermissionManager);
           permMgr.RemovePermissionsForApp(localId, false);
           Services.cookies.removeCookiesForApp(localId, false);
           this._clearPrivateData(localId, false);
+          delete this.webapps[id];
         }
 
         let appDir = FileUtils.getDir("coreAppsDir", ["webapps"], false);
         // c
         for (let id in aData) {
           // Core apps have ids matching their domain name (eg: dialer.gaiamobile.org)
           // Use that property to check if they are new or not.
           if (!(id in this.webapps)) {