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

Unified Diff: Source/devtools/front_end/sdk/CompilerScriptMapping.js

Issue 299443016: DevTools: Decouple debugger model from UI entities (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge DebuggerScriptMapping into DebuggerWorkspaceBinding Created 6 years, 5 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: Source/devtools/front_end/sdk/CompilerScriptMapping.js
diff --git a/Source/devtools/front_end/sdk/CompilerScriptMapping.js b/Source/devtools/front_end/sdk/CompilerScriptMapping.js
index 2a62657ae6ff3df359fe0f5a31cb31ee3020d1d2..eb518be263cd866018aadd2023c583edd880e859 100644
--- a/Source/devtools/front_end/sdk/CompilerScriptMapping.js
+++ b/Source/devtools/front_end/sdk/CompilerScriptMapping.js
@@ -34,14 +34,17 @@
* @param {!WebInspector.DebuggerModel} debuggerModel
* @param {!WebInspector.Workspace} workspace
* @param {!WebInspector.NetworkWorkspaceBinding} networkWorkspaceBinding
+ * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding
*/
-WebInspector.CompilerScriptMapping = function(debuggerModel, workspace, networkWorkspaceBinding)
+WebInspector.CompilerScriptMapping = function(debuggerModel, workspace, networkWorkspaceBinding, debuggerWorkspaceBinding)
{
this._target = debuggerModel.target();
this._debuggerModel = debuggerModel;
this._workspace = workspace;
this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAddedToWorkspace, this);
this._networkWorkspaceBinding = networkWorkspaceBinding;
+ this._debuggerWorkspaceBinding = debuggerWorkspaceBinding;
+
/** @type {!Object.<string, !WebInspector.SourceMap>} */
this._sourceMapForSourceMapURL = {};
/** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */
@@ -106,7 +109,7 @@ WebInspector.CompilerScriptMapping.prototype = {
*/
addScript: function(script)
{
- script.pushSourceMapping(this);
+ this._debuggerWorkspaceBinding.pushSourceMapping(script, this);
script.addEventListener(WebInspector.Script.Events.SourceMapURLAdded, this._sourceMapURLAdded.bind(this));
this._processScript(script);
},
@@ -138,7 +141,7 @@ WebInspector.CompilerScriptMapping.prototype = {
if (this._scriptForSourceMap.get(sourceMap)) {
this._sourceMapForScriptId[script.scriptId] = sourceMap;
- script.updateLocations();
+ this._debuggerWorkspaceBinding.updateLocations(script);
return;
}
@@ -161,7 +164,7 @@ WebInspector.CompilerScriptMapping.prototype = {
else
WebInspector.console.error(WebInspector.UIString("Failed to locate workspace file mapped to URL %s from source map %s", sourceURL, sourceMap.url()));
}
- script.updateLocations();
+ this._debuggerWorkspaceBinding.updateLocations(script);
}
},

Powered by Google App Engine
This is Rietveld 408576698