Bug 1542609 - Invalidate startup cache when uninstalling a bootstrapped addon; r=mkmelin a=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 08 Apr 2019 20:40:07 +1200
changeset 34003 8554a7176b3eef77f90f337af5f94b9e1e6ec772
parent 34002 7fcb16ec50b1465f4bd0e95215bb45284b5f6ade
child 34004 ac7b1df1919bd110fd4c5ecc5e2939b45ff69977
push id2404
push usermozilla@jorgk.com
push dateTue, 07 May 2019 20:34:08 +0000
treeherdercomm-beta@ac7b1df1919b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1542609
Bug 1542609 - Invalidate startup cache when uninstalling a bootstrapped addon; r=mkmelin a=jorgk
common/src/BootstrapLoader.jsm
--- a/common/src/BootstrapLoader.jsm
+++ b/common/src/BootstrapLoader.jsm
@@ -334,17 +334,22 @@ var BootstrapLoader = {
 
     let install = findMethod("install");
     let uninstall = findMethod("uninstall");
     let startup = findMethod("startup");
     let shutdown = findMethod("shutdown");
 
     return {
       install: (...args) => install(...args),
-      uninstall: (...args) => uninstall(...args),
+
+      uninstall(...args) {
+        uninstall(...args);
+        // Forget any cached files we might've had from this extension.
+        Services.obs.notifyObservers(null, "startupcache-invalidate");
+      },
 
       startup(...args) {
         if (addon.type == "extension") {
           logger.debug(`Registering manifest for ${file.path}\n`);
           Components.manager.addBootstrappedManifestLocation(file);
         }
         return startup(...args);
       },