Bug 526230 - nsIApplicationCacheService::getGroups count outparam should be optional. r=honzab
authorDão Gottwald <dao@mozilla.com>
Wed, 04 Nov 2009 20:23:20 +0100
changeset 34540 3d5cde53f9298b528ab1f618f2be9e2a26cb2851
parent 34539 d89369248cbff1b00114177812b46634ba3edb5d
child 34541 d59175a25fc6a632e2e1bfabd0a625f2a5dcda97
push id10108
push userdgottwald@mozilla.com
push dateWed, 04 Nov 2009 19:24:14 +0000
treeherdermozilla-central@3d5cde53f929 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab
bugs526230
milestone1.9.3a1pre
Bug 526230 - nsIApplicationCacheService::getGroups count outparam should be optional. r=honzab
browser/base/content/browser.js
browser/components/preferences/advanced.js
netwerk/base/public/nsIApplicationCacheService.idl
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5463,19 +5463,19 @@ var OfflineApps = {
            Ci.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
   },
 
   // XXX: duplicated in preferences/advanced.js
   _getOfflineAppUsage: function (host, groups)
   {
     var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                        getService(Components.interfaces.nsIApplicationCacheService);
-    if (!groups) {
-      groups = cacheService.getGroups({});
-    }
+    if (!groups)
+      groups = cacheService.getGroups();
+
     var ios = Components.classes["@mozilla.org/network/io-service;1"].
               getService(Components.interfaces.nsIIOService);
 
     var usage = 0;
     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]);
--- a/browser/components/preferences/advanced.js
+++ b/browser/components/preferences/advanced.js
@@ -214,19 +214,19 @@ var gAdvancedPane = {
                                         "", params);
   },
 
   // XXX: duplicated in browser.js
   _getOfflineAppUsage: function (host, groups)
   {
     var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                        getService(Components.interfaces.nsIApplicationCacheService);
-    if (!groups) {
-      groups = cacheService.getGroups({});
-    }
+    if (!groups)
+      groups = cacheService.getGroups();
+
     var ios = Components.classes["@mozilla.org/network/io-service;1"].
               getService(Components.interfaces.nsIIOService);
 
     var usage = 0;
     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]);
@@ -251,17 +251,17 @@ var gAdvancedPane = {
 
     var list = document.getElementById("offlineAppsList");
     while (list.firstChild) {
       list.removeChild(list.firstChild);
     }
 
     var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                        getService(Components.interfaces.nsIApplicationCacheService);
-    var groups = cacheService.getGroups({});
+    var groups = cacheService.getGroups();
 
     var bundle = document.getElementById("bundlePreferences");
 
     var enumerator = pm.enumerator;
     while (enumerator.hasMoreElements()) {
       var perm = enumerator.getNext().QueryInterface(Components.interfaces.nsIPermission);
       if (perm.type == "offline-app" &&
           perm.capability != Components.interfaces.nsIPermissionManager.DEFAULT_ACTION &&
@@ -311,17 +311,17 @@ var gAdvancedPane = {
     if (result != 0)
       return;
 
     // clear offline cache entries
     var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                        getService(Components.interfaces.nsIApplicationCacheService);
     var ios = Components.classes["@mozilla.org/network/io-service;1"].
               getService(Components.interfaces.nsIIOService);
-    var groups = cacheService.getGroups({});
+    var groups = cacheService.getGroups();
     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();
         }
     }
 
--- a/netwerk/base/public/nsIApplicationCacheService.idl
+++ b/netwerk/base/public/nsIApplicationCacheService.idl
@@ -86,11 +86,11 @@ interface nsIApplicationCacheService : n
      * @param key
      *        The cache entry key.
      */
     void cacheOpportunistically(in nsIApplicationCache cache, in ACString key);
 
     /**
      * Get the list of application cache groups.
      */
-    void getGroups(out unsigned long count,
+    void getGroups([optional] out unsigned long count,
                    [array, size_is(count), retval] out string groupIDs);
 };