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

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

Issue 2151273003: [DevTools] Move browser logging from Console domain to Log domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@internals-method
Patch Set: protocol improvements Created 4 years, 5 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: third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
index 071f70bf707121c1f7767dde60ccf7bca2fc01e6..fa6e543c1ef80733472cedebb8a922e75fd77b2c 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
@@ -44,9 +44,9 @@ WebInspector.ConsoleModel = function(target)
this._warnings = 0;
this._errors = 0;
this._revokedErrors = 0;
- this._consoleAgent = target.consoleAgent();
- target.registerConsoleDispatcher(new WebInspector.ConsoleDispatcher(this));
- this._enableAgent();
+ this._logAgent = target.logAgent();
+ target.registerLogDispatcher(new WebInspector.LogDispatcher(this));
+ this._logAgent.enable();
}
WebInspector.ConsoleModel.Events = {
@@ -57,20 +57,6 @@ WebInspector.ConsoleModel.Events = {
}
WebInspector.ConsoleModel.prototype = {
- _enableAgent: function()
- {
- this._enablingConsole = true;
-
- /**
- * @this {WebInspector.ConsoleModel}
- */
- function callback()
- {
- delete this._enablingConsole;
- }
- this._consoleAgent.enable(callback.bind(this));
- },
-
/**
* @param {!WebInspector.ConsoleMessage} msg
*/
@@ -147,7 +133,7 @@ WebInspector.ConsoleModel.prototype = {
requestClearMessages: function()
{
- this._consoleAgent.clearMessages();
+ this._logAgent.clear();
this.clear();
},
@@ -251,14 +237,6 @@ WebInspector.ConsoleModel.evaluateCommandInConsole = function(executionContext,
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ConsoleEvaluated);
}
-WebInspector.ConsoleModel.clearConsole = function()
-{
- var targets = WebInspector.targetManager.targets();
- for (var i = 0; i < targets.length; ++i)
- targets[i].consoleModel.requestClearMessages();
-}
-
-
/**
* @constructor
* @param {?WebInspector.Target} target
@@ -523,55 +501,38 @@ WebInspector.ConsoleMessage.timestampComparator = function(a, b)
/**
* @constructor
- * @implements {ConsoleAgent.Dispatcher}
+ * @implements {LogAgent.Dispatcher}
* @param {!WebInspector.ConsoleModel} console
*/
-WebInspector.ConsoleDispatcher = function(console)
+WebInspector.LogDispatcher = function(console)
{
this._console = console;
}
-WebInspector.ConsoleDispatcher.prototype = {
+WebInspector.LogDispatcher.prototype = {
/**
* @override
- * @param {!ConsoleAgent.ConsoleMessage} payload
+ * @param {!LogAgent.LogEntry} payload
*/
- messageAdded: function(payload)
+ entryAdded: function(payload)
{
- if (payload.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI)
- return;
var consoleMessage = new WebInspector.ConsoleMessage(
this._console.target(),
payload.source,
payload.level,
payload.text,
- payload.type,
+ undefined,
payload.url,
- payload.line,
- payload.column,
+ typeof payload.lineNumber === "undefined" ? undefined : payload.lineNumber + 1,
+ undefined,
payload.networkRequestId,
- payload.parameters,
- payload.stack,
+ undefined,
+ payload.stackTrace,
payload.timestamp,
- payload.executionContextId,
- payload.scriptId,
+ undefined,
+ undefined,
payload.workerId);
this._console.addMessage(consoleMessage);
- },
-
- /**
- * @override
- * @param {number} count
- */
- messageRepeatCountUpdated: function(count)
- {
- },
-
- /**
- * @override
- */
- messagesCleared: function()
- {
}
}

Powered by Google App Engine
This is Rietveld 408576698