Bug 1332447 part 1 - Pass context to callOnClose() callback ; r?bwinton draft
authorEdouard Oger <eoger@fastmail.com>
Sat, 19 Aug 2017 16:47:59 -0400
changeset 678970 997e5972386a19189fb429aa2a46a8f87d9a0830
parent 678523 f3e939a81ee1169f9501ad96eb43bbf4bf4a1bde
child 678971 9d1fd423c467fed84914f6f5005caca5ef934bbe
push id84092
push userbmo:manishearth@gmail.com
push dateThu, 12 Oct 2017 06:22:32 +0000
reviewersbwinton
bugs1332447
milestone58.0a1
Bug 1332447 part 1 - Pass context to callOnClose() callback ; r?bwinton MozReview-Commit-ID: 2OqLDwrr8Z
toolkit/components/extensions/Extension.jsm
toolkit/components/extensions/ExtensionCommon.jsm
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -1566,17 +1566,17 @@ this.Extension = class extends Extension
       this.policy.active = false;
 
       return this.cleanupGeneratedFile();
     }
 
     GlobalManager.uninit(this);
 
     for (let obj of this.onShutdown) {
-      obj.close();
+      obj.close(this);
     }
 
     for (let api of this.apis) {
       api.destroy();
     }
 
     ParentAPIManager.shutdownExtension(this.id);
 
--- a/toolkit/components/extensions/ExtensionCommon.jsm
+++ b/toolkit/components/extensions/ExtensionCommon.jsm
@@ -501,17 +501,17 @@ class BaseContext {
     this.unloaded = true;
 
     MessageChannel.abortResponses({
       extensionId: this.extension.id,
       contextId: this.contextId,
     });
 
     for (let obj of this.onClose) {
-      obj.close();
+      obj.close(this);
     }
   }
 
   /**
    * A simple proxy for unload(), for use with callOnClose().
    */
   close() {
     this.unload();