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

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

Issue 1606303003: dumpInspectorProtocolMessages logs objects instead of stringified objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackend.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackend.js b/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackend.js
index 30381196fbdd2cb9159465d5a26fb1be8176c63d..1019627c53da5f41c0ef078765283c082d7c8c1a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackend.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackend.js
@@ -285,7 +285,7 @@ InspectorBackendClass.Connection.prototype = {
var wrappedCallback = this._wrap(callback, domain, method);
if (InspectorBackendClass.Options.dumpInspectorProtocolMessages)
- this._dumpProtocolMessage("frontend: " + JSON.stringify(messageObject));
+ this._dumpProtocolMessage("frontend: ", messageObject);
this.sendMessage(messageObject);
++this._pendingResponsesCount;
@@ -324,11 +324,11 @@ InspectorBackendClass.Connection.prototype = {
*/
dispatch: function(message)
{
- if (InspectorBackendClass.Options.dumpInspectorProtocolMessages)
- this._dumpProtocolMessage("backend: " + ((typeof message === "string") ? message : JSON.stringify(message)));
-
var messageObject = /** @type {!Object} */ ((typeof message === "string") ? JSON.parse(message) : message);
+ if (InspectorBackendClass.Options.dumpInspectorProtocolMessages)
+ this._dumpProtocolMessage("backend: ", messageObject);
+
if ("id" in messageObject) { // just a response for some request
var callback = this._callbacks[messageObject.id];
if (!callback) {
@@ -405,9 +405,9 @@ InspectorBackendClass.Connection.prototype = {
}
},
- _dumpProtocolMessage: function(message)
+ _dumpProtocolMessage: function(message, messageObject)
{
- console.log(message);
+ console.log.call(console, message, messageObject);
},
/**
@@ -635,7 +635,7 @@ InspectorBackendClass.AgentPrototype.prototype = {
{
if (messageObject.error && messageObject.error.code !== InspectorBackendClass._DevToolsErrorCode && messageObject.error.code !== InspectorBackendClass.DevToolsStubErrorCode && !InspectorBackendClass.Options.suppressRequestErrors && !this._suppressErrorLogging) {
var id = InspectorBackendClass.Options.dumpInspectorProtocolMessages ? " with id = " + messageObject.id : "";
- console.error("Request " + methodName + id + " failed. " + JSON.stringify(messageObject.error));
+ console.error("Request " + methodName + id + " failed. ", messageObject.error);
}
var argumentsArray = [];
« 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