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

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

Issue 2563553002: DevTools: Disallow console.log statements with eslint (Closed)
Patch Set: merge 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..60e6dee3e6ebb0c093ad2d9533ea80f67c6f60eb 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,15 @@ Protocol.TargetBase = class {
return;
}
- var processingStartTime;
if (InspectorBackendClass.Options.dumpInspectorTimeStats)
- processingStartTime = Date.now();
+ console.time('time-stats: ' + callback.methodName);
chenwilliam 2016/12/08 20:00:23 maybe extract the label for console.time into a co
einbinder 2016/12/09 01:16:05 Done.
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('time-stats: ' + callback.methodName);
if (this._scripts && !this._pendingResponsesCount)
this._deprecatedRunAfterPendingDispatches();
@@ -416,7 +412,7 @@ Protocol.TargetBase = class {
* @param {string} message
*/
_dumpProtocolMessage(message) {
- console.log(message);
+ console.log(message); // eslint-disable-line no-console
}
/**
@@ -713,14 +709,13 @@ InspectorBackendClass._DispatcherPrototype = class {
params.push(messageObject.params[paramNames[i]]);
}
- var processingStartTime;
if (InspectorBackendClass.Options.dumpInspectorTimeStats)
- processingStartTime = Date.now();
+ console.time('time-stats: ' + messageObject.method);
this._dispatcher[functionName].apply(this._dispatcher, params);
if (InspectorBackendClass.Options.dumpInspectorTimeStats)
- console.log('time-stats: ' + messageObject.method + ' = ' + (Date.now() - processingStartTime));
+ console.timeEnd('time-stats: ' + messageObject.method);
}
};

Powered by Google App Engine
This is Rietveld 408576698