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

Unified Diff: Source/devtools/front_end/ConsoleViewMessage.js

Issue 220903002: DevTools: wrap DebuggerAgent.Location with DebuggerModel.Location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: All tests!!! Created 6 years, 9 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 | « Source/devtools/front_end/ConsoleView.js ('k') | Source/devtools/front_end/DOMModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ConsoleViewMessage.js
diff --git a/Source/devtools/front_end/ConsoleViewMessage.js b/Source/devtools/front_end/ConsoleViewMessage.js
index 546070506ff6c54a301ab2635ee580b0af529eed..c543c33b883042faab937bef0747a6abb07ac743 100644
--- a/Source/devtools/front_end/ConsoleViewMessage.js
+++ b/Source/devtools/front_end/ConsoleViewMessage.js
@@ -30,15 +30,16 @@
/**
* @constructor
+ * @extends {WebInspector.TargetAware}
* @param {!WebInspector.Target} target
* @param {!WebInspector.ConsoleMessage} consoleMessage
* @param {?WebInspector.Linkifier} linkifier
*/
WebInspector.ConsoleViewMessage = function(target, consoleMessage, linkifier)
{
+ WebInspector.TargetAware.call(this, target);
this._message = consoleMessage;
this._linkifier = linkifier;
- this._target = target;
this._repeatCount = 1;
/** @type {!Array.<!WebInspector.DataGrid>} */
@@ -223,8 +224,8 @@ WebInspector.ConsoleViewMessage.prototype = {
lineNumber = lineNumber ? lineNumber - 1 : 0;
columnNumber = columnNumber ? columnNumber - 1 : 0;
if (this._message.source === WebInspector.ConsoleMessage.MessageSource.CSS) {
- var headerIds = WebInspector.cssModel.styleSheetIdsForURL(url);
- var cssLocation = new WebInspector.CSSLocation(url, lineNumber, columnNumber);
+ var headerIds = this.target().cssModel.styleSheetIdsForURL(url);
+ var cssLocation = new WebInspector.CSSLocation(this.target(), url, lineNumber, columnNumber);
return this._linkifier.linkifyCSSLocation(headerIds[0] || null, cssLocation, "console-message-url");
}
@@ -243,7 +244,7 @@ WebInspector.ConsoleViewMessage.prototype = {
// FIXME(62725): stack trace line/column numbers are one-based.
var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0;
var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 : 0;
- var rawLocation = new WebInspector.DebuggerModel.Location(callFrame.scriptId, lineNumber, columnNumber);
+ var rawLocation = new WebInspector.DebuggerModel.Location(this.target(), callFrame.scriptId, lineNumber, columnNumber);
return this._linkifier.linkifyRawLocation(rawLocation, "console-message-url");
},
@@ -264,7 +265,7 @@ WebInspector.ConsoleViewMessage.prototype = {
if (!regex)
return callFrame;
for (var i = 0; i < stackTrace.length; ++i) {
- var script = this._target.debuggerModel.scriptForId(stackTrace[i].scriptId);
+ var script = this.target().debuggerModel.scriptForId(stackTrace[i].scriptId);
if (!script || !regex.test(script.sourceURL))
return stackTrace[i].scriptId ? stackTrace[i] : null;
}
@@ -294,9 +295,9 @@ WebInspector.ConsoleViewMessage.prototype = {
continue;
if (typeof parameters[i] === "object")
- parameters[i] = this._target.runtimeModel.createRemoteObject(parameters[i], this._target);
+ parameters[i] = this.target().runtimeModel.createRemoteObject(parameters[i]);
else
- parameters[i] = this._target.runtimeModel.createRemoteObjectFromPrimitiveValue(parameters[i]);
+ parameters[i] = this.target().runtimeModel.createRemoteObjectFromPrimitiveValue(parameters[i]);
}
// There can be string log and string eval result. We distinguish between them based on message type.
@@ -498,7 +499,7 @@ WebInspector.ConsoleViewMessage.prototype = {
this._formatParameterAsObject(object, elem, false);
return;
}
- var node = this._target.domModel.nodeForId(nodeId);
+ var node = this.target().domModel.nodeForId(nodeId);
var renderer = WebInspector.moduleManager.instance(WebInspector.Renderer, node);
if (renderer)
elem.appendChild(renderer.render(node));
@@ -1076,5 +1077,7 @@ WebInspector.ConsoleViewMessage.prototype = {
get text()
{
return this._message.messageText;
- }
+ },
+
+ __proto__: WebInspector.TargetAware.prototype
}
« no previous file with comments | « Source/devtools/front_end/ConsoleView.js ('k') | Source/devtools/front_end/DOMModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698