<!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>[194871] trunk</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/194871">194871</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-11 15:34:43 -0800 (Mon, 11 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Migrate Page Timeline recording to ScriptProfiler
https://bugs.webkit.org/show_bug.cgi?id=152727

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2016-01-11
Reviewed by Brian Burg.

Source/WebCore:

Test: inspector/script-profiler/event-type-Other.html

This now shares the JavaScript profiling code between JSContext and Page
inspection. It also moves forward splitting the Page's Timeline domain
into smaller components that can be turned on/off individually.

* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::profiledCall):
(WebCore::JSMainThreadExecState::profiledEvaluate):
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
(-[WebScriptObject evaluateWebScript:]):
Identify entry points into JSC that we want to profile for the frontend.
These were nearly all already classified for the Timeline. We added missing
support for ErrorHandlers (window.onerror handler functions).

* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didCallFunction):
(WebCore::InspectorTimelineAgent::didEvaluateScript):
(WebCore::startProfiling): Deleted.
(WebCore::stopProfiling): Deleted.
(WebCore::InspectorTimelineAgent::willCallFunction): Deleted.
(WebCore::InspectorTimelineAgent::willEvaluateScript): Deleted.
* inspector/InspectorTimelineAgent.h:
TimelineAgent no longer needs to start/stop the Legacy Profiler
since ScriptProfiler will automatically do that for us. Delete
all code associated with that. There is still an open question
regarding `console.profile` and `console.profileEnd` that
starts/stops the profiler.

Source/WebInspectorUI:

* UserInterface/Images/TimelineRecordAPI.svg: Added.
* UserInterface/Images/gtk/TimelineRecordAPI.svg: Added.
New [S] image for API initiated script evaluations.
Display matches the existing [S] Script Evaluated.
Colors match the gray [N] Native image colors.

* UserInterface/Models/ScriptInstrument.js:
(WebInspector.ScriptInstrument.prototype.startInstrumentation):
(WebInspector.ScriptInstrument.prototype.stopInstrumentation):
(WebInspector.ScriptInstrument):
Use ScriptProfiler, if available, in Web debuggables.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype.capturingStarted):
(WebInspector.TimelineManager.prototype._processRecord):
(WebInspector.TimelineManager.prototype._scriptProfilerTypeToScriptTimelineRecordType):
(WebInspector.TimelineManager.prototype.scriptProfilerTrackingUpdated):
(WebInspector.TimelineManager.prototype.scriptProfilerTrackingCompleted):
(WebInspector.TimelineManager.prototype._mergeScriptProfileRecords.let.nextRecord):
(WebInspector.TimelineManager.prototype._mergeScriptProfileRecords.let.recordContainsRecord):
(WebInspector.TimelineManager.prototype._mergeScriptProfileRecords):
When running a timeline on a web debuggable the frontend receives both
Timeline event records and ScriptProfiler events. Timeline (Web) records
are high level web events like &quot;Script Evaluated&quot;, &quot;Event Dispatched&quot;,
&quot;Timer Fired&quot;. The timestamps for these records should always be wrapping
a ScriptProfiler event and its associated profile data. So, at the end
of a recording we merge ScriptProfiler profile data into the original
Timeline (Web) record.

* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord.prototype.get profilePayload):
(WebInspector.ScriptTimelineRecord.prototype.set profilePayload):
(WebInspector.ScriptTimelineRecord.prototype.setProfilePayload): Deleted.
Replace method with getter/setter.

(WebInspector.ScriptTimelineRecord.EventType.displayName):
Add a new event type for API records, but share display name with Script Evaluated.

* UserInterface/Views/NavigationSidebarPanel.js:
Fix typo.

* UserInterface/Views/ScriptTimelineView.css:
(.timeline-view.script &gt; .data-grid .eventType-column): Deleted.
There is no &quot;eventType&quot; column in the ScriptTimelineView datagrid, so remove styles.

* UserInterface/Views/TimelineIcons.css:
(.api-record .icon):
* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):
For API Script Evaluation records use the new icon.

LayoutTests:

* inspector/script-profiler/event-type-Other-expected.txt: Added.
* inspector/script-profiler/event-type-Other.html: Added.
Add a test that Web script evaluations create &quot;Other&quot; ScriptProfiler events.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCallbackDatacpp">trunk/Source/WebCore/bindings/js/JSCallbackData.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSErrorHandlercpp">trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenercpp">trunk/Source/WebCore/bindings/js/JSEventListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMainThreadExecStateh">trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMutationCallbackcpp">trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScheduledActioncpp">trunk/Source/WebCore/bindings/js/ScheduledAction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptControllercpp">trunk/Source/WebCore/bindings/js/ScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcWebScriptObjectmm">trunk/Source/WebCore/bindings/objc/WebScriptObject.mm</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgenth">trunk/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScriptInstrumentjs">trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScriptTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorscriptprofilereventtypeOtherexpectedtxt">trunk/LayoutTests/inspector/script-profiler/event-type-Other-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorscriptprofilereventtypeOtherhtml">trunk/LayoutTests/inspector/script-profiler/event-type-Other.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesTimelineRecordAPIsvg">trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordAPI.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesgtkTimelineRecordAPIsvg">trunk/Source/WebInspectorUI/UserInterface/Images/gtk/TimelineRecordAPI.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/LayoutTests/ChangeLog        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-01-11  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Migrate Page Timeline recording to ScriptProfiler
+        https://bugs.webkit.org/show_bug.cgi?id=152727
+
+        Reviewed by Brian Burg.
+
+        * inspector/script-profiler/event-type-Other-expected.txt: Added.
+        * inspector/script-profiler/event-type-Other.html: Added.
+        Add a test that Web script evaluations create &quot;Other&quot; ScriptProfiler events.
+
</ins><span class="cx"> 2016-01-11  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Padding added to table-cell element after font-size change.
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorscriptprofilereventtypeOtherexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/script-profiler/event-type-Other-expected.txt (0 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/script-profiler/event-type-Other-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/script-profiler/event-type-Other-expected.txt        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+CONSOLE MESSAGE: line 1: &lt;script&gt; script evaluation
+CONSOLE MESSAGE: line 14: 'click' event dispatched
+CONSOLE MESSAGE: line 20: timer fired
+Tests for generating a ScriptProfiler.Event with ScriptProfiler.EventType.Other type. Web script evaluations are classified as &quot;Other&quot;.
+
+
+== Running test suite: ScriptProfiler.EventType.Microtask
+-- Running test case: TrackingSession
+ScriptProfiler.trackingStart
+ScriptProfiler.trackingUpdate
+PASS: Event type should be Other.
+ScriptProfiler.trackingUpdate
+PASS: Event type should be Other.
+ScriptProfiler.trackingUpdate
+PASS: Event type should be Other.
+ScriptProfiler.trackingComplete
+PASS: Profiles should exist when complete.
+PASS: Should be 3 profiles for this session.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorscriptprofilereventtypeOtherhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/script-profiler/event-type-Other.html (0 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/script-profiler/event-type-Other.html                                (rev 0)
+++ trunk/LayoutTests/inspector/script-profiler/event-type-Other.html        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/protocol-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function triggerScriptEvaluation() {
+    let script = document.createElement(&quot;script&quot;);
+    script.textContent = &quot;console.log('&lt;script&gt; script evaluation')&quot;;
+    document.body.appendChild(script);
+}
+
+function triggerEventDispatchEvaluation() {
+    let button = document.createElement(&quot;button&quot;);
+    button.addEventListener(&quot;click&quot;, () =&gt; { console.log(&quot;'click' event dispatched&quot;); });
+    button.click();
+}
+
+function triggerTimerEvaluation() {
+    setTimeout(() =&gt; {
+        console.log(&quot;timer fired&quot;);
+    }, 0);
+}
+
+function test()
+{
+    let suite = ProtocolTest.createAsyncSuite(&quot;ScriptProfiler.EventType.Microtask&quot;);
+
+    suite.addTestCase({
+        name: &quot;TrackingSession&quot;,
+        description: &quot;Start a tracking session that includes multiple web script evaluations classified as an Other event type.&quot;,
+        test: function(resolve, reject) {
+            InspectorProtocol.awaitEvent({event: &quot;ScriptProfiler.trackingStart&quot;}).then((messageObject) =&gt; {
+                ProtocolTest.log(&quot;ScriptProfiler.trackingStart&quot;);
+            });
+
+            InspectorProtocol.addEventListener(&quot;ScriptProfiler.trackingUpdate&quot;, (messageObject) =&gt; {
+                ProtocolTest.log(&quot;ScriptProfiler.trackingUpdate&quot;);
+                ProtocolTest.expectThat(messageObject.params.event.type === &quot;Other&quot;, &quot;Event type should be Other.&quot;);
+            });
+
+            InspectorProtocol.awaitEvent({event: &quot;ScriptProfiler.trackingComplete&quot;}).then((messageObject) =&gt; {
+                ProtocolTest.log(&quot;ScriptProfiler.trackingComplete&quot;);
+                ProtocolTest.expectThat(Array.isArray(messageObject.params.profiles), &quot;Profiles should exist when complete.&quot;);
+                ProtocolTest.expectThat(messageObject.params.profiles.length === 3, &quot;Should be 3 profiles for this session.&quot;);
+                resolve();
+            });
+
+            InspectorProtocol.sendCommand(&quot;ScriptProfiler.startTracking&quot;, {profile: true});
+            ProtocolTest.evaluateInPage(&quot;triggerScriptEvaluation()&quot;);
+            ProtocolTest.evaluateInPage(&quot;triggerEventDispatchEvaluation()&quot;);
+            ProtocolTest.evaluateInPage(&quot;triggerTimerEvaluation()&quot;);
+            setTimeout(() =&gt; { InspectorProtocol.sendCommand(&quot;ScriptProfiler.stopTracking&quot;, {}); }, 50);
+        }
+    });
+
+    // FIXME: &lt;https://webkit.org/b/152193&gt; Web Inspector: Separate Debugger enable state from being attached
+    // Debugger should not need to be enabled for profiling to work.
+    InspectorProtocol.sendCommand(&quot;Debugger.enable&quot;, {});
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Tests for generating a ScriptProfiler.Event with ScriptProfiler.EventType.Other type. Web script evaluations are classified as &quot;Other&quot;.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/ChangeLog        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2016-01-11  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Migrate Page Timeline recording to ScriptProfiler
+        https://bugs.webkit.org/show_bug.cgi?id=152727
+
+        Reviewed by Brian Burg.
+
+        Test: inspector/script-profiler/event-type-Other.html
+
+        This now shares the JavaScript profiling code between JSContext and Page
+        inspection. It also moves forward splitting the Page's Timeline domain
+        into smaller components that can be turned on/off individually.
+
+        * bindings/js/JSCallbackData.cpp:
+        (WebCore::JSCallbackData::invokeCallback):
+        * bindings/js/JSErrorHandler.cpp:
+        (WebCore::JSErrorHandler::handleEvent):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSMainThreadExecState.h:
+        (WebCore::JSMainThreadExecState::profiledCall):
+        (WebCore::JSMainThreadExecState::profiledEvaluate):
+        * bindings/js/JSMutationCallback.cpp:
+        (WebCore::JSMutationCallback::call):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::executeFunctionInContext):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::evaluateInWorld):
+        * bindings/objc/WebScriptObject.mm:
+        (-[WebScriptObject callWebScriptMethod:withArguments:]):
+        (-[WebScriptObject evaluateWebScript:]):
+        Identify entry points into JSC that we want to profile for the frontend.
+        These were nearly all already classified for the Timeline. We added missing
+        support for ErrorHandlers (window.onerror handler functions).
+
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didCallFunction):
+        (WebCore::InspectorTimelineAgent::didEvaluateScript):
+        (WebCore::startProfiling): Deleted.
+        (WebCore::stopProfiling): Deleted.
+        (WebCore::InspectorTimelineAgent::willCallFunction): Deleted.
+        (WebCore::InspectorTimelineAgent::willEvaluateScript): Deleted.
+        * inspector/InspectorTimelineAgent.h:
+        TimelineAgent no longer needs to start/stop the Legacy Profiler
+        since ScriptProfiler will automatically do that for us. Delete
+        all code associated with that. There is still an open question
+        regarding `console.profile` and `console.profileEnd` that
+        starts/stops the profiler.
+
</ins><span class="cx"> 2016-01-11  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Get rid of CFMakeCollectable, it is a no-op
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCallbackDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCallbackData.cpp (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCallbackData.cpp        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/js/JSCallbackData.cpp        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -82,8 +82,8 @@
</span><span class="cx"> 
</span><span class="cx">     returnedException = nullptr;
</span><span class="cx">     JSValue result = context-&gt;isDocument()
</span><del>-        ? JSMainThreadExecState::call(exec, function, callType, callData, callback, args, returnedException)
-        : JSC::call(exec, function, callType, callData, callback, args, returnedException);
</del><ins>+        ? JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, function, callType, callData, callback, args, returnedException)
+        : JSC::profiledCall(exec, JSC::ProfilingReason::Other, function, callType, callData, callback, args, returnedException);
</ins><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didCallFunction(cookie, context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSErrorHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-
</del><span class="cx"> #include &quot;JSErrorHandler.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="lines">@@ -39,6 +38,7 @@
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;JSEvent.h&quot;
</span><span class="cx"> #include &quot;JSMainThreadExecState.h&quot;
</span><ins>+#include &quot;JSMainThreadExecStateInstrumentation.h&quot;
</ins><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="cx"> #include &lt;runtime/VMEntryScope.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="lines">@@ -98,11 +98,15 @@
</span><span class="cx">         VM&amp; vm = globalObject-&gt;vm();
</span><span class="cx">         VMEntryScope entryScope(vm, vm.entryScope ? vm.entryScope-&gt;globalObject() : globalObject);
</span><span class="cx"> 
</span><ins>+        InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(scriptExecutionContext, callType, callData);
+
</ins><span class="cx">         NakedPtr&lt;Exception&gt; exception;
</span><span class="cx">         JSValue returnValue = scriptExecutionContext-&gt;isDocument()
</span><del>-            ? JSMainThreadExecState::call(exec, jsFunction, callType, callData, globalObject, args, exception)
-            : JSC::call(exec, jsFunction, callType, callData, globalObject, args, exception);
</del><ins>+            ? JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, jsFunction, callType, callData, globalObject, args, exception)
+            : JSC::profiledCall(exec, JSC::ProfilingReason::Other, jsFunction, callType, callData, globalObject, args, exception);
</ins><span class="cx"> 
</span><ins>+        InspectorInstrumentation::didCallFunction(cookie, scriptExecutionContext);
+
</ins><span class="cx">         globalObject-&gt;setCurrentEvent(savedEvent);
</span><span class="cx"> 
</span><span class="cx">         if (exception)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -127,8 +127,8 @@
</span><span class="cx">         JSValue thisValue = handleEventFunction == jsFunction ? toJS(exec, globalObject, event-&gt;currentTarget()) : jsFunction;
</span><span class="cx">         NakedPtr&lt;Exception&gt; exception;
</span><span class="cx">         JSValue retval = scriptExecutionContext-&gt;isDocument()
</span><del>-            ? JSMainThreadExecState::call(exec, handleEventFunction, callType, callData, thisValue, args, exception)
-            : JSC::call(exec, handleEventFunction, callType, callData, thisValue, args, exception);
</del><ins>+            ? JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, handleEventFunction, callType, callData, thisValue, args, exception)
+            : JSC::profiledCall(exec, JSC::ProfilingReason::Other, handleEventFunction, callType, callData, thisValue, args, exception);
</ins><span class="cx"> 
</span><span class="cx">         InspectorInstrumentation::didCallFunction(cookie, scriptExecutionContext);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMainThreadExecStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -68,6 +68,24 @@
</span><span class="cx">         return evaluate(exec, source, thisValue, unused);
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    static JSC::JSValue profiledCall(JSC::ExecState* exec, JSC::ProfilingReason reason, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, NakedPtr&lt;JSC::Exception&gt;&amp; returnedException)
+    {
+        JSMainThreadExecState currentState(exec);
+        return JSC::profiledCall(exec, reason, functionObject, callType, callData, thisValue, args, returnedException);
+    }
+
+    static JSC::JSValue profiledEvaluate(JSC::ExecState* exec, JSC::ProfilingReason reason, const JSC::SourceCode&amp; source, JSC::JSValue thisValue, NakedPtr&lt;JSC::Exception&gt;&amp; returnedException)
+    {
+        JSMainThreadExecState currentState(exec);
+        return JSC::profiledEvaluate(exec, reason, source, thisValue, returnedException);
+    }
+
+    static JSC::JSValue profiledEvaluate(JSC::ExecState* exec, JSC::ProfilingReason reason, const JSC::SourceCode&amp; source, JSC::JSValue thisValue = JSC::JSValue())
+    {
+        NakedPtr&lt;JSC::Exception&gt; unused;
+        return profiledEvaluate(exec, reason, source, thisValue, unused);
+    }
+
</ins><span class="cx">     static void runTask(JSC::ExecState* exec, JSC::Microtask&amp; task)
</span><span class="cx">     {
</span><span class="cx">         JSMainThreadExecState currentState(exec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMutationCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(context, callType, callData);
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; exception;
</span><del>-    JSMainThreadExecState::call(exec, callback, callType, callData, jsObserver, args, exception);
</del><ins>+    JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, callback, callType, callData, jsObserver, args, exception);
</ins><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didCallFunction(cookie, context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScheduledActioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.cpp (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -101,9 +101,9 @@
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; exception;
</span><span class="cx">     if (is&lt;Document&gt;(context))
</span><del>-        JSMainThreadExecState::call(exec, m_function.get(), callType, callData, thisValue, args, exception);
</del><ins>+        JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, m_function.get(), callType, callData, thisValue, args, exception);
</ins><span class="cx">     else
</span><del>-        JSC::call(exec, m_function.get(), callType, callData, thisValue, args, exception);
</del><ins>+        JSC::profiledCall(exec, JSC::ProfilingReason::Other, m_function.get(), callType, callData, thisValue, args, exception);
</ins><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didCallFunction(cookie, &amp;context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptController.cpp        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine());
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; evaluationException;
</span><del>-    JSValue returnValue = JSMainThreadExecState::evaluate(exec, jsSourceCode, shell, evaluationException);
</del><ins>+    JSValue returnValue = JSMainThreadExecState::profiledEvaluate(exec, JSC::ProfilingReason::Other, jsSourceCode, shell, evaluationException);
</ins><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didEvaluateScript(cookie, m_frame);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcWebScriptObjectmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/WebScriptObject.mm (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/WebScriptObject.mm        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/bindings/objc/WebScriptObject.mm        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;JSC::Exception&gt; exception;
</span><del>-    JSC::JSValue result = JSMainThreadExecState::call(exec, function, callType, callData, [self _imp], argList, exception);
</del><ins>+    JSC::JSValue result = JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, function, callType, callData, [self _imp], argList, exception);
</ins><span class="cx"> 
</span><span class="cx">     if (exception) {
</span><span class="cx">         addExceptionToConsole(exec, exception);
</span><span class="lines">@@ -351,7 +351,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSLockHolder lock(exec);
</span><span class="cx">     
</span><del>-    JSC::JSValue returnValue = JSMainThreadExecState::evaluate(exec, makeSource(String(script)), JSC::JSValue());
</del><ins>+    JSC::JSValue returnValue = JSMainThreadExecState::profiledEvaluate(exec, JSC::ProfilingReason::Other, makeSource(String(script)), JSC::JSValue());
</ins><span class="cx"> 
</span><span class="cx">     id resultObj = [WebScriptObject _convertValueToObjcValue:returnValue originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -213,16 +213,6 @@
</span><span class="cx">     return JSC::LegacyProfiler::profiler()-&gt;stopProfiling(exec, title);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline void startProfiling(Frame* frame, const String&amp; title, RefPtr&lt;Stopwatch&gt;&amp;&amp; stopwatch)
-{
-    startProfiling(toJSDOMWindow(frame, debuggerWorld())-&gt;globalExec(), title, WTFMove(stopwatch));
-}
-
-static inline PassRefPtr&lt;JSC::Profile&gt; stopProfiling(Frame* frame, const String&amp; title)
-{
-    return stopProfiling(toJSDOMWindow(frame, debuggerWorld())-&gt;globalExec(), title);
-}
-
</del><span class="cx"> void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String &amp;title)
</span><span class="cx"> {
</span><span class="cx">     // Only allow recording of a profile if it is anonymous (empty title) or does not match
</span><span class="lines">@@ -276,32 +266,10 @@
</span><span class="cx"> void InspectorTimelineAgent::willCallFunction(const String&amp; scriptName, int scriptLine, Frame* frame)
</span><span class="cx"> {
</span><span class="cx">     pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame);
</span><del>-
-    if (frame &amp;&amp; !m_callStackDepth)
-        startProfiling(frame, ASCIILiteral(&quot;Timeline FunctionCall&quot;), m_environment.executionStopwatch());
-
-    ++m_callStackDepth;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorTimelineAgent::didCallFunction(Frame* frame)
</del><ins>+void InspectorTimelineAgent::didCallFunction(Frame*)
</ins><span class="cx"> {
</span><del>-    if (frame &amp;&amp; m_callStackDepth) {
-        --m_callStackDepth;
-        ASSERT(m_callStackDepth &gt;= 0);
-
-        if (!m_callStackDepth) {
-            if (m_recordStack.isEmpty())
-                return;
-
-            TimelineRecordEntry&amp; entry = m_recordStack.last();
-            ASSERT(entry.type == TimelineRecordType::FunctionCall);
-
-            RefPtr&lt;JSC::Profile&gt; profile = stopProfiling(frame, ASCIILiteral(&quot;Timeline FunctionCall&quot;));
-            if (profile)
-                TimelineRecordFactory::appendProfile(entry.data.get(), profile.release());
-        }
-    }
-
</del><span class="cx">     didCompleteCurrentRecord(TimelineRecordType::FunctionCall);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -407,32 +375,10 @@
</span><span class="cx"> void InspectorTimelineAgent::willEvaluateScript(const String&amp; url, int lineNumber, Frame&amp; frame)
</span><span class="cx"> {
</span><span class="cx">     pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber), TimelineRecordType::EvaluateScript, true, &amp;frame);
</span><del>-
-    if (!m_callStackDepth) {
-        ++m_callStackDepth;
-        startProfiling(&amp;frame, ASCIILiteral(&quot;Timeline EvaluateScript&quot;), m_environment.executionStopwatch());
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorTimelineAgent::didEvaluateScript(Frame&amp; frame)
</del><ins>+void InspectorTimelineAgent::didEvaluateScript(Frame&amp;)
</ins><span class="cx"> {
</span><del>-    if (m_callStackDepth) {
-        --m_callStackDepth;
-        ASSERT(m_callStackDepth &gt;= 0);
-
-        if (!m_callStackDepth) {
-            if (m_recordStack.isEmpty())
-                return;
-
-            TimelineRecordEntry&amp; entry = m_recordStack.last();
-            ASSERT(entry.type == TimelineRecordType::EvaluateScript);
-
-            RefPtr&lt;JSC::Profile&gt; profile = stopProfiling(&amp;frame, ASCIILiteral(&quot;Timeline EvaluateScript&quot;));
-            if (profile)
-                TimelineRecordFactory::appendProfile(entry.data.get(), profile.release());
-        }
-    }
-
</del><span class="cx">     didCompleteCurrentRecord(TimelineRecordType::EvaluateScript);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -196,7 +196,6 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;TimelineRecordEntry&gt; m_recordStack;
</span><span class="cx">     int m_id { 1 };
</span><del>-    int m_callStackDepth { 0 };
</del><span class="cx">     int m_maxCallStackDepth { 5 };
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;TimelineRecordEntry&gt; m_pendingConsoleProfileRecords;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2016-01-11  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Migrate Page Timeline recording to ScriptProfiler
+        https://bugs.webkit.org/show_bug.cgi?id=152727
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Images/TimelineRecordAPI.svg: Added.
+        * UserInterface/Images/gtk/TimelineRecordAPI.svg: Added.
+        New [S] image for API initiated script evaluations.
+        Display matches the existing [S] Script Evaluated.
+        Colors match the gray [N] Native image colors.
+
+        * UserInterface/Models/ScriptInstrument.js:
+        (WebInspector.ScriptInstrument.prototype.startInstrumentation):
+        (WebInspector.ScriptInstrument.prototype.stopInstrumentation):
+        (WebInspector.ScriptInstrument):
+        Use ScriptProfiler, if available, in Web debuggables.
+
+        * UserInterface/Controllers/TimelineManager.js:
+        (WebInspector.TimelineManager):
+        (WebInspector.TimelineManager.prototype.capturingStarted):
+        (WebInspector.TimelineManager.prototype._processRecord):
+        (WebInspector.TimelineManager.prototype._scriptProfilerTypeToScriptTimelineRecordType):
+        (WebInspector.TimelineManager.prototype.scriptProfilerTrackingUpdated):
+        (WebInspector.TimelineManager.prototype.scriptProfilerTrackingCompleted):
+        (WebInspector.TimelineManager.prototype._mergeScriptProfileRecords.let.nextRecord):
+        (WebInspector.TimelineManager.prototype._mergeScriptProfileRecords.let.recordContainsRecord):
+        (WebInspector.TimelineManager.prototype._mergeScriptProfileRecords):
+        When running a timeline on a web debuggable the frontend receives both
+        Timeline event records and ScriptProfiler events. Timeline (Web) records
+        are high level web events like &quot;Script Evaluated&quot;, &quot;Event Dispatched&quot;,
+        &quot;Timer Fired&quot;. The timestamps for these records should always be wrapping
+        a ScriptProfiler event and its associated profile data. So, at the end
+        of a recording we merge ScriptProfiler profile data into the original
+        Timeline (Web) record.
+
+        * UserInterface/Models/ScriptTimelineRecord.js:
+        (WebInspector.ScriptTimelineRecord.prototype.get profilePayload):
+        (WebInspector.ScriptTimelineRecord.prototype.set profilePayload):
+        (WebInspector.ScriptTimelineRecord.prototype.setProfilePayload): Deleted.
+        Replace method with getter/setter.
+
+        (WebInspector.ScriptTimelineRecord.EventType.displayName):
+        Add a new event type for API records, but share display name with Script Evaluated.
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        Fix typo.
+
+        * UserInterface/Views/ScriptTimelineView.css:
+        (.timeline-view.script &gt; .data-grid .eventType-column): Deleted.
+        There is no &quot;eventType&quot; column in the ScriptTimelineView datagrid, so remove styles.
+
+        * UserInterface/Views/TimelineIcons.css:
+        (.api-record .icon):
+        * UserInterface/Views/TimelineRecordTreeElement.js:
+        (WebInspector.TimelineRecordTreeElement):
+        For API Script Evaluation records use the new icon.
+
</ins><span class="cx"> 2016-01-10  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Uncaught Exception selecting IndexedDB host folder in Storage tab
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -42,7 +42,8 @@
</span><span class="cx">         this._autoCapturingMainResource = null;
</span><span class="cx">         this._boundStopCapturing = this.stopCapturing.bind(this);
</span><span class="cx"> 
</span><del>-        this._scriptProfileRecords = null;
</del><ins>+        this._webTimelineScriptRecordsExpectingScriptProfilerEvents = null;
+        this._scriptProfilerRecords = null;
</ins><span class="cx"> 
</span><span class="cx">         this.reset();
</span><span class="cx">     }
</span><span class="lines">@@ -135,6 +136,7 @@
</span><span class="cx"> 
</span><span class="cx">         // NOTE: Always stop immediately instead of waiting for a Timeline.recordingStopped event.
</span><span class="cx">         // This way the UI feels as responsive to a stop as possible.
</span><ins>+        // FIXME: &lt;https://webkit.org/b/152904&gt; Web Inspector: Timeline UI should keep up with processing all incoming records
</ins><span class="cx">         this.capturingStopped();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -160,7 +162,7 @@
</span><span class="cx"> 
</span><span class="cx">     scriptProfilerIsTracking()
</span><span class="cx">     {
</span><del>-        return this._scriptProfileRecords !== null;
</del><ins>+        return this._scriptProfilerRecords !== null;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="lines">@@ -175,6 +177,8 @@
</span><span class="cx">         if (startTime)
</span><span class="cx">             this.activeRecording.initializeTimeBoundsIfNecessary(startTime);
</span><span class="cx"> 
</span><ins>+        this._webTimelineScriptRecordsExpectingScriptProfilerEvents = [];
+
</ins><span class="cx">         this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStarted, {startTime});
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -347,14 +351,18 @@
</span><span class="cx"> 
</span><span class="cx">             var profileData = recordPayload.data.profile;
</span><span class="cx"> 
</span><ins>+            var record;
</ins><span class="cx">             switch (parentRecordPayload &amp;&amp; parentRecordPayload.type) {
</span><span class="cx">             case TimelineAgent.EventType.TimerFire:
</span><del>-                return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profileData);
</del><ins>+                record = new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profileData);
+                break;
</ins><span class="cx">             default:
</span><del>-                return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated, startTime, endTime, callFrames, sourceCodeLocation, null, profileData);
</del><ins>+                record = new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated, startTime, endTime, callFrames, sourceCodeLocation, null, profileData);
+                break;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            break;
</del><ins>+            this._webTimelineScriptRecordsExpectingScriptProfilerEvents.push(record);
+            return record;
</ins><span class="cx"> 
</span><span class="cx">         case TimelineAgent.EventType.ConsoleProfile:
</span><span class="cx">             var profileData = recordPayload.data.profile;
</span><span class="lines">@@ -370,8 +378,10 @@
</span><span class="cx">         case TimelineAgent.EventType.FunctionCall:
</span><span class="cx">             // FunctionCall always happens as a child of another record, and since the FunctionCall record
</span><span class="cx">             // has useful info we just make the timeline record here (combining the data from both records).
</span><del>-            if (!parentRecordPayload)
</del><ins>+            if (!parentRecordPayload) {
+                console.warn(&quot;Unexpectedly received a FunctionCall timeline record without a parent record&quot;);
</ins><span class="cx">                 break;
</span><ins>+            }
</ins><span class="cx"> 
</span><span class="cx">             if (!sourceCodeLocation) {
</span><span class="cx">                 var mainFrame = WebInspector.frameResourceManager.mainFrame;
</span><span class="lines">@@ -387,17 +397,33 @@
</span><span class="cx"> 
</span><span class="cx">             var profileData = recordPayload.data.profile;
</span><span class="cx"> 
</span><ins>+            var record;
</ins><span class="cx">             switch (parentRecordPayload.type) {
</span><span class="cx">             case TimelineAgent.EventType.TimerFire:
</span><del>-                return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profileData);
</del><ins>+                record = new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profileData);
+                break;
</ins><span class="cx">             case TimelineAgent.EventType.EventDispatch:
</span><del>-                return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.type, profileData);
</del><ins>+                record = new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.type, profileData);
+                break;
</ins><span class="cx">             case TimelineAgent.EventType.FireAnimationFrame:
</span><del>-                return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.id, profileData);
</del><ins>+                record = new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.id, profileData);
+                break;
+            case TimelineAgent.EventType.FunctionCall:
+                record = new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.id, profileData);
+                break;
+            case TimelineAgent.EventType.RenderingFrame:
+                record = new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.id, profileData);
+                break;
+
</ins><span class="cx">             default:
</span><span class="cx">                 console.assert(false, &quot;Missed FunctionCall embedded inside of: &quot; + parentRecordPayload.type);
</span><ins>+                break;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            if (record) {
+                this._webTimelineScriptRecordsExpectingScriptProfilerEvents.push(record);
+                return record;
+            }
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         case TimelineAgent.EventType.ProbeSample:
</span><span class="lines">@@ -621,9 +647,21 @@
</span><span class="cx">         this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.GarbageCollected, collection.startTime, collection.endTime, null, null, collection));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _scriptProfilerTypeToScriptTimelineRecordType(type)
+    {
+        switch (type) {
+        case ScriptProfilerAgent.EventType.API:
+            return WebInspector.ScriptTimelineRecord.EventType.APIScriptEvaluated;
+        case ScriptProfilerAgent.EventType.Microtask:
+            return WebInspector.ScriptTimelineRecord.EventType.MicrotaskDispatched;
+        case ScriptProfilerAgent.EventType.Other:
+            return WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated;
+        }
+    }
+
</ins><span class="cx">     scriptProfilerTrackingStarted(timestamp)
</span><span class="cx">     {
</span><del>-        this._scriptProfileRecords = [];
</del><ins>+        this._scriptProfilerRecords = [];
</ins><span class="cx"> 
</span><span class="cx">         this.capturingStarted(timestamp);
</span><span class="cx">     }
</span><span class="lines">@@ -631,25 +669,98 @@
</span><span class="cx">     scriptProfilerTrackingUpdated(event)
</span><span class="cx">     {
</span><span class="cx">         let {startTime, endTime, type} = event;
</span><del>-        let scriptRecordType = type === ScriptProfilerAgent.EventType.Microtask ? WebInspector.ScriptTimelineRecord.EventType.MicrotaskDispatched : WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated;
</del><ins>+        let scriptRecordType = this._scriptProfilerTypeToScriptTimelineRecordType(type);
</ins><span class="cx">         let record = new WebInspector.ScriptTimelineRecord(scriptRecordType, startTime, endTime, null, null, null, null);
</span><del>-        this._scriptProfileRecords.push(record);
-        this._addRecord(record);
</del><ins>+        record.__scriptProfilerType = type;
+        this._scriptProfilerRecords.push(record);
+
+        // &quot;Other&quot; events, generated by Web content, will have wrapping Timeline records
+        // and need to be merged. Non-Other events, generated purely by the JavaScript
+        // engine or outside of the page via APIs, will not have wrapping Timeline
+        // records, so these records can just be added right now.
+        if (type !== ScriptProfilerAgent.EventType.Other)
+            this._addRecord(record);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     scriptProfilerTrackingCompleted(profiles)
</span><span class="cx">     {
</span><ins>+        console.assert(!this._webTimelineScriptRecordsExpectingScriptProfilerEvents || this._scriptProfilerRecords.length &gt;= this._webTimelineScriptRecordsExpectingScriptProfilerEvents.length);
+
+        // Associate the profiles with the ScriptProfiler created records.
</ins><span class="cx">         if (profiles) {
</span><del>-            console.assert(this._scriptProfileRecords.length === profiles.length, this._scriptProfileRecords.length, profiles.length);
-            for (let i = 0; i &lt; this._scriptProfileRecords.length; ++i)
-                this._scriptProfileRecords[i].setProfilePayload(profiles[i]);
</del><ins>+            console.assert(this._scriptProfilerRecords.length === profiles.length, this._scriptProfilerRecords.length, profiles.length);
+            for (let i = 0; i &lt; this._scriptProfilerRecords.length; ++i)
+                this._scriptProfilerRecords[i].profilePayload = profiles[i];
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        this._scriptProfileRecords = null;
</del><ins>+        // Associate the ScriptProfiler created records with Web Timeline records.
+        // Filter out the already added ScriptProfiler events which should not have been wrapped.
+        if (WebInspector.debuggableType !== WebInspector.DebuggableType.JavaScript) {
+            this._scriptProfilerRecords = this._scriptProfilerRecords.filter((x) =&gt; x.__scriptProfilerType === ScriptProfilerAgent.EventType.Other);
+            this._mergeScriptProfileRecords();
+        }
</ins><span class="cx"> 
</span><ins>+        this._scriptProfilerRecords = null;
+
</ins><span class="cx">         let timeline = this.activeRecording.timelineForRecordType(WebInspector.TimelineRecord.Type.Script);
</span><span class="cx">         timeline.refresh();
</span><span class="cx">     }
</span><ins>+
+    _mergeScriptProfileRecords()
+    {
+        let nextRecord = function(list) { return list.shift() || null; }
+        let nextWebTimelineRecord = nextRecord.bind(null, this._webTimelineScriptRecordsExpectingScriptProfilerEvents);
+        let nextScriptProfilerRecord = nextRecord.bind(null, this._scriptProfilerRecords);
+        let recordEnclosesRecord = function(record1, record2) {
+            return record1.startTime &lt;= record2.startTime &amp;&amp; record1.endTime &gt;= record2.endTime;
+        }
+
+        let webRecord = nextWebTimelineRecord();
+        let profilerRecord = nextScriptProfilerRecord();
+
+        while (webRecord) {
+            // Skip web records with parent web records. For example an EvaluateScript with an EvaluateScript parent.
+            if (webRecord.parent instanceof WebInspector.ScriptTimelineRecord) {
+                console.assert(recordEnclosesRecord(webRecord.parent, webRecord), &quot;Timeline Record incorrectly wrapping another Timeline Record&quot;);
+                webRecord = nextWebTimelineRecord();
+                continue;
+            }
+
+            // Normal case of a Web record wrapping a Script record.
+            if (recordEnclosesRecord(webRecord, profilerRecord)) {
+                webRecord.profilePayload = profilerRecord.profilePayload;
+                profilerRecord = nextScriptProfilerRecord();
+
+                // If there are more script profile records in the same time interval, add them
+                // as individual script evaluated records with profiles. This can happen with
+                // web microtask checkpoints that are technically inside of other web records.
+                // FIXME: &lt;https://webkit.org/b/152903&gt; Web Inspector: Timeline Cleanup: Better Timeline Record for Microtask Checkpoints
+                while (profilerRecord &amp;&amp; recordEnclosesRecord(webRecord, profilerRecord)) {
+                    this._addRecord(profilerRecord);
+                    profilerRecord = nextScriptProfilerRecord();
+                }
+
+                webRecord = nextWebTimelineRecord();
+                continue;
+            }
+
+            // Profiler Record is entirely after the Web Record. This would mean an empty web record.
+            if (profilerRecord.startTime &gt; webRecord.endTime) {
+                console.warn(&quot;Unexpected case of a Timeline record not containing a ScriptProfiler event and profile data&quot;);
+                webRecord = nextWebTimelineRecord();
+                continue;
+            }
+
+            // Non-wrapped profiler record.
+            console.warn(&quot;Unexpected case of a ScriptProfiler event not being contained by a Timeline record&quot;);
+            this._addRecord(profilerRecord);
+            profilerRecord = nextScriptProfilerRecord();
+        }
+
+        // Skipping the remaining ScriptProfiler events to match the current UI for handling Timeline records.
+        // However, the remaining ScriptProfiler records are valid and could be shown.
+        // FIXME: &lt;https://webkit.org/b/152904&gt; Web Inspector: Timeline UI should keep up with processing all incoming records
+    }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.TimelineManager.Event = {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesTimelineRecordAPIsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordAPI.svg (0 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordAPI.svg                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordAPI.svg        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!-- Copyright © 2016 Apple Inc. All rights reserved. --&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; id=&quot;root&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot;&gt;
+    &lt;path fill=&quot;rgb(203, 203, 203)&quot; d=&quot;M 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 L 3 1 Z M 3 1&quot;/&gt;
+    &lt;path fill=&quot;rgb(153, 153, 153)&quot; d=&quot;M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 M 13 2 C 13.550781 2 14 2.449219 14 3 L 14 13 C 14 13.550781 13.550781 14 13 14 L 3 14 C 2.449219 14 2 13.550781 2 13 L 2 3 C 2 2.449219 2.449219 2 3 2 L 13 2&quot;/&gt;
+    &lt;path fill=&quot;rgb(166, 166, 166)&quot; d=&quot;M 5.19849793 12.6584609 C 5.2831472 12.676395 6.98277851 12.9487305 7.62939453 12.9487305 C 8.79640591 12.9487305 9.76331344 12.6806542 10.5034462 12.1146703 C 11.3037555 11.5026691 11.7177734 10.6286312 11.7177734 9.58544922 C 11.7177734 8.84534902 11.4998181 8.18341061 11.0628295 7.63852362 C 10.6767371 7.15709971 10.0557113 6.69185669 9.18734192 6.20492057 L 8.61524891 5.88648574 C 8.27558142 5.69523066 8.15431716 5.69238281 8.23632812 5.69238281 C 8.56703836 5.69238281 9.10333246 5.81936052 9.8138795 6.08542439 L 11.1645508 6.59118236 L 11.1645508 5.14892578 L 11.1645508 3.87597656 L 11.1645508 3.07965768 L 10.3884483 2.90136387 C 9.52406853 2.70279014 8.73593121 2.60205078 8.02148438 2.60205078 C 7.01081351 2.60205078 6.14909735 2.87110984 5.47554965 3.42697448 C 4.76046595 4.01711791 4.38964844 4.82767811 4.38964844 5.77734375 C 4.38964844 6.49239045 4.61205052 7.14196725 5.04920932 7.68841575 C 5.43639142 8.1723
 9338 6.03437082 8.62885808 6.84888633 9.08727887 L 7.38545082 9.38538774 C 7.71699471 9.57330366 7.92926232 9.72631865 7.99164827 9.79813503 C 7.94460492 9.81851991 7.82252674 9.85302734 7.60253906 9.85302734 C 7.14294036 9.85302734 6.53493744 9.70437137 5.79174704 9.39341305 L 4.40576172 8.81350287 L 4.40576172 10.315918 L 4.40576172 11.6801758 L 4.40576172 12.4905083 L 5.19849793 12.6584609 C 5.52713094 12.7280865 5.52713094 12.7280865 5.57407851 12.738033 L 5.19849793 12.6584609 Z M 5.19849793 12.6584609&quot;/&gt;
+    &lt;path fill=&quot;white&quot; d=&quot;M 5.40576172 11.6801758 L 5.40576172 10.315918 C 6.26156027 10.6739927 6.99381206 10.8530273 7.60253906 10.8530273 C 8.02864796 10.8530273 8.36433797 10.758139 8.60961914 10.5683594 C 8.85490031 10.3785798 8.97753906 10.1207699 8.97753906 9.79492188 C 8.97753906 9.53710809 8.90055416 9.31958096 8.74658203 9.14233398 C 8.59260991 8.965087 8.3007834 8.75472127 7.87109375 8.51123047 L 7.33935547 8.21582031 C 6.6267868 7.81477664 6.12369938 7.43074728 5.83007812 7.0637207 C 5.53645687 6.69669413 5.38964844 6.2679061 5.38964844 5.77734375 C 5.38964844 5.12206704 5.63045007 4.59570511 6.11206055 4.19824219 C 6.59367103 3.80077926 7.23013927 3.60205078 8.02148438 3.60205078 C 8.65527661 3.60205078 9.36962493 3.69335846 10.1645508 3.87597656 L 10.1645508 5.14892578 C 9.3517212 4.84456228 8.70898674 4.69238281 8.23632812 4.69238281 C 7.87109192 4.69238281 7.57837024 4.77384359 7.3581543 4.93676758 C 7.13793835 5.09969157 7.02783203 5.313638
  7.02783203 5.57861328 C 7.02783203 5.79703885 7.10481694 5.98860595 7.25878906 6.15332031 C 7.41276119 6.31803468 7.70279735 6.52034385 8.12890625 6.76025391 L 8.69824219 7.07714844 C 9.46452206 7.50683809 9.99267433 7.9025047 10.2827148 8.26416016 C 10.5727554 8.62581561 10.7177734 9.06624089 10.7177734 9.58544922 C 10.7177734 10.3230831 10.4438504 10.9013651 9.89599609 11.3203125 C 9.34814179 11.7392599 8.59261549 11.9487305 7.62939453 11.9487305 C 6.99202155 11.9487305 6.25081803 11.8592131 5.40576172 11.6801758 C 5.40576172 11.6801758 6.25081803 11.8592131 5.40576172 11.6801758 L 5.40576172 11.6801758 L 5.40576172 11.6801758 Z M 5.40576172 11.6801758&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesgtkTimelineRecordAPIsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/gtk/TimelineRecordAPI.svg (0 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/gtk/TimelineRecordAPI.svg                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/gtk/TimelineRecordAPI.svg        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;!-- Licensed under the Creative Commons Attribution-Share Alike 3.0 United States License (http://creativecommons.org/licenses/by-sa/3.0/) --&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; id=&quot;root&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot;&gt;
+ &lt;defs&gt;
+  &lt;radialGradient id=&quot;b&quot; cx=&quot;301&quot; cy=&quot;51.5&quot; r=&quot;19.5&quot; gradientUnits=&quot;userSpaceOnUse&quot; gradientTransform=&quot;matrix(.97063 1.9684e-8 0 .28611 -291.16 -14.63)&quot;&gt;
+   &lt;stop stop-color=&quot;#fff&quot; offset=&quot;0&quot;/&gt;
+   &lt;stop stop-color=&quot;#fff&quot; stop-opacity=&quot;0&quot; offset=&quot;1&quot;/&gt;
+  &lt;/radialGradient&gt;
+  &lt;radialGradient id=&quot;a&quot; cx=&quot;24.446&quot; cy=&quot;35.878&quot; r=&quot;20.531&quot; gradientUnits=&quot;userSpaceOnUse&quot; gradientTransform=&quot;matrix(.85696 3.2529e-7 -1.253e-7 .33010 -12.949 .77181)&quot;&gt;
+   &lt;stop stop-color=&quot;#fff&quot; offset=&quot;0&quot;/&gt;
+   &lt;stop stop-color=&quot;#dcdcdc&quot; offset=&quot;1&quot;/&gt;
+  &lt;/radialGradient&gt;
+  &lt;linearGradient id=&quot;c&quot; x1=&quot;321.57&quot; x2=&quot;311.65&quot; y1=&quot;145.52&quot; y2=&quot;118.5&quot; gradientUnits=&quot;userSpaceOnUse&quot; gradientTransform=&quot;matrix(.55569 0 0 .55568 -169.27 -70.906)&quot;&gt;
+   &lt;stop stop-color=&quot;#9b9b9b&quot; offset=&quot;0&quot;/&gt;
+   &lt;stop stop-color=&quot;#d3d7cf&quot; offset=&quot;1&quot;/&gt;
+  &lt;/linearGradient&gt;
+  &lt;linearGradient id=&quot;d&quot; x1=&quot;491.22&quot; x2=&quot;491.22&quot; y1=&quot;506.65&quot; y2=&quot;732.05&quot; gradientUnits=&quot;userSpaceOnUse&quot; gradientTransform=&quot;matrix(.093294 0 0 .093294 -35.871 -43.769)&quot;&gt;
+   &lt;stop stop-color=&quot;#888a85&quot; offset=&quot;0&quot;/&gt;
+   &lt;stop stop-color=&quot;#d3d7cf&quot; offset=&quot;1&quot;/&gt;
+  &lt;/linearGradient&gt;
+ &lt;/defs&gt;
+ &lt;rect width=&quot;15.004&quot; height=&quot;15.003&quot; x=&quot;.49815&quot; y=&quot;.49833&quot; fill=&quot;url(#a)&quot; fill-rule=&quot;evenodd&quot; stroke=&quot;url(#c)&quot; stroke-miterlimit=&quot;10&quot; rx=&quot;1.5143&quot; ry=&quot;1.5143&quot; stroke-linejoin=&quot;bevel&quot;/&gt;
+ &lt;rect width=&quot;12.997&quot; height=&quot;13&quot; x=&quot;1.5014&quot; y=&quot;1.5016&quot; fill=&quot;none&quot; stroke=&quot;#fff&quot; stroke-miterlimit=&quot;10&quot; ry=&quot;.50810&quot; stroke-linejoin=&quot;bevel&quot; rx=&quot;.50812&quot;/&gt;
+ &lt;rect width=&quot;14&quot; height=&quot;14&quot; x=&quot;1.0017&quot; y=&quot;1.0016&quot; fill=&quot;url(#b)&quot; fill-rule=&quot;evenodd&quot; rx=&quot;1.9062&quot; ry=&quot;1.9062&quot;/&gt;
+ &lt;path fill=&quot;#fff&quot; d=&quot;m8.154 4.7563c-0.9594 0-1.7722 0.24647-2.3438 0.6875-0.57159 0.44103-0.875 1.0875-0.875 1.8125 0 0.76738 0.30008 1.3618 0.75 1.75 0.44992 0.38821 1.0123 0.59908 1.5625 0.78125 0.55019 0.18217 1.1026 0.32786 1.4687 0.5 0.18307 0.08607 0.32533 0.18927 0.40625 0.28125s0.09673 0.15012 0.09375 0.28125c0 0.18652-0.09038 0.35419-0.34375 0.5s-0.67085 0.25-1.1562 0.25c-0.38979 0-1.0737-0.12598-2.0938-0.5l-0.1875-0.0625a0.25002 0.25002 0 0 0 -0.09375 -0.03125 0.25002 0.25002 0 0 0 -0.0625 0 0.25002 0.25002 0 0 0 -0.15625 0.125 0.25002 0.25002 0 0 0 -0.03125 0.03125l-0.46875 1.3125a0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0.03125 0.09375 0.25002 0.25002 0 0 0 0.03125 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.0625 0.03125 0.25002 0.25002 0 0 0 0.03125 0l0.1875 0.09375v-0.03125c0.77838 0.30206 1.5983 0.59375 2.6562 0.59375 1.2747 0 2.1718-0.32057 2.75-0.8125 0.57818-0.491
 93 0.8125-1.1637 0.8125-1.7812 0-0.75379-0.30407-1.2962-0.75-1.6875-0.4456-0.3912-1.0134-0.6241-1.5622-0.8124s-1.097-0.3332-1.4688-0.5c-0.18586-0.083381-0.32338-0.165-0.40625-0.25-0.08287-0.085001-0.125-0.17508-0.125-0.28125 0-0.20152 0.09694-0.33345 0.3125-0.46875s0.58083-0.25 1.0312-0.25c0.6839 0 1.2751 0.18955 1.9062 0.4375a0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.09375 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.03125l0.4375-1.2813a0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 -0.0625 -0.09375 0.25002 0.25002 0 0 0 -0.0625 -0.03125l-0.15625-0.0625a0.25002 0.25002 0 0 0 -0.03125 0c-0.29122-0.093605-1.1271-0.46875-2.4375-0.46875z&quot; display=&quot;block&quot;/&gt;
+ &lt;path fill=&quot;url(#d)&quot; d=&quot;m8.2058 3.726c-0.9594 0-1.7722 0.24647-2.3438 0.6875-0.57159 0.44103-0.875 1.0875-0.875 1.8125 0 0.76738 0.30008 1.3618 0.75 1.75 0.44992 0.38821 1.0123 0.59908 1.5625 0.78125 0.55019 0.18217 1.1026 0.32786 1.4687 0.5 0.18307 0.086072 0.32533 0.18927 0.40625 0.28125 0.08092 0.091977 0.09673 0.15012 0.09375 0.28125 0 0.18652-0.09038 0.35419-0.34375 0.5s-0.67085 0.25-1.1562 0.25c-0.38979 0-1.0737-0.12598-2.0938-0.5l-0.1875-0.0625a0.25002 0.25002 0 0 0 -0.09375 -0.03125 0.25002 0.25002 0 0 0 -0.0625 0 0.25002 0.25002 0 0 0 -0.15625 0.125 0.25002 0.25002 0 0 0 -0.03125 0.03125l-0.46875 1.3125a0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0.03125 0.09375 0.25002 0.25002 0 0 0 0.03125 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.0625 0.03125 0.25002 0.25002 0 0 0 0.03125 0l0.1875 0.09375v-0.03125c0.77838 0.30206 1.5983 0.59375 2.6562 0.59375 1.2747 0 2.1718-0.32057 2.75
 -0.8125 0.57818-0.49193 0.8125-1.1637 0.8125-1.7812 0-0.75379-0.30407-1.2962-0.75-1.6875-0.446-0.3916-1.0136-0.6244-1.5624-0.8127-0.5488-0.1884-1.097-0.3333-1.4688-0.5-0.18586-0.083381-0.32338-0.165-0.40625-0.25-0.08287-0.085001-0.125-0.17508-0.125-0.28125 0-0.20152 0.09694-0.33345 0.3125-0.46875s0.58083-0.25 1.0312-0.25c0.6839 0 1.2751 0.18955 1.9062 0.4375a0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.09375 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.03125l0.4375-1.2813a0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 -0.0625 -0.09375 0.25002 0.25002 0 0 0 -0.0625 -0.03125l-0.15625-0.0625a0.25002 0.25002 0 0 0 -0.03125 0c-0.29122-0.093605-1.1271-0.46875-2.4375-0.46875z&quot; display=&quot;block&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScriptInstrumentjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -35,8 +35,7 @@
</span><span class="cx">     startInstrumentation()
</span><span class="cx">     {
</span><span class="cx">         // COMPATIBILITY (iOS 9): Legacy backends did not have ScriptProfilerAgent. They use TimelineAgent.
</span><del>-        // FIXME: ScriptProfilerAgent is only enabled for JavaScript debuggables until we transition TimelineAgent for Web debuggables.
-        if (!window.ScriptProfilerAgent || WebInspector.debuggableType !== WebInspector.DebuggableType.JavaScript) {
</del><ins>+        if (!window.ScriptProfilerAgent) {
</ins><span class="cx">             super.startInstrumentation();
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -50,8 +49,7 @@
</span><span class="cx">     stopInstrumentation()
</span><span class="cx">     {
</span><span class="cx">         // COMPATIBILITY (iOS 9): Legacy backends did not have ScriptProfilerAgent. They use TimelineAgent.
</span><del>-        // FIXME: ScriptProfilerAgent is only enabled for JavaScript debuggables until we transition TimelineAgent for Web debuggables.
-        if (!window.ScriptProfilerAgent || WebInspector.debuggableType !== WebInspector.DebuggableType.JavaScript) {
</del><ins>+        if (!window.ScriptProfilerAgent) {
</ins><span class="cx">             super.stopInstrumentation();
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScriptTimelineRecordjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -71,11 +71,16 @@
</span><span class="cx">         cookie[WebInspector.ScriptTimelineRecord.DetailsCookieKey] = this._details;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    setProfilePayload(profilePayload)
</del><ins>+    get profilePayload()
</ins><span class="cx">     {
</span><del>-        this._profilePayload = profilePayload;
</del><ins>+        return this._profilePayload;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    set profilePayload(payload)
+    {
+        this._profilePayload = payload;
+    }
+
</ins><span class="cx">     // Private
</span><span class="cx"> 
</span><span class="cx">     _initializeProfileFromPayload(payload)
</span><span class="lines">@@ -160,6 +165,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebInspector.ScriptTimelineRecord.EventType = {
</span><span class="cx">     ScriptEvaluated: &quot;script-timeline-record-script-evaluated&quot;,
</span><ins>+    APIScriptEvaluated: &quot;script-timeline-record-api-script-evaluated&quot;,
</ins><span class="cx">     MicrotaskDispatched: &quot;script-timeline-record-microtask-dispatched&quot;,
</span><span class="cx">     EventDispatched: &quot;script-timeline-record-event-dispatched&quot;,
</span><span class="cx">     ProbeSampleRecorded: &quot;script-timeline-record-probe-sample-recorded&quot;,
</span><span class="lines">@@ -333,6 +339,7 @@
</span><span class="cx"> 
</span><span class="cx">     switch(eventType) {
</span><span class="cx">     case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
</span><ins>+    case WebInspector.ScriptTimelineRecord.EventType.APIScriptEvaluated:
</ins><span class="cx">         return WebInspector.UIString(&quot;Script Evaluated&quot;);
</span><span class="cx">     case WebInspector.ScriptTimelineRecord.EventType.MicrotaskDispatched:
</span><span class="cx">         return WebInspector.UIString(&quot;Microtask Dispatched&quot;);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -809,7 +809,7 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol = Symbol(&quot;supresss-filtering&quot;);
</del><ins>+WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol = Symbol(&quot;suppress-filtering&quot;);
</ins><span class="cx"> WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol = Symbol(&quot;was-expanded-during-filtering&quot;);
</span><span class="cx"> 
</span><span class="cx"> WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName = &quot;overflow-shadow&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -31,10 +31,6 @@
</span><span class="cx">     bottom: 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.timeline-view.script &gt; .data-grid .eventType-column {
-    border-right: none;
-}
-
</del><span class="cx"> .sidebar &gt; .panel.navigation.timeline.timeline-recording-content-view-showing .navigation-sidebar-panel-content-tree-outline.script .item .subtitle {
</span><span class="cx">     display: none;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -83,6 +83,10 @@
</span><span class="cx">     content: url(../Images/TimelineRecordRenderingFrame.svg);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.api-record .icon {
+    content: url(../Images/TimelineRecordAPI.svg);
+}
+
</ins><span class="cx"> .evaluated-record .icon {
</span><span class="cx">     content: url(../Images/TimelineRecordScriptEvaluated.svg);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js (194870 => 194871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2016-01-11 23:16:17 UTC (rev 194870)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2016-01-11 23:34:43 UTC (rev 194871)
</span><span class="lines">@@ -76,6 +76,9 @@
</span><span class="cx">             title = WebInspector.ScriptTimelineRecord.EventType.displayName(timelineRecord.eventType, timelineRecord.details, includeDetailsInMainTitle);
</span><span class="cx"> 
</span><span class="cx">             switch (timelineRecord.eventType) {
</span><ins>+            case WebInspector.ScriptTimelineRecord.EventType.APIScriptEvaluated:
+                iconStyleClass = WebInspector.TimelineRecordTreeElement.APIRecordIconStyleClass;
+                break;
</ins><span class="cx">             case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
</span><span class="cx">                 iconStyleClass = WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;
</span><span class="cx">                 break;
</span><span class="lines">@@ -182,6 +185,7 @@
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass = &quot;paint-record&quot;;
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass = &quot;composite-record&quot;;
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass = &quot;rendering-frame-record&quot;;
</span><ins>+WebInspector.TimelineRecordTreeElement.APIRecordIconStyleClass = &quot;api-record&quot;;
</ins><span class="cx"> WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass = &quot;evaluated-record&quot;;
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass = &quot;event-record&quot;;
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass = &quot;timer-record&quot;;
</span></span></pre>
</div>
</div>

</body>
</html>