Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js

Issue 2419943003: DevTools: allow handing over the raw protocol connection to external clients and back. (Closed)
Patch Set: rebaselined Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
index faf2c28d47bad68d81d9cd7e23ac88d148fc3c38..c890ffbdf6a6e9ba333f64867ce2315544cf78a7 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
@@ -55,6 +55,8 @@ WebInspector.AppManifestView.prototype = {
if (this._resourceTreeModel)
return;
var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target);
+ if (!resourceTreeModel)
+ return;
this._resourceTreeModel = resourceTreeModel;
this._updateManifest();
resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this);
@@ -66,6 +68,11 @@ WebInspector.AppManifestView.prototype = {
*/
targetRemoved: function(target)
{
+ var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target);
+ if (!this._resourceTreeModel || this._resourceTreeModel !== resourceTreeModel)
+ return;
+ resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this);
+ delete this._resourceTreeModel;
},
_updateManifest: function()

Powered by Google App Engine
This is Rietveld 408576698