browser/modules/offlineAppCache.jsm
author Joel Maher <jmaher@mozilla.com>
Wed, 11 Oct 2017 08:45:06 -0400
changeset 432365 42c1b2dc8bac015e691fb2e17c95f60f6cb144aa
parent 374674 8cb53491dd1c78d6a6723b9e92919a304122c3f7
child 453235 d4a7c018420e408fbe0a13ffddd2861623fda5a7
permissions -rw-r--r--
Bug 1396803 - Disable test_tabbar_session_restore_button.py TestNoTabbarSessionRestoreButton.test_pref_off_button_does_not_show on osx for frequent failures. r=me, a=test-only

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