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

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

Issue 222143003: DevTools: Make ConsoleMessage TargetAware (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@console-cpp-exec-context
Patch Set: Rebase 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/CPUProfileView.js ('k') | Source/devtools/front_end/ConsoleView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ConsoleModel.js
diff --git a/Source/devtools/front_end/ConsoleModel.js b/Source/devtools/front_end/ConsoleModel.js
index a19659a3dabf9a05efb7d2589c13b0e9d0e788ca..470ad381ae38b91d18603d1e86e75d9e3bb07ce4 100644
--- a/Source/devtools/front_end/ConsoleModel.js
+++ b/Source/devtools/front_end/ConsoleModel.js
@@ -102,7 +102,7 @@ WebInspector.ConsoleModel.prototype = {
{
this.show();
- var commandMessage = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageType.Command);
+ var commandMessage = new WebInspector.ConsoleMessage(this.target(), WebInspector.ConsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageType.Command);
this.addMessage(commandMessage);
/**
@@ -144,6 +144,7 @@ WebInspector.ConsoleModel.prototype = {
log: function(messageText, messageLevel, showConsole)
{
var message = new WebInspector.ConsoleMessage(
+ this.target(),
WebInspector.ConsoleMessage.MessageSource.Other,
messageLevel || WebInspector.ConsoleMessage.MessageLevel.Debug,
messageText);
@@ -196,6 +197,8 @@ WebInspector.ConsoleModel.prototype = {
/**
* @constructor
+ * @extends {WebInspector.TargetAware}
+ * @param {!WebInspector.Target} target
* @param {string} source
* @param {?string} level
* @param {string} messageText
@@ -210,9 +213,9 @@ WebInspector.ConsoleModel.prototype = {
* @param {boolean=} isOutdated
* @param {!RuntimeAgent.ExecutionContextId=} executionContextId
*/
-
-WebInspector.ConsoleMessage = function(source, level, messageText, type, url, line, column, requestId, parameters, stackTrace, timestamp, isOutdated, executionContextId)
+WebInspector.ConsoleMessage = function(target, source, level, messageText, type, url, line, column, requestId, parameters, stackTrace, timestamp, isOutdated, executionContextId)
{
+ WebInspector.TargetAware.call(this, target);
this.source = source;
this.level = level;
this.messageText = messageText;
@@ -255,6 +258,7 @@ WebInspector.ConsoleMessage.prototype = {
clone: function()
{
return new WebInspector.ConsoleMessage(
+ this.target(),
this.source,
this.level,
this.messageText,
@@ -310,7 +314,9 @@ WebInspector.ConsoleMessage.prototype = {
&& (this.url === msg.url)
&& (this.messageText === msg.messageText)
&& (this.request === msg.request);
- }
+ },
+
+ __proto__: WebInspector.TargetAware.prototype
}
// Note: Keep these constants in sync with the ones in Console.h
@@ -379,6 +385,7 @@ WebInspector.ConsoleDispatcher.prototype = {
messageAdded: function(payload)
{
var consoleMessage = new WebInspector.ConsoleMessage(
+ this._console.target(),
payload.source,
payload.level,
payload.text,
« no previous file with comments | « Source/devtools/front_end/CPUProfileView.js ('k') | Source/devtools/front_end/ConsoleView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698