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

Unified Diff: Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js

Issue 472353002: DevTools: Get rid of WebInspector.PresentationMessage interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clear event targets map and handle ProjectRemoved Created 6 years, 4 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
« no previous file with comments | « no previous file | Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
diff --git a/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js b/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
index 2e81df3709dc0a0cf86673505cb523ad77221e9a..c34bffd2e742e676cbe89873be4a3c06fb92dfc8 100644
--- a/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
+++ b/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
@@ -21,6 +21,7 @@ WebInspector.DebuggerWorkspaceBinding = function(targetManager, workspace, netwo
targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, this);
targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this);
+ workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved, this);
}
WebInspector.DebuggerWorkspaceBinding.prototype = {
@@ -52,6 +53,20 @@ WebInspector.DebuggerWorkspaceBinding.prototype = {
},
/**
+ * @param {!WebInspector.Event} event
+ */
+ _projectRemoved: function(event)
+ {
+ var project = /** @type {!WebInspector.Project} */ (event.data);
+ var targetDatas = this._targetToData.values();
+ var uiSourceCodes = project.uiSourceCodes();
+ for (var i = 0; i < targetDatas.length; ++i) {
+ for (var j = 0; j < uiSourceCodes.length; ++j)
+ targetDatas[i]._uiSourceCodeRemoved(uiSourceCodes[j]);
+ }
+ },
+
+ /**
* @param {!WebInspector.Script} script
* @param {!WebInspector.DebuggerSourceMapping} sourceMapping
*/
« no previous file with comments | « no previous file | Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698