summaryrefslogtreecommitdiff
path: root/common/modules/cache.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-10-01 13:02:26 -0400
committerKris Maglione <maglione.k@gmail.com>2011-10-01 13:02:26 -0400
commit8ef35fee8bdce22bc5899d94e5cfd5670fb885c7 (patch)
tree527a2ec56685ad7b85892dabe66ba8be5299bd59 /common/modules/cache.jsm
parent2d7c78e162d8bfcfcdb6cebed8ab2692a10d9401 (diff)
downloadpentadactyl-8ef35fee8bdce22bc5899d94e5cfd5670fb885c7.tar.gz
Include config.json in XPI. Closes issue \#670.
Diffstat (limited to 'common/modules/cache.jsm')
-rw-r--r--common/modules/cache.jsm13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/modules/cache.jsm b/common/modules/cache.jsm
index 6bc5faa6..6b209a04 100644
--- a/common/modules/cache.jsm
+++ b/common/modules/cache.jsm
@@ -15,6 +15,7 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), {
this.queue = [];
this.cache = {};
this.providers = {};
+ this.providing = {};
this.localProviders = {};
if (JSMLoader.cacheFlush)
@@ -176,8 +177,16 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), {
}
if (Set.has(this.providers, name)) {
- let [func, self] = this.providers[name];
- this.cache[name] = func.call(self || this, name);
+ util.assert(!Set.add(this.providing, name),
+ "Already generating cache for " + name,
+ false);
+ try {
+ let [func, self] = this.providers[name];
+ this.cache[name] = func.call(self || this, name);
+ }
+ finally {
+ delete this.providing[name];
+ }
cache.queue.push([Date.now(), name]);
cache.processQueue();