mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-10 18:33:34 +02:00
Flush literals from cache on :rehash.
This commit is contained in:
@@ -972,8 +972,16 @@ Class.prototype = {
|
|||||||
util.rehashing && !isinstance(Cu.getGlobalForObject(callback), ["BackstagePass"]))
|
util.rehashing && !isinstance(Cu.getGlobalForObject(callback), ["BackstagePass"]))
|
||||||
return;
|
return;
|
||||||
this.timeouts.splice(this.timeouts.indexOf(timer), 1);
|
this.timeouts.splice(this.timeouts.indexOf(timer), 1);
|
||||||
util.trapErrors(callback, this);
|
try {
|
||||||
|
callback.call(this);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
util.dump("Error invoking timer callback registered at " +
|
||||||
|
[frame.filename, frame.lineNumber, ""].join(":"));
|
||||||
|
Cu.reportError(e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
let frame = Cs.caller;
|
||||||
let timer = services.Timer(timeout_notify, timeout || 0, services.Timer.TYPE_ONE_SHOT);
|
let timer = services.Timer(timeout_notify, timeout || 0, services.Timer.TYPE_ONE_SHOT);
|
||||||
this.timeouts.push(timer);
|
this.timeouts.push(timer);
|
||||||
return timer;
|
return timer;
|
||||||
|
|||||||
@@ -138,9 +138,15 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
flush: function flush() {
|
flush: function flush(filter) {
|
||||||
this.storage.clear();
|
if (filter) {
|
||||||
this.flushDiskCache();
|
this.storage.keys().filter(filter)
|
||||||
|
.forEach(bind("remove", this.storage));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.storage.clear();
|
||||||
|
this.flushDiskCache();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
flushDiskCache: function flushDiskCache() {
|
flushDiskCache: function flushDiskCache() {
|
||||||
|
|||||||
@@ -1366,6 +1366,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
storage.storeForSession("commandlineArgs", args);
|
storage.storeForSession("commandlineArgs", args);
|
||||||
this.timeout(function () {
|
this.timeout(function () {
|
||||||
this.flushCache();
|
this.flushCache();
|
||||||
|
cache.flush(bind("test", /^literal:/));
|
||||||
this.rehashing = true;
|
this.rehashing = true;
|
||||||
let addon = config.addon;
|
let addon = config.addon;
|
||||||
addon.userDisabled = true;
|
addon.userDisabled = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user