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

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

Issue 355823002: DevTools: Use in JavaScriptSourceFrame current target's debuggerModel instead of WebInspector.debug (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address vsevik's comment Created 6 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f2331b8913c89994b9ae2f855f63f3babf659da0..0d197750ebc3a451842c6ab870d148dd0da6dd25 100644
--- a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
+++ b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -422,7 +422,8 @@ WebInspector.JavaScriptSourceFrame.prototype = {
_getPopoverAnchor: function(element, event)
{
- if (!WebInspector.debuggerModel.isPaused())
+ var target = WebInspector.context.flavor(WebInspector.Target);
+ if (!target || !target.debuggerModel.isPaused())
return null;
var textPosition = this.textEditor.coordinatesToCursorPosition(event.x, event.y);
@@ -473,7 +474,8 @@ WebInspector.JavaScriptSourceFrame.prototype = {
_resolveObjectForPopover: function(anchorBox, showCallback, objectGroupName)
{
- if (!WebInspector.debuggerModel.isPaused()) {
+ var target = WebInspector.context.flavor(WebInspector.Target);
+ if (!target || !target.debuggerModel.isPaused()) {
this._popoverHelper.hidePopover();
return;
}
@@ -492,7 +494,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
}
}
var evaluationText = line.substring(startHighlight, endHighlight + 1);
- var selectedCallFrame = WebInspector.debuggerModel.selectedCallFrame();
+ var selectedCallFrame = target.debuggerModel.selectedCallFrame();
selectedCallFrame.evaluate(evaluationText, objectGroupName, false, true, false, false, showObjectPopover.bind(this));
/**
@@ -502,12 +504,13 @@ WebInspector.JavaScriptSourceFrame.prototype = {
*/
function showObjectPopover(result, wasThrown)
{
- if (!WebInspector.debuggerModel.isPaused() || !result) {
+ var target = WebInspector.context.flavor(WebInspector.Target);
+ if (selectedCallFrame.target() != target || !target.debuggerModel.isPaused() || !result) {
this._popoverHelper.hidePopover();
return;
}
this._popoverAnchorBox = anchorBox;
- showCallback(selectedCallFrame.target().runtimeModel.createRemoteObject(result), wasThrown, this._popoverAnchorBox);
+ showCallback(target.runtimeModel.createRemoteObject(result), wasThrown, this._popoverAnchorBox);
// Popover may have been removed by showCallback().
if (this._popoverAnchorBox) {
var highlightRange = new WebInspector.TextRange(lineNumber, startHighlight, lineNumber, endHighlight);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698