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

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

Issue 2563553002: DevTools: Disallow console.log statements with eslint (Closed)
Patch Set: fix tests Created 4 years 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/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 1e5b329e96dafcbd98af2ada1853cdb3b9b878f2..3b03735ed5332c50b784278f600a4dcc53dae7e2 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackend.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackend.js
@@ -337,19 +337,16 @@ Protocol.TargetBase = class {
return;
}
- var processingStartTime;
+ var timingLabel = 'time-stats: ' + callback.methodName;
if (InspectorBackendClass.Options.dumpInspectorTimeStats)
- processingStartTime = Date.now();
+ console.time(timingLabel);
this._agent(callback.domain).dispatchResponse(messageObject, callback.methodName, callback);
--this._pendingResponsesCount;
delete this._callbacks[messageObject.id];
- if (InspectorBackendClass.Options.dumpInspectorTimeStats) {
- console.log(
- 'time-stats: ' + callback.methodName + ' = ' + (processingStartTime - callback.sendRequestTime) + ' + ' +
- (Date.now() - processingStartTime));
- }
+ if (InspectorBackendClass.Options.dumpInspectorTimeStats)
+ console.timeEnd(timingLabel);
if (this._scripts && !this._pendingResponsesCount)
this._deprecatedRunAfterPendingDispatches();
@@ -416,7 +413,7 @@ Protocol.TargetBase = class {
* @param {string} message
*/
_dumpProtocolMessage(message) {
- console.log(message);
+ console.log(message); // eslint-disable-line no-console
}
/**
@@ -713,14 +710,14 @@ InspectorBackendClass._DispatcherPrototype = class {
params.push(messageObject.params[paramNames[i]]);
}
- var processingStartTime;
+ var timingLabel = 'time-stats: ' + messageObject.method;
if (InspectorBackendClass.Options.dumpInspectorTimeStats)
- processingStartTime = Date.now();
+ console.time(timingLabel);
this._dispatcher[functionName].apply(this._dispatcher, params);
if (InspectorBackendClass.Options.dumpInspectorTimeStats)
- console.log('time-stats: ' + messageObject.method + ' = ' + (Date.now() - processingStartTime));
+ console.timeEnd(timingLabel);
}
};

Powered by Google App Engine
This is Rietveld 408576698