Bug 1300587 - Fix DevToolsExtensionPageContextParent shutdown method. r=kmag
authorLuca Greco <lgreco@mozilla.com>
Thu, 09 Feb 2017 18:15:38 +0100
changeset 343277 10293eb8e33248ef3758991391835a35cafbc787
parent 343276 d10905c44181e23c0cd131cce317253880028888
child 343278 de8052439ef29cf0d06f836dac9dc4ad3e2ecdbc
push id37479
push userryanvm@gmail.com
push dateThu, 16 Feb 2017 14:25:34 +0000
treeherderautoland@6d4af96450ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1300587
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1300587 - Fix DevToolsExtensionPageContextParent shutdown method. r=kmag - a DevToolsExtensionPageContextParent instance can be missing a devToolsTarget property when it is destroyed (because the devToolsTarget property is set lazily if the extension page is using any API that actually needs a TabTarget instance) - the DevToolsExtensionPageContextParent's shutdown method should call super.shutdown to complete its cleanup. MozReview-Commit-ID: EnxEZ0rrnTT
toolkit/components/extensions/ExtensionParent.jsm
--- a/toolkit/components/extensions/ExtensionParent.jsm
+++ b/toolkit/components/extensions/ExtensionParent.jsm
@@ -432,23 +432,24 @@ class DevToolsExtensionPageContextParent
     return contextDevToolsTarget;
   }
 
   get devToolsTarget() {
     return this._devToolsTarget;
   }
 
   shutdown() {
-    if (!this._devToolsTarget) {
-      throw new Error("no DevTools target is set during DevTools Context shutdown");
+    if (this._devToolsTarget) {
+      this._devToolsTarget.destroy();
+      this._devToolsTarget = null;
     }
 
-    this._devToolsTarget.destroy();
-    this._devToolsTarget = null;
     this._devToolsToolbox = null;
+
+    super.shutdown();
   }
 }
 
 ParentAPIManager = {
   proxyContexts: new Map(),
 
   init() {
     Services.obs.addObserver(this, "message-manager-close", false);