2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2011-12-16 22:36:09 +00:00
|
|
|
|
2012-10-31 16:13:28 +00:00
|
|
|
this.EXPORTED_SYMBOLS = ["OfflineAppCacheHelper"];
|
2011-12-16 22:36:09 +00:00
|
|
|
|
2013-09-20 09:11:25 +00:00
|
|
|
Components.utils.import('resource://gre/modules/LoadContextInfo.jsm');
|
|
|
|
|
2011-12-16 22:36:09 +00:00
|
|
|
const Cc = Components.classes;
|
|
|
|
const Ci = Components.interfaces;
|
|
|
|
|
2012-10-31 16:13:28 +00:00
|
|
|
this.OfflineAppCacheHelper = {
|
2011-12-16 22:36:09 +00:00
|
|
|
clear: function() {
|
2013-09-20 09:11:25 +00:00
|
|
|
var cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
|
|
|
|
var appCacheStorage = cacheService.appCacheStorage(LoadContextInfo.default, null);
|
2011-12-16 22:36:09 +00:00
|
|
|
try {
|
2013-09-20 09:11:25 +00:00
|
|
|
appCacheStorage.asyncEvictStorage(null);
|
2011-12-16 22:36:09 +00:00
|
|
|
} catch(er) {}
|
|
|
|
}
|
|
|
|
};
|