Make console.profile record to the Timeline.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jul 2014 21:16:46 +0000 (21:16 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jul 2014 21:16:46 +0000 (21:16 +0000)
commitfb822337d0d014ac08bebab8f7d4ccd661fb478c
tree85760f384e73904768131e39961519ba1acda6f0
parent1f0287c88a658b3da90f9cdc3cdec1fc27fe8cf0
Make console.profile record to the Timeline.

https://bugs.webkit.org/show_bug.cgi?id=134643

Reviewed by Joseph Pecoraro.

Source/WebCore:
Passes existing profiler tests in fast/profiler.

* bindings/js/ScriptState.cpp:
(WebCore::domWindowFromExecState):
(WebCore::frameFromExecState):
(WebCore::scriptExecutionContextFromExecState):
(WebCore::mainWorldExecState):
(WebCore::execStateFromNode):
* bindings/js/ScriptState.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::profilerEnabled):
(WebCore::InspectorController::setProfilerEnabled):
* inspector/InspectorController.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::startProfilingImpl):
(WebCore::InspectorInstrumentation::stopProfilingImpl):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
(WebCore::startProfiling):
(WebCore::stopProfiling):
(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::stopFromConsole):
(WebCore::InspectorTimelineAgent::didWriteHTML):
(WebCore::InspectorTimelineAgent::breakpointActionProbe):
(WebCore::toProtocol):
(WebCore::InspectorTimelineAgent::addRecordToTimeline):
(WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
(WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
(WebCore::InspectorTimelineAgent::sendEvent):
(WebCore::InspectorTimelineAgent::createRecordEntry):
(WebCore::InspectorTimelineAgent::pushCurrentRecord):
* inspector/InspectorTimelineAgent.h:
(WebCore::InspectorTimelineAgent::TimelineRecordEntry::TimelineRecordEntry):
(WebCore::InspectorTimelineAgent::pushCurrentRecord):
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::persistentInspectorTimelineAgent):
(WebCore::InstrumentingAgents::setPersistentInspectorTimelineAgent):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createConsoleProfileData):
* inspector/TimelineRecordFactory.h:
* inspector/protocol/Timeline.json:
* page/PageConsole.cpp:
(WebCore::PageConsole::profileEnd):

Source/WebInspectorUI:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.startCapturing):
(WebInspector.TimelineManager.prototype.stopCapturing):
(WebInspector.TimelineManager.prototype.capturingStarted):
(WebInspector.TimelineManager.prototype.capturingStopped):
(WebInspector.TimelineManager.prototype.eventRecorded.processRecord):
(WebInspector.TimelineManager.prototype.eventRecorded):
* UserInterface/Images/TimelineRecordConsoleProfile.svg: Added.
* UserInterface/Models/ScriptTimelineRecord.js:
* UserInterface/Protocol/TimelineObserver.js:
(WebInspector.TimelineObserver.prototype.eventRecorded):
(WebInspector.TimelineObserver.prototype.recordingStarted):
(WebInspector.TimelineObserver.prototype.recordingStopped):
* UserInterface/Views/TimelineIcons.css:
(.console-profile-record .icon):
* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):

Source/WebKit/mac:
* WebInspector/WebInspector.mm:
(-[WebInspector isProfilingJavaScript]):
(-[WebInspector toggleProfilingJavaScript:]):
(-[WebInspector startProfilingJavaScript:]):
(-[WebInspector stopProfilingJavaScript:]):
(-[WebInspector isJavaScriptProfilingEnabled]):
(-[WebInspector setJavaScriptProfilingEnabled:]):

Source/WebKit2:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::setJavaScriptProfilingEnabled):
(WebKit::WebInspector::startJavaScriptProfiling):
(WebKit::WebInspector::stopJavaScriptProfiling):

LayoutTests:
* fast/profiler/profile-with-no-title-expected.txt:

* inspector-protocol/profiler/console-profile-expected.txt: Removed.
* inspector-protocol/profiler/console-profile.html: Removed.
* inspector-protocol/profiler/console-profileEnd-parameterless-expected.txt: Removed.
* inspector-protocol/profiler/console-profileEnd-parameterless.html: Removed.
Removed because console.profile does not go through the profiler protocol now.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/profiler/profile-with-no-title-expected.txt
LayoutTests/inspector-protocol/profiler/console-profile-expected.txt [deleted file]
LayoutTests/inspector-protocol/profiler/console-profile.html [deleted file]
LayoutTests/inspector-protocol/profiler/console-profileEnd-parameterless-expected.txt [deleted file]
LayoutTests/inspector-protocol/profiler/console-profileEnd-parameterless.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/bindings/js/ScriptState.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/InstrumentingAgents.cpp
Source/WebCore/inspector/InstrumentingAgents.h
Source/WebCore/inspector/TimelineRecordFactory.cpp
Source/WebCore/inspector/TimelineRecordFactory.h
Source/WebCore/inspector/protocol/Timeline.json
Source/WebCore/page/PageConsole.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
Source/WebInspectorUI/UserInterface/Images/TimelineRecordConsoleProfile.svg [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js
Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js
Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css
Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebInspector/WebInspector.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp