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

Unified Diff: Source/devtools/front_end/sdk/LiveEditSupport.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/LiveEditSupport.js
diff --git a/Source/devtools/front_end/sdk/LiveEditSupport.js b/Source/devtools/front_end/sdk/LiveEditSupport.js
index d11704be117ad62788419fa9065a57466372212f..7aa493fa9b90d68f8009bc4d4f902183497f25b2 100644
--- a/Source/devtools/front_end/sdk/LiveEditSupport.js
+++ b/Source/devtools/front_end/sdk/LiveEditSupport.js
@@ -33,11 +33,13 @@
* @extends {WebInspector.SDKObject}
* @param {!WebInspector.Target} target
* @param {!WebInspector.Workspace} workspace
+ * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding
*/
-WebInspector.LiveEditSupport = function(target, workspace)
+WebInspector.LiveEditSupport = function(target, workspace, debuggerWorkspaceBinding)
{
WebInspector.SDKObject.call(this, target);
this._workspace = workspace;
+ this._debuggerWorkspaceBinding = debuggerWorkspaceBinding;
this._projectId = "liveedit:" + target.id();
this._projectDelegate = new WebInspector.DebuggerProjectDelegate(workspace, this._projectId, WebInspector.projectTypes.LiveEdit);
target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
@@ -51,8 +53,8 @@ WebInspector.LiveEditSupport.prototype = {
*/
uiSourceCodeForLiveEdit: function(uiSourceCode)
{
- var debuggerModelLocation = WebInspector.debuggerWorkspaceBinding.uiLocationToRawLocation(this.target(), uiSourceCode, 0, 0);
- var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(debuggerModelLocation);
+ var debuggerModelLocation = this._debuggerWorkspaceBinding.uiLocationToRawLocation(this.target(), uiSourceCode, 0, 0);
+ var uiLocation = this._debuggerWorkspaceBinding.rawLocationToUILocation(debuggerModelLocation);
// FIXME: Support live editing of scripts mapped to some file.
if (uiLocation.uiSourceCode !== uiSourceCode)
@@ -124,8 +126,7 @@ WebInspector.LiveEditSupport.liveEditSupportForUISourceCode = function(uiSourceC
break;
}
}
- var mapping = WebInspector.DebuggerScriptMapping.registry.instance(target);
- return mapping ? mapping.liveEditSupport() : null;
+ return target ? WebInspector.debuggerWorkspaceBinding.liveEditSupport(target) : null;
}
/**

Powered by Google App Engine
This is Rietveld 408576698