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

Unified Diff: Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 464963002: DevTools: Make UISourceCode Target-agnostic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/devtools/front_end/sources/JavaScriptSourceFrame.js
diff --git a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
index 5c63c7d42e1405cd7f7e85961f14a968ea872fc2..e8f536b163a05f698b6eb10ddfdf4a83bae862e9 100644
--- a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
+++ b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -67,7 +67,7 @@ WebInspector.JavaScriptSourceFrame = function(scriptsPanel, uiSourceCode)
this._registerShortcuts();
var targets = WebInspector.targetManager.targets();
for (var i = 0; i < targets.length; ++i) {
- var scriptFile = uiSourceCode.scriptFileForTarget(targets[i]);
+ var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(uiSourceCode, targets[i]);
if (scriptFile)
this._updateScriptFile(targets[i]);
}
@@ -286,6 +286,8 @@ WebInspector.JavaScriptSourceFrame.prototype = {
function liveEdit(liveEditSupport)
{
var liveEditUISourceCode = liveEditSupport.uiSourceCodeForLiveEdit(this._uiSourceCode);
+ if (!liveEditUISourceCode)
+ return;
WebInspector.Revealer.reveal(liveEditUISourceCode.uiLocation(lineNumber));
}
@@ -767,7 +769,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
{
var linesCount = this.textEditor.linesCount;
for (var i = 0; i < linesCount; ++i)
- this.textEditor.toggleLineClass(i, "cm-line-without-source-mapping", !this._uiSourceCode.uiLineHasMapping(i));
+ this.textEditor.toggleLineClass(i, "cm-line-without-source-mapping", !WebInspector.debuggerWorkspaceBinding.uiLineHasMapping(this._uiSourceCode, i));
},
/**
@@ -776,7 +778,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
_updateScriptFile: function(target)
{
var oldScriptFile = this._scriptFileForTarget.get(target);
- var newScriptFile = this._uiSourceCode.scriptFileForTarget(target);
+ var newScriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(this._uiSourceCode, target);
this._scriptFileForTarget.remove(target);
if (oldScriptFile) {
oldScriptFile.removeEventListener(WebInspector.ResourceScriptFile.Events.DidMergeToVM, this._didMergeToVM, this);
@@ -893,6 +895,8 @@ WebInspector.JavaScriptSourceFrame.prototype = {
if (!executionContext)
return;
var rawLocation = WebInspector.debuggerWorkspaceBinding.uiLocationToRawLocation(executionContext.target(), this._uiSourceCode, lineNumber, 0);
+ if (!rawLocation)
+ return;
this._scriptsPanel.continueToLocation(rawLocation);
},

Powered by Google App Engine
This is Rietveld 408576698