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

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

Issue 298333003: DevTools: Implement console message logging through an extension (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Implement a common MessageSink Created 6 years, 7 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/ConsoleModel.js
diff --git a/Source/devtools/front_end/sdk/ConsoleModel.js b/Source/devtools/front_end/sdk/ConsoleModel.js
index 23578f264fce8de0563a19f27260e1bc31c1988c..d670a68866614e487a63dc1470bfddfcb869d0fb 100644
--- a/Source/devtools/front_end/sdk/ConsoleModel.js
+++ b/Source/devtools/front_end/sdk/ConsoleModel.js
@@ -118,14 +118,6 @@ WebInspector.ConsoleModel.prototype = {
},
/**
- * @param {string} error
- */
- showErrorMessage: function(error)
- {
- this.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true);
- },
-
- /**
* @param {!WebInspector.ConsoleMessage} msg
*/
_incrementErrorWarningCount: function(msg)
@@ -193,8 +185,7 @@ WebInspector.ConsoleModel.evaluateCommandInConsole = function(executionContext,
/**
* @constructor
- * @extends {WebInspector.TargetAware}
- * @param {!WebInspector.Target} target
+ * @param {?WebInspector.Target} target
* @param {string} source
* @param {?string} level
* @param {string} messageText
@@ -211,7 +202,7 @@ WebInspector.ConsoleModel.evaluateCommandInConsole = function(executionContext,
*/
WebInspector.ConsoleMessage = function(target, source, level, messageText, type, url, line, column, requestId, parameters, stackTrace, timestamp, isOutdated, executionContextId)
{
- WebInspector.TargetAware.call(this, target);
+ this._target = target;
this.source = source;
this.level = level;
this.messageText = messageText;
@@ -238,6 +229,14 @@ WebInspector.ConsoleMessage = function(target, source, level, messageText, type,
WebInspector.ConsoleMessage.prototype = {
/**
+ * @return {?WebInspector.Target}
+ */
+ target: function()
+ {
+ return this._target;
+ },
+
+ /**
* @param {!WebInspector.ConsoleMessage} originatingMessage
*/
setOriginatingMessage: function(originatingMessage)
@@ -344,9 +343,7 @@ WebInspector.ConsoleMessage.prototype = {
&& (this.messageText === msg.messageText)
&& (this.request === msg.request)
&& (this.executionContextId === msg.executionContextId);
- },
-
- __proto__: WebInspector.TargetAware.prototype
+ }
}
// Note: Keep these constants in sync with the ones in Console.h
@@ -367,6 +364,18 @@ WebInspector.ConsoleMessage.MessageSource = {
Deprecation: "deprecation"
}
+
+/**
+ * @enum {string}
+ */
+WebInspector.ConsoleMessage.MessageLevel = {
sergeyv 2014/05/29 12:44:06 Why did you move it?
apavlov 2014/05/29 13:47:46 Oops, missed the original location...
+ Log: "log",
+ Info: "info",
+ Warning: "warning",
+ Error: "error",
+ Debug: "debug"
+}
+
/**
* @enum {string}
*/
@@ -388,20 +397,9 @@ WebInspector.ConsoleMessage.MessageType = {
}
/**
- * @enum {string}
- */
-WebInspector.ConsoleMessage.MessageLevel = {
- Log: "log",
- Info: "info",
- Warning: "warning",
- Error: "error",
- Debug: "debug"
-}
-
-/**
* @param {!WebInspector.ConsoleMessage} a
* @param {!WebInspector.ConsoleMessage} b
- * @return number
+ * @return {number}
*/
WebInspector.ConsoleMessage.timestampComparator = function (a, b)
{

Powered by Google App Engine
This is Rietveld 408576698