Web Inspector: Give console.time/timeEnd a default label and warnings
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 01:08:49 +0000 (01:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 01:08:49 +0000 (01:08 +0000)
commitd416ea417f570c62f7b331af95f944e91f5dea7d
tree0c748e90ad438ef8b42deb2cab4a00d86d4413f7
parent89f6fc137df93541f040bd0fd930c3bd45dc6b26
Web Inspector: Give console.time/timeEnd a default label and warnings
https://bugs.webkit.org/show_bug.cgi?id=157325
<rdar://problem/26073290>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-03
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Provide more user friendly console.time/timeEnd. The timer name
is now optional, and is "default" if not provided. Also provide
warnings when attempting to start an already started timer,
or stop a timer that does not exist.

* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::startTiming):
(Inspector::InspectorConsoleAgent::stopTiming):
Warnings for bad cases.

* runtime/ConsoleObject.cpp:
(JSC::defaultLabelString):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
Optional label becomes "default".

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js:
Update the convenience signature.

LayoutTests:

* inspector/console/console-time-expected.txt: Added.
* inspector/console/console-time.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/console/console-time-expected.txt [new file with mode: 0644]
LayoutTests/inspector/console/console-time.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp
Source/JavaScriptCore/runtime/ConsoleObject.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js