<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171405] branches/safari-600.1-branch</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171405">171405</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-07-22 22:27:26 -0700 (Tue, 22 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/171195">r171195</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001branchLayoutTestsChangeLog">branches/safari-600.1-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6001branchLayoutTestsfastprofilerprofilewithnotitleexpectedtxt">branches/safari-600.1-branch/LayoutTests/fast/profiler/profile-with-no-title-expected.txt</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreChangeLog">branches/safari-600.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebCorebindingsjsScriptStatecpp">branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCorebindingsjsScriptStateh">branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorInspectorControllercpp">branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorInspectorControllerh">branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorInspectorInstrumentationcpp">branches/safari-600.1-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorInspectorTimelineAgentcpp">branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorInspectorTimelineAgenth">branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorInstrumentingAgentscpp">branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorInstrumentingAgentsh">branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorTimelineRecordFactorycpp">branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorTimelineRecordFactoryh">branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreinspectorprotocolTimelinejson">branches/safari-600.1-branch/Source/WebCore/inspector/protocol/Timeline.json</a></li>
<li><a href="#branchessafari6001branchSourceWebCorepagePageConsolecpp">branches/safari-600.1-branch/Source/WebCore/page/PageConsole.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebInspectorUIChangeLog">branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">branches/safari-600.1-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#branchessafari6001branchSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#branchessafari6001branchSourceWebInspectorUIUserInterfaceModelsScriptTimelineRecordjs">branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js</a></li>
<li><a href="#branchessafari6001branchSourceWebInspectorUIUserInterfaceProtocolTimelineObserverjs">branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js</a></li>
<li><a href="#branchessafari6001branchSourceWebInspectorUIUserInterfaceViewsTimelineIconscss">branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css</a></li>
<li><a href="#branchessafari6001branchSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs">branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js</a></li>
<li><a href="#branchessafari6001branchSourceWebKitmacChangeLog">branches/safari-600.1-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebKitmacWebInspectorWebInspectormm">branches/safari-600.1-branch/Source/WebKit/mac/WebInspector/WebInspector.mm</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2ChangeLog">branches/safari-600.1-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2WebProcessWebPageWebInspectorcpp">branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6001branchSourceWebInspectorUIUserInterfaceImagesTimelineRecordConsoleProfilesvg">branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Images/TimelineRecordConsoleProfile.svg</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>branches/safari-600.1-branch/LayoutTests/inspector-protocol/profiler/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/LayoutTests/ChangeLog (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/LayoutTests/ChangeLog        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/LayoutTests/ChangeLog        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2014-07-22 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merge r171195.
+
+ 2014-07-17 Timothy Hatcher <timothy@apple.com>
+
+ Make console.profile record to the Timeline.
+
+ https://bugs.webkit.org/show_bug.cgi?id=134643
+
+ Reviewed by Joseph Pecoraro.
+
+ * WebProcess/WebPage/WebInspector.cpp:
+ (WebKit::WebInspector::setJavaScriptProfilingEnabled):
+ (WebKit::WebInspector::startJavaScriptProfiling):
+ (WebKit::WebInspector::stopJavaScriptProfiling):
+
+2014-07-22 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merge r171184.
</span><span class="cx">
</span><span class="cx"> 2014-07-17 Jer Noble <jer.noble@apple.com>
</span></span></pre></div>
<a id="branchessafari6001branchLayoutTestsfastprofilerprofilewithnotitleexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/LayoutTests/fast/profiler/profile-with-no-title-expected.txt (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/LayoutTests/fast/profiler/profile-with-no-title-expected.txt        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/LayoutTests/fast/profiler/profile-with-no-title-expected.txt        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">
</span><span class="cx"> To run this test manually, load it in the browser then load the WebInspector and look at the profile. If there is a profile that is sufficient for this test.
</span><span class="cx">
</span><del>-Profile title: org.webkit.profiles.user-initiated.1
</del><ins>+Profile title:
</ins><span class="cx"> Thread_1 (no file) (line 0:0)
</span><span class="cx"> startTest profile-with-no-title.html (line 11:1)
</span><span class="cx"> endTest profiler-test-JS-resources.js (line 1:20)
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/ChangeLog        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -1,5 +1,69 @@
</span><span class="cx"> 2014-07-22 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merge r171195.
+
+ 2014-07-17 Timothy Hatcher <timothy@apple.com>
+
+ Make console.profile record to the Timeline.
+
+ https://bugs.webkit.org/show_bug.cgi?id=134643
+
+ Reviewed by Joseph Pecoraro.
+
+ 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):
+
+2014-07-22 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merge r171188.
</span><span class="cx">
</span><span class="cx"> 2014-07-16 Sam Weinig <sam@webkit.org>
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCorebindingsjsScriptStatecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.cpp (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.cpp        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.cpp        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -51,22 +51,29 @@
</span><span class="cx"> {
</span><span class="cx"> JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
</span><span class="cx"> if (!globalObject->inherits(JSDOMWindowBase::info()))
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return &JSC::jsCast<JSDOMWindowBase*>(globalObject)->impl();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Frame* frameFromExecState(JSC::ExecState* scriptState)
+{
+ ScriptExecutionContext* context = scriptExecutionContextFromExecState(scriptState);
+ Document* document = context && context->isDocument() ? toDocument(context) : nullptr;
+ return document ? document->frame() : nullptr;
+}
+
</ins><span class="cx"> ScriptExecutionContext* scriptExecutionContextFromExecState(JSC::ExecState* scriptState)
</span><span class="cx"> {
</span><span class="cx"> JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
</span><span class="cx"> if (!globalObject->inherits(JSDOMGlobalObject::info()))
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return JSC::jsCast<JSDOMGlobalObject*>(globalObject)->scriptExecutionContext();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSC::ExecState* mainWorldExecState(Frame* frame)
</span><span class="cx"> {
</span><span class="cx"> if (!frame)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> JSDOMWindowShell* shell = frame->script().windowShell(mainThreadNormalWorld());
</span><span class="cx"> return shell->window()->globalExec();
</span><span class="cx"> }
</span><span class="lines">@@ -74,12 +81,12 @@
</span><span class="cx"> JSC::ExecState* execStateFromNode(DOMWrapperWorld& world, Node* node)
</span><span class="cx"> {
</span><span class="cx"> if (!node)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> Frame* frame = node->document().frame();
</span><span class="cx"> if (!frame)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return frame->script().globalObject(world)->globalExec();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCorebindingsjsScriptStateh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.h (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.h        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/bindings/js/ScriptState.h        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> typedef JSC::ExecState ScriptState;
</span><span class="cx">
</span><span class="cx"> DOMWindow* domWindowFromExecState(JSC::ExecState*);
</span><ins>+Frame* frameFromExecState(JSC::ExecState*);
</ins><span class="cx"> ScriptExecutionContext* scriptExecutionContextFromExecState(JSC::ExecState*);
</span><span class="cx">
</span><span class="cx"> JSC::ExecState* mainWorldExecState(Frame*);
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.cpp (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.cpp        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.cpp        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> m_agents.append(WTF::move(domStorageAgentPtr));
</span><span class="cx">
</span><span class="cx"> auto timelineAgentPtr = std::make_unique<InspectorTimelineAgent>(m_instrumentingAgents.get(), pageAgent, InspectorTimelineAgent::PageInspector, inspectorClient);
</span><del>- InspectorTimelineAgent* timelineAgent = timelineAgentPtr.get();
</del><ins>+ m_timelineAgent = timelineAgentPtr.get();
</ins><span class="cx"> m_agents.append(WTF::move(timelineAgentPtr));
</span><span class="cx">
</span><span class="cx"> auto resourceAgentPtr = std::make_unique<InspectorResourceAgent>(m_instrumentingAgents.get(), pageAgent, inspectorClient);
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
</span><del>- timelineAgent->setPageScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
</del><ins>+ m_timelineAgent->setPageScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
</ins><span class="cx"> m_profilerAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -380,16 +380,18 @@
</span><span class="cx">
</span><span class="cx"> bool InspectorController::profilerEnabled() const
</span><span class="cx"> {
</span><del>- return m_profilerAgent->enabled();
</del><ins>+ return m_instrumentingAgents->inspectorTimelineAgent();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorController::setProfilerEnabled(bool enable)
</span><span class="cx"> {
</span><del>- ErrorString error;
- if (enable)
- m_profilerAgent->enable(&error);
- else
- m_profilerAgent->disable(&error);
</del><ins>+ if (enable) {
+ m_instrumentingAgents->setPersistentInspectorTimelineAgent(m_timelineAgent);
+ m_timelineAgent->start();
+ } else {
+ m_instrumentingAgents->setPersistentInspectorTimelineAgent(nullptr);
+ m_timelineAgent->stop();
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorController::resume()
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.h (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.h        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/InspectorController.h        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> class InspectorFrontendClient;
</span><span class="cx"> class InspectorPageAgent;
</span><span class="cx"> class InspectorResourceAgent;
</span><ins>+class InspectorTimelineAgent;
</ins><span class="cx"> class InstrumentingAgents;
</span><span class="cx"> class Node;
</span><span class="cx"> class Page;
</span><span class="lines">@@ -144,6 +145,7 @@
</span><span class="cx"> PageDebuggerAgent* m_debuggerAgent;
</span><span class="cx"> InspectorDOMDebuggerAgent* m_domDebuggerAgent;
</span><span class="cx"> Inspector::InspectorProfilerAgent* m_profilerAgent;
</span><ins>+ InspectorTimelineAgent* m_timelineAgent;
</ins><span class="cx">
</span><span class="cx"> RefPtr<Inspector::InspectorBackendDispatcher> m_inspectorBackendDispatcher;
</span><span class="cx"> std::unique_ptr<InspectorFrontendClient> m_inspectorFrontendClient;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -945,14 +945,14 @@
</span><span class="cx">
</span><span class="cx"> void InspectorInstrumentation::startProfilingImpl(InstrumentingAgents* instrumentingAgents, JSC::ExecState* exec, const String& title)
</span><span class="cx"> {
</span><del>- if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorProfilerAgent())
- profilerAgent->startProfiling(title, exec);
</del><ins>+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->persistentInspectorTimelineAgent())
+ timelineAgent->startFromConsole(exec, title);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<JSC::Profile> InspectorInstrumentation::stopProfilingImpl(InstrumentingAgents* instrumentingAgents, JSC::ExecState* exec, const String& title)
</span><span class="cx"> {
</span><del>- if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorProfilerAgent())
- return profilerAgent->stopProfiling(title, exec);
</del><ins>+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->persistentInspectorTimelineAgent())
+ return timelineAgent->stopFromConsole(exec, title);
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -74,6 +74,8 @@
</span><span class="cx"> {
</span><span class="cx"> m_frontendDispatcher = std::make_unique<InspectorTimelineFrontendDispatcher>(frontendChannel);
</span><span class="cx"> m_backendDispatcher = InspectorTimelineBackendDispatcher::create(backendDispatcher, this);
</span><ins>+
+ m_instrumentingAgents->setPersistentInspectorTimelineAgent(this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorTimelineAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason)
</span><span class="lines">@@ -81,15 +83,14 @@
</span><span class="cx"> m_frontendDispatcher = nullptr;
</span><span class="cx"> m_backendDispatcher.clear();
</span><span class="cx">
</span><ins>+ m_instrumentingAgents->setPersistentInspectorTimelineAgent(nullptr);
+
</ins><span class="cx"> ErrorString error;
</span><span class="cx"> stop(&error);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorTimelineAgent::start(ErrorString*, const int* maxCallStackDepth)
</span><span class="cx"> {
</span><del>- if (!m_frontendDispatcher)
- return;
-
</del><span class="cx"> if (maxCallStackDepth && *maxCallStackDepth > 0)
</span><span class="cx"> m_maxCallStackDepth = *maxCallStackDepth;
</span><span class="cx"> else
</span><span class="lines">@@ -103,6 +104,9 @@
</span><span class="cx"> m_scriptDebugServer->addListener(this);
</span><span class="cx">
</span><span class="cx"> m_enabled = true;
</span><ins>+
+ if (m_frontendDispatcher)
+ m_frontendDispatcher->recordingStarted();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorTimelineAgent::stop(ErrorString*)
</span><span class="lines">@@ -110,7 +114,6 @@
</span><span class="cx"> if (!m_enabled)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- m_weakFactory.revokeAll();
</del><span class="cx"> m_instrumentingAgents->setInspectorTimelineAgent(nullptr);
</span><span class="cx">
</span><span class="cx"> if (m_scriptDebugServer)
</span><span class="lines">@@ -119,6 +122,9 @@
</span><span class="cx"> clearRecordStack();
</span><span class="cx">
</span><span class="cx"> m_enabled = false;
</span><ins>+
+ if (m_frontendDispatcher)
+ m_frontendDispatcher->recordingStopped();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorTimelineAgent::setPageScriptDebugServer(PageScriptDebugServer* scriptDebugServer)
</span><span class="lines">@@ -129,16 +135,76 @@
</span><span class="cx"> m_scriptDebugServer = scriptDebugServer;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline void startProfiling(JSC::ExecState* exec, const String& title)
+{
+ JSC::LegacyProfiler::profiler()->startProfiling(exec, title);
+}
+
+static inline PassRefPtr<JSC::Profile> stopProfiling(JSC::ExecState* exec, const String& title)
+{
+ return JSC::LegacyProfiler::profiler()->stopProfiling(exec, title);
+}
+
</ins><span class="cx"> static inline void startProfiling(Frame* frame, const String& title)
</span><span class="cx"> {
</span><del>- JSC::LegacyProfiler::profiler()->startProfiling(toJSDOMWindow(frame, debuggerWorld())->globalExec(), title);
</del><ins>+ startProfiling(toJSDOMWindow(frame, debuggerWorld())->globalExec(), title);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline PassRefPtr<JSC::Profile> stopProfiling(Frame* frame, const String& title)
</span><span class="cx"> {
</span><del>- return JSC::LegacyProfiler::profiler()->stopProfiling(toJSDOMWindow(frame, debuggerWorld())->globalExec(), title);
</del><ins>+ return stopProfiling(toJSDOMWindow(frame, debuggerWorld())->globalExec(), title);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String &title)
+{
+ // Only allow recording of a profile if it is anonymous (empty title) or does not match
+ // the title of an already recording profile.
+ if (!title.isEmpty()) {
+ for (const TimelineRecordEntry& record : m_pendingConsoleProfileRecords) {
+ String recordTitle;
+ record.data->getString(ASCIILiteral("title"), &recordTitle);
+ if (recordTitle == title)
+ return;
+ }
+ }
+
+ if (m_pendingConsoleProfileRecords.isEmpty())
+ start();
+
+ startProfiling(exec, title);
+
+ m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
+}
+
+PassRefPtr<JSC::Profile> InspectorTimelineAgent::stopFromConsole(JSC::ExecState* exec, const String& title)
+{
+ // Stop profiles in reverse order. If the title is empty, then stop the last profile.
+ // Otherwise, match the title of the profile to stop.
+ for (ptrdiff_t i = m_pendingConsoleProfileRecords.size() - 1; i >= 0; --i) {
+ const TimelineRecordEntry& record = m_pendingConsoleProfileRecords[i];
+
+ String recordTitle;
+ record.data->getString(ASCIILiteral("title"), &recordTitle);
+
+ if (title.isEmpty() || recordTitle == title) {
+ RefPtr<JSC::Profile> profile = stopProfiling(exec, title);
+ if (profile)
+ TimelineRecordFactory::appendProfile(record.data.get(), profile);
+
+ didCompleteRecordEntry(record);
+
+ m_pendingConsoleProfileRecords.remove(i);
+
+ if (m_pendingConsoleProfileRecords.isEmpty())
+ stop();
+
+ return profile.release();
+ }
+ }
+
+ return nullptr;
+}
+
</ins><span class="cx"> void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, Frame* frame)
</span><span class="cx"> {
</span><span class="cx"> pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame);
</span><span class="lines">@@ -264,7 +330,7 @@
</span><span class="cx"> void InspectorTimelineAgent::didWriteHTML(unsigned endLine)
</span><span class="cx"> {
</span><span class="cx"> if (!m_recordStack.isEmpty()) {
</span><del>- TimelineRecordEntry entry = m_recordStack.last();
</del><ins>+ const TimelineRecordEntry& entry = m_recordStack.last();
</ins><span class="cx"> entry.data->setNumber("endLine", endLine);
</span><span class="cx"> didCompleteCurrentRecord(TimelineRecordType::ParseHTML);
</span><span class="cx"> }
</span><span class="lines">@@ -457,10 +523,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(exec);
</span><span class="cx">
</span><del>- ScriptExecutionContext* context = scriptExecutionContextFromExecState(exec);
- Document* document = (context && context->isDocument()) ? toDocument(context) : nullptr;
- Frame* frame = document ? document->frame() : nullptr;
- appendRecord(TimelineRecordFactory::createProbeSampleData(action, hitCount), TimelineRecordType::ProbeSample, false, frame);
</del><ins>+ appendRecord(TimelineRecordFactory::createProbeSampleData(action, hitCount), TimelineRecordType::ProbeSample, false, frameFromExecState(exec));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Inspector::TypeBuilder::Timeline::EventType::Enum toProtocol(TimelineRecordType type)
</span><span class="lines">@@ -528,6 +591,8 @@
</span><span class="cx"> return Inspector::TypeBuilder::Timeline::EventType::FunctionCall;
</span><span class="cx"> case TimelineRecordType::ProbeSample:
</span><span class="cx"> return Inspector::TypeBuilder::Timeline::EventType::ProbeSample;
</span><ins>+ case TimelineRecordType::ConsoleProfile:
+ return Inspector::TypeBuilder::Timeline::EventType::ConsoleProfile;
</ins><span class="cx">
</span><span class="cx"> case TimelineRecordType::RequestAnimationFrame:
</span><span class="cx"> return Inspector::TypeBuilder::Timeline::EventType::RequestAnimationFrame;
</span><span class="lines">@@ -558,7 +623,7 @@
</span><span class="cx"> if (m_recordStack.isEmpty())
</span><span class="cx"> sendEvent(record.release());
</span><span class="cx"> else {
</span><del>- TimelineRecordEntry parent = m_recordStack.last();
</del><ins>+ const TimelineRecordEntry& parent = m_recordStack.last();
</ins><span class="cx"> parent.children->pushObject(record.release());
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -573,6 +638,14 @@
</span><span class="cx"> record->setString("frameId", frameId);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorTimelineAgent::didCompleteRecordEntry(const TimelineRecordEntry& entry)
+{
+ entry.record->setObject(ASCIILiteral("data"), entry.data);
+ entry.record->setArray(ASCIILiteral("children"), entry.children);
+ entry.record->setNumber(ASCIILiteral("endTime"), timestamp());
+ addRecordToTimeline(entry.record, entry.type);
+}
+
</ins><span class="cx"> void InspectorTimelineAgent::didCompleteCurrentRecord(TimelineRecordType type)
</span><span class="cx"> {
</span><span class="cx"> // An empty stack could merely mean that the timeline agent was turned on in the middle of
</span><span class="lines">@@ -580,11 +653,8 @@
</span><span class="cx"> if (!m_recordStack.isEmpty()) {
</span><span class="cx"> TimelineRecordEntry entry = m_recordStack.last();
</span><span class="cx"> m_recordStack.removeLast();
</span><del>- ASSERT(entry.type == type);
- entry.record->setObject("data", entry.data);
- entry.record->setArray("children", entry.children);
- entry.record->setNumber("endTime", timestamp());
- addRecordToTimeline(entry.record, type);
</del><ins>+ ASSERT_UNUSED(type, entry.type == type);
+ didCompleteRecordEntry(entry);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -596,7 +666,6 @@
</span><span class="cx"> , m_maxCallStackDepth(5)
</span><span class="cx"> , m_inspectorType(type)
</span><span class="cx"> , m_client(client)
</span><del>- , m_weakFactory(this)
</del><span class="cx"> , m_enabled(false)
</span><span class="cx"> , m_recordingProfile(false)
</span><span class="cx"> {
</span><span class="lines">@@ -612,18 +681,26 @@
</span><span class="cx">
</span><span class="cx"> void InspectorTimelineAgent::sendEvent(PassRefPtr<InspectorObject> event)
</span><span class="cx"> {
</span><ins>+ if (!m_frontendDispatcher)
+ return;
+
</ins><span class="cx"> // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now.
</span><span class="cx"> RefPtr<Inspector::TypeBuilder::Timeline::TimelineEvent> recordChecked = Inspector::TypeBuilder::Timeline::TimelineEvent::runtimeCast(event);
</span><span class="cx"> m_frontendDispatcher->eventRecorded(recordChecked.release());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, TimelineRecordType type, bool captureCallStack, Frame* frame)
</del><ins>+InspectorTimelineAgent::TimelineRecordEntry InspectorTimelineAgent::createRecordEntry(PassRefPtr<InspectorObject> data, TimelineRecordType type, bool captureCallStack, Frame* frame)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
</span><span class="cx"> setFrameIdentifier(record.get(), frame);
</span><del>- m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type));
</del><ins>+ return TimelineRecordEntry(record.release(), data, InspectorArray::create(), type);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, TimelineRecordType type, bool captureCallStack, Frame* frame)
+{
+ pushCurrentRecord(createRecordEntry(data, type, captureCallStack, frame));
+}
+
</ins><span class="cx"> void InspectorTimelineAgent::clearRecordStack()
</span><span class="cx"> {
</span><span class="cx"> m_recordStack.clear();
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.h (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.h        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/InspectorTimelineAgent.h        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -43,6 +43,10 @@
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx">
</span><ins>+namespace JSC {
+class Profile;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class Event;
</span><span class="lines">@@ -97,6 +101,7 @@
</span><span class="cx">
</span><span class="cx"> FunctionCall,
</span><span class="cx"> ProbeSample,
</span><ins>+ ConsoleProfile,
</ins><span class="cx">
</span><span class="cx"> RequestAnimationFrame,
</span><span class="cx"> CancelAnimationFrame,
</span><span class="lines">@@ -136,8 +141,8 @@
</span><span class="cx"> virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
</span><span class="cx"> virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;
</span><span class="cx">
</span><del>- virtual void start(ErrorString*, const int* maxCallStackDepth) override;
- virtual void stop(ErrorString*) override;
</del><ins>+ virtual void start(ErrorString* = nullptr, const int* maxCallStackDepth = nullptr) override;
+ virtual void stop(ErrorString* = nullptr) override;
</ins><span class="cx">
</span><span class="cx"> int id() const { return m_id; }
</span><span class="cx">
</span><span class="lines">@@ -146,6 +151,9 @@
</span><span class="cx"> void didCommitLoad();
</span><span class="cx">
</span><span class="cx"> // Methods called from WebCore.
</span><ins>+ void startFromConsole(JSC::ExecState*, const String &title);
+ PassRefPtr<JSC::Profile> stopFromConsole(JSC::ExecState*, const String& title);
+
</ins><span class="cx"> void willCallFunction(const String& scriptName, int scriptLine, Frame*);
</span><span class="cx"> void didCallFunction(Frame*);
</span><span class="cx">
</span><span class="lines">@@ -224,10 +232,13 @@
</span><span class="cx"> friend class TimelineRecordStack;
</span><span class="cx">
</span><span class="cx"> struct TimelineRecordEntry {
</span><ins>+ TimelineRecordEntry()
+ : type(TimelineRecordType::EventDispatch) { }
</ins><span class="cx"> TimelineRecordEntry(PassRefPtr<Inspector::InspectorObject> record, PassRefPtr<Inspector::InspectorObject> data, PassRefPtr<Inspector::InspectorArray> children, TimelineRecordType type)
</span><span class="cx"> : record(record), data(data), children(children), type(type)
</span><span class="cx"> {
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> RefPtr<Inspector::InspectorObject> record;
</span><span class="cx"> RefPtr<Inspector::InspectorObject> data;
</span><span class="cx"> RefPtr<Inspector::InspectorArray> children;
</span><span class="lines">@@ -237,9 +248,13 @@
</span><span class="cx"> void sendEvent(PassRefPtr<Inspector::InspectorObject>);
</span><span class="cx"> void appendRecord(PassRefPtr<Inspector::InspectorObject> data, TimelineRecordType, bool captureCallStack, Frame*);
</span><span class="cx"> void pushCurrentRecord(PassRefPtr<Inspector::InspectorObject>, TimelineRecordType, bool captureCallStack, Frame*);
</span><ins>+ void pushCurrentRecord(const TimelineRecordEntry& record) { m_recordStack.append(record); }
</ins><span class="cx">
</span><ins>+ TimelineRecordEntry createRecordEntry(PassRefPtr<Inspector::InspectorObject> data, TimelineRecordType, bool captureCallStack, Frame*);
+
</ins><span class="cx"> void setFrameIdentifier(Inspector::InspectorObject* record, Frame*);
</span><span class="cx">
</span><ins>+ void didCompleteRecordEntry(const TimelineRecordEntry&);
</ins><span class="cx"> void didCompleteCurrentRecord(TimelineRecordType);
</span><span class="cx">
</span><span class="cx"> void addRecordToTimeline(PassRefPtr<Inspector::InspectorObject>, TimelineRecordType);
</span><span class="lines">@@ -264,8 +279,9 @@
</span><span class="cx"> int m_maxCallStackDepth;
</span><span class="cx"> InspectorType m_inspectorType;
</span><span class="cx"> InspectorClient* m_client;
</span><del>- WeakPtrFactory<InspectorTimelineAgent> m_weakFactory;
</del><span class="cx">
</span><ins>+ Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords;
+
</ins><span class="cx"> bool m_enabled;
</span><span class="cx"> bool m_recordingProfile;
</span><span class="cx"> };
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorInstrumentingAgentscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.cpp (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.cpp        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.cpp        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> , m_pageRuntimeAgent(nullptr)
</span><span class="cx"> , m_workerRuntimeAgent(nullptr)
</span><span class="cx"> , m_inspectorTimelineAgent(nullptr)
</span><ins>+ , m_persistentInspectorTimelineAgent(nullptr)
</ins><span class="cx"> , m_inspectorDOMStorageAgent(nullptr)
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> , m_inspectorReplayAgent(nullptr)
</span><span class="lines">@@ -84,6 +85,7 @@
</span><span class="cx"> m_pageRuntimeAgent = nullptr;
</span><span class="cx"> m_workerRuntimeAgent = nullptr;
</span><span class="cx"> m_inspectorTimelineAgent = nullptr;
</span><ins>+ m_persistentInspectorTimelineAgent = nullptr;
</ins><span class="cx"> m_inspectorDOMStorageAgent = nullptr;
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> m_inspectorReplayAgent = nullptr;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorInstrumentingAgentsh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.h (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.h        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/InstrumentingAgents.h        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -105,6 +105,9 @@
</span><span class="cx"> InspectorTimelineAgent* inspectorTimelineAgent() const { return m_inspectorTimelineAgent; }
</span><span class="cx"> void setInspectorTimelineAgent(InspectorTimelineAgent* agent) { m_inspectorTimelineAgent = agent; }
</span><span class="cx">
</span><ins>+ InspectorTimelineAgent* persistentInspectorTimelineAgent() const { return m_persistentInspectorTimelineAgent; }
+ void setPersistentInspectorTimelineAgent(InspectorTimelineAgent* agent) { m_persistentInspectorTimelineAgent = agent; }
+
</ins><span class="cx"> InspectorDOMStorageAgent* inspectorDOMStorageAgent() const { return m_inspectorDOMStorageAgent; }
</span><span class="cx"> void setInspectorDOMStorageAgent(InspectorDOMStorageAgent* agent) { m_inspectorDOMStorageAgent = agent; }
</span><span class="cx">
</span><span class="lines">@@ -154,6 +157,7 @@
</span><span class="cx"> PageRuntimeAgent* m_pageRuntimeAgent;
</span><span class="cx"> WorkerRuntimeAgent* m_workerRuntimeAgent;
</span><span class="cx"> InspectorTimelineAgent* m_inspectorTimelineAgent;
</span><ins>+ InspectorTimelineAgent* m_persistentInspectorTimelineAgent;
</ins><span class="cx"> InspectorDOMStorageAgent* m_inspectorDOMStorageAgent;
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> InspectorReplayAgent* m_inspectorReplayAgent;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorTimelineRecordFactorycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.cpp (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.cpp        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.cpp        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -90,6 +90,13 @@
</span><span class="cx"> return data.release();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+PassRefPtr<InspectorObject> TimelineRecordFactory::createConsoleProfileData(const String& title)
+{
+ RefPtr<InspectorObject> data = InspectorObject::create();
+ data->setString("title", title);
+ return data.release();
+}
+
</ins><span class="cx"> PassRefPtr<InspectorObject> TimelineRecordFactory::createProbeSampleData(const ScriptBreakpointAction& action, int hitCount)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InspectorObject> data = InspectorObject::create();
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorTimelineRecordFactoryh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.h (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.h        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/TimelineRecordFactory.h        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> static PassRefPtr<Inspector::InspectorObject> createGCEventData(const size_t usedHeapSizeDelta);
</span><span class="cx">
</span><span class="cx"> static PassRefPtr<Inspector::InspectorObject> createFunctionCallData(const String& scriptName, int scriptLine);
</span><ins>+ static PassRefPtr<Inspector::InspectorObject> createConsoleProfileData(const String& title);
</ins><span class="cx">
</span><span class="cx"> static PassRefPtr<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, int hitCount);
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreinspectorprotocolTimelinejson"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/inspector/protocol/Timeline.json (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/inspector/protocol/Timeline.json        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/inspector/protocol/Timeline.json        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> {
</span><span class="cx"> "id": "EventType",
</span><span class="cx"> "type": "string",
</span><del>- "enum": ["EventDispatch", "ScheduleStyleRecalculation", "RecalculateStyles", "InvalidateLayout", "Layout", "Paint", "ScrollLayer", "ResizeImage", "ParseHTML", "TimerInstall", "TimerRemove", "TimerFire", "EvaluateScript", "MarkLoad", "MarkDOMContent", "TimeStamp", "Time", "TimeEnd", "ScheduleResourceRequest", "ResourceSendRequest", "ResourceReceiveResponse", "ResourceReceivedData", "ResourceFinish", "XHRReadyStateChange", "XHRLoad", "FunctionCall", "ProbeSample", "GCEvent", "RequestAnimationFrame", "CancelAnimationFrame", "FireAnimationFrame", "WebSocketCreate", "WebSocketSendHandshakeRequest", "WebSocketReceiveHandshakeResponse", "WebSocketDestroy"],
</del><ins>+ "enum": ["EventDispatch", "ScheduleStyleRecalculation", "RecalculateStyles", "InvalidateLayout", "Layout", "Paint", "ScrollLayer", "ResizeImage", "ParseHTML", "TimerInstall", "TimerRemove", "TimerFire", "EvaluateScript", "MarkLoad", "MarkDOMContent", "TimeStamp", "Time", "TimeEnd", "ScheduleResourceRequest", "ResourceSendRequest", "ResourceReceiveResponse", "ResourceReceivedData", "ResourceFinish", "XHRReadyStateChange", "XHRLoad", "FunctionCall", "ProbeSample", "ConsoleProfile", "GCEvent", "RequestAnimationFrame", "CancelAnimationFrame", "FireAnimationFrame", "WebSocketCreate", "WebSocketSendHandshakeRequest", "WebSocketReceiveHandshakeResponse", "WebSocketDestroy"],
</ins><span class="cx"> "description": "Timeline record type."
</span><span class="cx"> },
</span><span class="cx"> {
</span><span class="lines">@@ -39,6 +39,14 @@
</span><span class="cx"> { "name": "record", "$ref": "TimelineEvent", "description": "Timeline event record data." }
</span><span class="cx"> ],
</span><span class="cx"> "description": "Fired for every instrumentation event while timeline is started."
</span><ins>+ },
+ {
+ "name": "recordingStarted",
+ "description": "Fired when recording has started."
+ },
+ {
+ "name": "recordingStopped",
+ "description": "Fired when recording has stopped."
</ins><span class="cx"> }
</span><span class="cx"> ]
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCorepagePageConsolecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/page/PageConsole.cpp (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/page/PageConsole.cpp        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebCore/page/PageConsole.cpp        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -170,8 +170,7 @@
</span><span class="cx">
</span><span class="cx"> void PageConsole::profileEnd(JSC::ExecState* exec, const String& title)
</span><span class="cx"> {
</span><del>- RefPtr<JSC::Profile> profile = InspectorInstrumentation::stopProfiling(&m_page, exec, title);
- if (profile)
</del><ins>+ if (RefPtr<JSC::Profile> profile = InspectorInstrumentation::stopProfiling(&m_page, exec, title))
</ins><span class="cx"> m_profiles.append(profile.release());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-07-17 Timothy Hatcher <timothy@apple.com>
+
+ Make console.profile record to the Timeline.
+
+ https://bugs.webkit.org/show_bug.cgi?id=134643
+
+ Reviewed by Joseph Pecoraro.
+
+ * 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):
+
</ins><span class="cx"> 2014-07-16 Saam Barati <sbarati@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: TextContentView calls the wrong super function in shown()
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (171404 => 171405)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-07-23 05:18:09 UTC (rev 171404)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-07-23 05:27:26 UTC (rev 171405)
</span><span class="lines">@@ -101,6 +101,7 @@
</span><span class="cx">