Bug 996384 - WebappsApplication#clearBrowserData should not clear app's alarms from mozAlarms. r=gene, r=nsm, a=1.3+
authorFabrice Desré <fabrice@mozilla.com>
Wed, 16 Apr 2014 10:48:01 -0700
changeset 191996 981efa650de8aa9dface24a21c4b70409739091d
parent 191995 bee1ba424663a093bceb15352f1d8bc244b605b4
child 191997 08116c1e9a26e8abe26855380d0bce57ea99ced2
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgene, nsm, 1
bugs996384
milestone30.0a2
Bug 996384 - WebappsApplication#clearBrowserData should not clear app's alarms from mozAlarms. r=gene, r=nsm, a=1.3+
dom/alarm/AlarmService.jsm
dom/push/src/PushService.jsm
--- a/dom/alarm/AlarmService.jsm
+++ b/dom/alarm/AlarmService.jsm
@@ -510,16 +510,21 @@ this.AlarmService = {
       case "webapps-clear-data":
         let params =
           aSubject.QueryInterface(Ci.mozIApplicationClearPrivateDataParams);
         if (!params) {
           debug("Error! Fail to remove alarms for an uninstalled app.");
           return;
         }
 
+        // Only remove alarms for apps.
+        if (params.browserOnly) {
+          return;
+        }
+
         let manifestURL = appsService.getManifestURLByLocalId(params.appId);
         if (!manifestURL) {
           debug("Error! Fail to remove alarms for an uninstalled app.");
           return;
         }
 
         this._db.getAll(
           manifestURL,
--- a/dom/push/src/PushService.jsm
+++ b/dom/push/src/PushService.jsm
@@ -364,16 +364,21 @@ this.PushService = {
         debug("webapps-clear-data");
 
         let data = aSubject.QueryInterface(Ci.mozIApplicationClearPrivateDataParams);
         if (!data) {
           debug("webapps-clear-data: Failed to get information about application");
           return;
         }
 
+        // Only remove push registrations for apps.
+        if (data.browserOnly) {
+          return;
+        }
+
         let appsService = Cc["@mozilla.org/AppsService;1"]
                             .getService(Ci.nsIAppsService);
         let manifestURL = appsService.getManifestURLByLocalId(data.appId);
         if (!manifestURL) {
           debug("webapps-clear-data: No manifest URL found for " + data.appId);
           return;
         }