browser/modules/offlineAppCache.jsm
author Honza Bambas <honzab.moz@firemni.cz>
Fri, 20 Sep 2013 11:11:25 +0200
changeset 148125 0c91d9aa9476a9c2c6eb01e6142267d7987977e2
parent 111947 5ce71981e005a52d4cb0b831ad3db9284f2fb356
child 283165 6c56f5dad3b24506c41d5a38115d19456fe2a802
permissions -rw-r--r--
Bug 913807 - HTTP cache v2: API+top service+integration+tests, off by default, r=michal+ehsan+mark.finkle+fabrice+mhammond+gavin

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
this.EXPORTED_SYMBOLS = ["OfflineAppCacheHelper"];

Components.utils.import('resource://gre/modules/LoadContextInfo.jsm');

const Cc = Components.classes;
const Ci = Components.interfaces;

this.OfflineAppCacheHelper = {
  clear: function() {
    var cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
    var appCacheStorage = cacheService.appCacheStorage(LoadContextInfo.default, null);
    try {
      appCacheStorage.asyncEvictStorage(null);
    } catch(er) {}
  }
};