Bug 791232 - Remove calls to clearOfflineApps() any remaining integration of localStorage with offline apps after Bug 776416. r=sicking
authorJan Varga <jan.varga@gmail.com>
Fri, 14 Sep 2012 22:23:44 +0200
changeset 113999 19d45bb5e12c29a280feaecc084557aada2b1ac0
parent 113998 63900a754a53e67d0e2e5f06bd513c9dc7eb5699
child 114000 ece7fb2526fbd6014155bbd8bfd15de42b41eaf1
push id239
push userakeybl@mozilla.com
push dateThu, 03 Jan 2013 21:54:43 +0000
treeherdermozilla-release@3a7b66445659 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs791232, 776416
milestone18.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 791232 - Remove calls to clearOfflineApps() any remaining integration of localStorage with offline apps after Bug 776416. r=sicking
browser/base/content/browser.js
browser/components/preferences/advanced.js
browser/components/preferences/in-content/advanced.js
browser/modules/offlineAppCache.jsm
mobile/android/app/mobile.js
mobile/android/chrome/content/sanitize.js
mobile/xul/app/mobile.js
mobile/xul/chrome/content/sanitize.js
modules/libpref/src/init/all.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5813,20 +5813,16 @@ var OfflineApps = {
     for (let group of groups) {
       var uri = Services.io.newURI(group, null, null);
       if (uri.asciiHost == host) {
         var cache = cacheService.getActiveCache(group);
         usage += cache.usage;
       }
     }
 
-    var storageManager = Cc["@mozilla.org/dom/storagemanager;1"].
-                         getService(Ci.nsIDOMStorageManager);
-    usage += storageManager.getUsage(host);
-
     return usage;
   },
 
   _checkUsage: function(aURI) {
     // if the user has already allowed excessive usage, don't bother checking
     if (Services.perms.testExactPermission(aURI, "offline-app") !=
         Ci.nsIOfflineCacheUpdateService.ALLOW_NO_WARN) {
       var usage = this._getOfflineAppUsage(aURI.asciiHost);
--- a/browser/components/preferences/advanced.js
+++ b/browser/components/preferences/advanced.js
@@ -311,20 +311,16 @@ var gAdvancedPane = {
     for (var i = 0; i < groups.length; i++) {
       var uri = ios.newURI(groups[i], null, null);
       if (uri.asciiHost == host) {
         var cache = cacheService.getActiveCache(groups[i]);
         usage += cache.usage;
       }
     }
 
-    var storageManager = Components.classes["@mozilla.org/dom/storagemanager;1"].
-                         getService(Components.interfaces.nsIDOMStorageManager);
-    usage += storageManager.getUsage(host);
-
     return usage;
   },
 
   /**
    * Updates the list of offline applications
    */
   updateOfflineApps: function ()
   {
@@ -402,22 +398,16 @@ var gAdvancedPane = {
     for (var i = 0; i < groups.length; i++) {
         var uri = ios.newURI(groups[i], null, null);
         if (uri.asciiHost == host) {
             var cache = cacheService.getActiveCache(groups[i]);
             cache.discard();
         }
     }
 
-    // send out an offline-app-removed signal.  The nsDOMStorage
-    // service will clear DOM storage for this host.
-    var obs = Components.classes["@mozilla.org/observer-service;1"]
-                        .getService(Components.interfaces.nsIObserverService);
-    obs.notifyObservers(null, "offline-app-removed", host);
-
     // remove the permission
     var pm = Components.classes["@mozilla.org/permissionmanager;1"]
                        .getService(Components.interfaces.nsIPermissionManager);
     pm.remove(host, "offline-app",
               Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
     pm.remove(host, "offline-app",
               Components.interfaces.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
 
--- a/browser/components/preferences/in-content/advanced.js
+++ b/browser/components/preferences/in-content/advanced.js
@@ -303,20 +303,16 @@ var gAdvancedPane = {
     for (var i = 0; i < groups.length; i++) {
       var uri = ios.newURI(groups[i], null, null);
       if (uri.asciiHost == host) {
         var cache = cacheService.getActiveCache(groups[i]);
         usage += cache.usage;
       }
     }
 
-    var storageManager = Components.classes["@mozilla.org/dom/storagemanager;1"].
-                         getService(Components.interfaces.nsIDOMStorageManager);
-    usage += storageManager.getUsage(host);
-
     return usage;
   },
 
   /**
    * Updates the list of offline applications
    */
   updateOfflineApps: function ()
   {
@@ -394,22 +390,16 @@ var gAdvancedPane = {
     for (var i = 0; i < groups.length; i++) {
         var uri = ios.newURI(groups[i], null, null);
         if (uri.asciiHost == host) {
             var cache = cacheService.getActiveCache(groups[i]);
             cache.discard();
         }
     }
 
-    // send out an offline-app-removed signal.  The nsDOMStorage
-    // service will clear DOM storage for this host.
-    var obs = Components.classes["@mozilla.org/observer-service;1"]
-                        .getService(Components.interfaces.nsIObserverService);
-    obs.notifyObservers(null, "offline-app-removed", host);
-
     // remove the permission
     var pm = Components.classes["@mozilla.org/permissionmanager;1"]
                        .getService(Components.interfaces.nsIPermissionManager);
     pm.remove(host, "offline-app",
               Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
     pm.remove(host, "offline-app",
               Components.interfaces.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
 
--- a/browser/modules/offlineAppCache.jsm
+++ b/browser/modules/offlineAppCache.jsm
@@ -9,14 +9,10 @@ const Ci = Components.interfaces;
 
 let OfflineAppCacheHelper = {
   clear: function() {
     var cacheService = Cc["@mozilla.org/network/cache-service;1"].
                        getService(Ci.nsICacheService);
     try {
       cacheService.evictEntries(Ci.nsICache.STORE_OFFLINE);
     } catch(er) {}
-
-    var storageManagerService = Cc["@mozilla.org/dom/storagemanager;1"].
-                                getService(Ci.nsIDOMStorageManager);
-    storageManagerService.clearOfflineApps();
   }
 };
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -55,17 +55,16 @@ pref("browser.cache.memory.capacity", 10
 
 /* image cache prefs */
 pref("image.cache.size", 1048576); // bytes
 
 /* offline cache prefs */
 pref("browser.offline-apps.notify", true);
 pref("browser.cache.offline.enable", true);
 pref("browser.cache.offline.capacity", 5120); // kilobytes
-pref("offline-apps.quota.max", 2048); // kilobytes
 pref("offline-apps.quota.warn", 1024); // kilobytes
 
 // cache compression turned off for now - see bug #715198
 pref("browser.cache.compression_level", 0);
 
 /* protocol warning prefs */
 pref("network.protocol-handler.warn-external.tel", false);
 pref("network.protocol-handler.warn-external.mailto", false);
--- a/mobile/android/chrome/content/sanitize.js
+++ b/mobile/android/chrome/content/sanitize.js
@@ -118,19 +118,16 @@ Sanitizer.prototype = {
 
     offlineApps: {
       clear: function ()
       {
         var cacheService = Cc["@mozilla.org/network/cache-service;1"].getService(Ci.nsICacheService);
         try {
           cacheService.evictEntries(Ci.nsICache.STORE_OFFLINE);
         } catch(er) {}
-
-        var storage = Cc["@mozilla.org/dom/storagemanager;1"].getService(Ci.nsIDOMStorageManager);
-        storage.clearOfflineApps();
       },
 
       get canClear()
       {
           return true;
       }
     },
 
--- a/mobile/xul/app/mobile.js
+++ b/mobile/xul/app/mobile.js
@@ -65,17 +65,16 @@ pref("browser.cache.memory.capacity", 10
 
 /* image cache prefs */
 pref("image.cache.size", 1048576); // bytes
 
 /* offline cache prefs */
 pref("browser.offline-apps.notify", true);
 pref("browser.cache.offline.enable", true);
 pref("browser.cache.offline.capacity", 5120); // kilobytes
-pref("offline-apps.quota.max", 2048); // kilobytes
 pref("offline-apps.quota.warn", 1024); // kilobytes
 
 // cache compression turned off for now - see bug #715198
 pref("browser.cache.compression_level", 0);
 
 /* protocol warning prefs */
 pref("network.protocol-handler.warn-external.tel", false);
 pref("network.protocol-handler.warn-external.mailto", false);
--- a/mobile/xul/chrome/content/sanitize.js
+++ b/mobile/xul/chrome/content/sanitize.js
@@ -149,19 +149,16 @@ Sanitizer.prototype = {
 
     offlineApps: {
       clear: function ()
       {
         var cacheService = Cc["@mozilla.org/network/cache-service;1"].getService(Ci.nsICacheService);
         try {
           cacheService.evictEntries(Ci.nsICache.STORE_OFFLINE);
         } catch(er) {}
-
-        var storage = Cc["@mozilla.org/dom/storagemanager;1"].getService(Ci.nsIDOMStorageManager);
-        storage.clearOfflineApps();
       },
 
       get canClear()
       {
           return true;
       }
     },
 
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -57,20 +57,16 @@ pref("browser.cache.disk_cache_ssl",    
 // 0 = once-per-session, 1 = each-time, 2 = never, 3 = when-appropriate/automatically
 pref("browser.cache.check_doc_frequency",   3);
 
 pref("browser.cache.offline.enable",           true);
 
 // offline cache capacity in kilobytes
 pref("browser.cache.offline.capacity",         512000);
 
-// offline apps should be limited to this much data in global storage
-// (in kilobytes)
-pref("offline-apps.quota.max",        204800);
-
 // the user should be warned if offline app disk usage exceeds this amount
 // (in kilobytes)
 pref("offline-apps.quota.warn",        51200);
 
 // zlib compression level used for cache compression:
 // 0 => disable compression
 // 1 => best speed
 // 9 => best compression