Auto record a profile for FunctionCall and EvaluateScript timeline records.
Created attachment 222291 [details]
Attachment 222291 [details] did not pass style-queue:
ERROR: Source/WebCore/bindings/js/JSCallbackData.cpp:80: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] 
ERROR: Source/WebCore/bindings/js/JSEventListener.cpp:136: Wrong number of spaces before statement. (expected: 16) [whitespace/indent] 
Total errors found: 2 in 20 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 222291 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=222291&action=review
r=me, looks fine I'd be worried about a lot of extra / duplicated data being sent to the frontend.
Also it would be really great to include a test for this. LayoutTests/inspector-protocol/timeline/profiler-data-in-script-execution.html or something like that.
> + RefPtr<ScriptProfile> profile = ScriptProfiler::stop(toJSDOMWindow(frame, debuggerWorld())->globalExec(), ASCIILiteral("Timeline EvaluateScript"));
> + TimelineRecordFactory::appendProfile(entry.data.get(), profile.release());
Seems like we could be duplicating a bunch of data sent to the frontend?
It seems nested ScriptProfiler::start/stops are fine, but each time it stops it sends an entire profiler, much of which could be data already captured and sent in another profile?
I know you measured, what was the performance impact of this?
> + data->setValue("profile", profile->buildInspectorObjectForHead());