browser/modules/offlineAppCache.jsm
author Daniel Stenberg <daniel@haxx.se>
Tue, 14 Oct 2014 04:44:00 -0400
changeset 210350 8754d79ca14c1b58d13408533637066b3ddce47b
parent 148125 0c91d9aa9476a9c2c6eb01e6142267d7987977e2
child 283165 6c56f5dad3b24506c41d5a38115d19456fe2a802
permissions -rw-r--r--
Bug 1008091 - Send network change events on FxOS and Linux. r=sworkman

/* 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) {}
  }
};