diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-10-01 13:02:26 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-10-01 13:02:26 -0400 |
commit | 8ef35fee8bdce22bc5899d94e5cfd5670fb885c7 (patch) | |
tree | 527a2ec56685ad7b85892dabe66ba8be5299bd59 /common/modules/cache.jsm | |
parent | 2d7c78e162d8bfcfcdb6cebed8ab2692a10d9401 (diff) | |
download | pentadactyl-8ef35fee8bdce22bc5899d94e5cfd5670fb885c7.tar.gz |
Include config.json in XPI. Closes issue \#670.
Diffstat (limited to 'common/modules/cache.jsm')
-rw-r--r-- | common/modules/cache.jsm | 13 |
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(); |