<!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>[167509] trunk/Source/WebInspectorUI</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/167509">167509</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-04-18 14:21:39 -0700 (Fri, 18 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: add entries for probe samples in the JS/Events timeline UI
https://bugs.webkit.org/show_bug.cgi?id=131173

Patch by Katie Madonna &lt;madonnk@gmail.com&gt; on 2014-04-18
Reviewed by Timothy Hatcher.

Create probe sample fired entries for the JS/Events timeline UI.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/ProbeManager.js:
(WebInspector.ProbeManager.prototype.probeForIdentifier): Added.
* UserInterface/Controllers/TimelineManager.js: Added cases for probe sample recorded.
(WebInspector.TimelineManager.prototype.eventRecorded.processRecord):
(WebInspector.TimelineManager.prototype.eventRecorded):
* UserInterface/Images/TimelineRecordProbeSampled.svg: Added.
* UserInterface/Models/ScriptTimelineRecord.js: Create ProbeSampleRecorded record for ProbeSample case.
* UserInterface/Views/TimelineIcons.css:
(.probe-record .icon): Added.
* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement): Added case for probe sample recorded.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersProbeManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScriptTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js</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="#trunkSourceWebInspectorUIUserInterfaceImagesTimelineRecordProbeSampledsvg">trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordProbeSampled.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (167508 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-04-18 21:03:23 UTC (rev 167508)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-04-18 21:21:39 UTC (rev 167509)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-04-18  Katie Madonna  &lt;madonnk@gmail.com&gt;
+
+        Web Inspector: add entries for probe samples in the JS/Events timeline UI
+        https://bugs.webkit.org/show_bug.cgi?id=131173
+
+        Reviewed by Timothy Hatcher.
+
+        Create probe sample fired entries for the JS/Events timeline UI.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Controllers/ProbeManager.js:
+        (WebInspector.ProbeManager.prototype.probeForIdentifier): Added.
+        * UserInterface/Controllers/TimelineManager.js: Added cases for probe sample recorded.
+        (WebInspector.TimelineManager.prototype.eventRecorded.processRecord):
+        (WebInspector.TimelineManager.prototype.eventRecorded):
+        * UserInterface/Images/TimelineRecordProbeSampled.svg: Added.
+        * UserInterface/Models/ScriptTimelineRecord.js: Create ProbeSampleRecorded record for ProbeSample case.
+        * UserInterface/Views/TimelineIcons.css:
+        (.probe-record .icon): Added.
+        * UserInterface/Views/TimelineRecordTreeElement.js:
+        (WebInspector.TimelineRecordTreeElement): Added case for probe sample recorded.
+
</ins><span class="cx"> 2014-04-15  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: CodeMirror LICENSE is not properly added to combined files
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (167508 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-04-18 21:03:23 UTC (rev 167508)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-04-18 21:21:39 UTC (rev 167509)
</span><span class="lines">@@ -324,6 +324,7 @@
</span><span class="cx"> localizedStrings[&quot;Primary Key&quot;] = &quot;Primary Key&quot;;
</span><span class="cx"> localizedStrings[&quot;Primary Key \u2014 %s&quot;] = &quot;Primary Key \u2014 %s&quot;;
</span><span class="cx"> localizedStrings[&quot;Probe Expression&quot;] = &quot;Probe Expression&quot;;
</span><ins>+localizedStrings[&quot;Probe Sample Recorded&quot;] = &quot;Probe Sample Recorded&quot;;
</ins><span class="cx"> localizedStrings[&quot;Probes&quot;] = &quot;Probes&quot;;
</span><span class="cx"> localizedStrings[&quot;Processing Instruction&quot;] = &quot;Processing Instruction&quot;;
</span><span class="cx"> localizedStrings[&quot;Profile %d&quot;] = &quot;Profile %d&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersProbeManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js (167508 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js        2014-04-18 21:03:23 UTC (rev 167508)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js        2014-04-18 21:21:39 UTC (rev 167509)
</span><span class="lines">@@ -64,6 +64,11 @@
</span><span class="cx">         return sets;
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    probeForIdentifier: function(identifier)
+    {
+        return this._probesByIdentifier.get(identifier);
+    },
+
</ins><span class="cx">     // Protected (called by WebInspector.DebuggerObserver)
</span><span class="cx"> 
</span><span class="cx">     didSampleProbe: function(sample)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (167508 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2014-04-18 21:03:23 UTC (rev 167508)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2014-04-18 21:21:39 UTC (rev 167509)
</span><span class="lines">@@ -272,7 +272,9 @@
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">             case TimelineAgent.EventType.ProbeSample:
</span><del>-                // FIXME: Create timeline records for probe samples &lt;https://webkit.org/b/131173&gt;
</del><ins>+                // Pass the startTime as the endTime since this record type has no duration.
+                sourceCodeLocation = WebInspector.probeManager.probeForIdentifier(recordPayload.data.probeId).breakpoint.sourceCodeLocation;
+                this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ProbeSampleRecorded, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.probeId, profile));
</ins><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">             case TimelineAgent.EventType.TimerInstall:
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesTimelineRecordProbeSampledsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordProbeSampled.svg (0 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordProbeSampled.svg                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordProbeSampled.svg        2014-04-18 21:21:39 UTC (rev 167509)
</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 © 2013 Apple Inc. All rights reserved. --&gt;
+&lt;svg viewBox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+    &lt;path fill=&quot;rgb(190, 165, 202)&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 Z&quot;/&gt;
+    &lt;path fill=&quot;rgb(141, 118, 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(153, 127, 166)&quot; d=&quot;M 7.09187665 9.86486483 L 8.09187665 9.86486483 L 8.09187675 12 L 8.09187675 13 L 7.09187675 13 L 5.4 13 L 4.4 13 L 4.4 12 L 4.4 4 L 4.4 3 L 5.4 3 L 8.2907563 3 C 9.49663194 3 10.4135483 3.20769232 11.0534889 3.69149996 C 11.7636984 4.22843229 12.097479 5.0719049 12.097479 6.12432432 C 12.097479 7.27475638 11.6870881 8.23200847 10.8722916 8.91131913 C 10.0975424 9.55724163 9.06464428 9.86486486 7.80896359 9.86486486 L 7.09187675 9.86486486 L 7.09187675 9.36486486 L 7.09187675 8.86486486 L 7.80896359 8.86486486 C 8.11369101 8.86486486 8.39855198 8.84414571 8.66354709 8.80270722 C 9.30146061 8.70295376 9.82425299 8.48313329 10.2319328 8.14324324 C 10.8089665 7.66215976 11.097479 6.98919351 11.097479 6.12432432 C 11.097479 5.36035654 10.8817949 4.81531695 10.4504202 4.48918919 C 10.0190455 4.16306143 9.29916471 4 8.2907563 4 L 5.4 4 L 5.4 12 L 7.09187675 12 L 7.09187675 9.36486486 L 7.09187665 9.86486483 Z M 7.09187675 7.76756757 L 7.4280112 7.76756757 C 8.01811686 7.76756757 8.4840319 7.63513646 8.82577031 7.37027027 C 9.16750871 7.10540408 9.33837535 6.74594822 9.33837535 6.29189189 C 9.33837535 5.49549151 8.81363737 5.0972973 7.76414566 5.0972973 L 7.09187675 5.0972973 L 7.09187675 7.76756757 Z M 7.09187675 7.76756757&quot;/&gt;
+    &lt;path fill=&quot;white&quot; d=&quot;M 5.4 12 L 5.4 4 L 8.2907563 4 C 9.29916471 4 10.0190455 4.16306143 10.4504202 4.48918919 C 10.8817949 4.81531695 11.097479 5.36035654 11.097479 6.12432432 C 11.097479 6.98919351 10.8089665 7.66215976 10.2319328 8.14324324 C 9.65489908 8.62432673 8.84725076 8.86486486 7.80896359 8.86486486 L 7.09187675 8.86486486 L 7.09187675 12 L 5.4 12 Z M 7.09187675 7.76756757 L 7.4280112 7.76756757 C 8.01811686 7.76756757 8.4840319 7.63513646 8.82577031 7.37027027 C 9.16750871 7.10540408 9.33837535 6.74594822 9.33837535 6.29189189 C 9.33837535 5.49549151 8.81363737 5.0972973 7.76414566 5.0972973 L 7.09187675 5.0972973 L 7.09187675 7.76756757 Z M 7.09187675 7.76756757&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScriptTimelineRecordjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (167508 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js        2014-04-18 21:03:23 UTC (rev 167508)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js        2014-04-18 21:21:39 UTC (rev 167509)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> WebInspector.ScriptTimelineRecord.EventType = {
</span><span class="cx">     ScriptEvaluated: &quot;script-timeline-record-script-evaluated&quot;,
</span><span class="cx">     EventDispatched: &quot;script-timeline-record-event-dispatch&quot;,
</span><ins>+    ProbeSampleRecorded: &quot;script-timeline-record-probe-sample-recorded&quot;,
</ins><span class="cx">     TimerFired: &quot;script-timeline-record-timer-fired&quot;,
</span><span class="cx">     TimerInstalled: &quot;script-timeline-record-timer-installed&quot;,
</span><span class="cx">     TimerRemoved: &quot;script-timeline-record-timer-removed&quot;,
</span><span class="lines">@@ -213,6 +214,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return WebInspector.UIString(&quot;Event Dispatched&quot;);
</span><ins>+    case WebInspector.ScriptTimelineRecord.EventType.ProbeSampleRecorded:
+        return WebInspector.UIString(&quot;Probe Sample Recorded&quot;);
</ins><span class="cx">     case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
</span><span class="cx">         if (details &amp;&amp; includeTimerIdentifierInMainTitle)
</span><span class="cx">             return WebInspector.UIString(&quot;Timer %s Fired&quot;).format(details);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css (167508 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2014-04-18 21:03:23 UTC (rev 167508)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2014-04-18 21:21:39 UTC (rev 167509)
</span><span class="lines">@@ -75,6 +75,10 @@
</span><span class="cx">     content: url(../Images/TimelineRecordEvent.svg);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.probe-record .icon {
+    content: url(../Images/TimelineRecordProbeSampled.svg);
+}
+
</ins><span class="cx"> .timer-record .icon {
</span><span class="cx">     content: url(../Images/TimelineRecordTimer.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 (167508 => 167509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2014-04-18 21:03:23 UTC (rev 167508)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2014-04-18 21:21:39 UTC (rev 167509)
</span><span class="lines">@@ -77,6 +77,9 @@
</span><span class="cx">         case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:
</span><span class="cx">             iconStyleClass = WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass;
</span><span class="cx">             break;
</span><ins>+        case WebInspector.ScriptTimelineRecord.EventType.ProbeSampleRecorded:
+            iconStyleClass = WebInspector.TimelineRecordTreeElement.ProbeRecordIconStyleClass;
+            break;
</ins><span class="cx">         case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
</span><span class="cx">         case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
</span><span class="cx">         case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
</span><span class="lines">@@ -112,6 +115,7 @@
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass = &quot;event-record&quot;;
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass = &quot;timer-record&quot;;
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass = &quot;animation-record&quot;;
</span><ins>+WebInspector.TimelineRecordTreeElement.ProbeRecordIconStyleClass = &quot;probe-record&quot;;
</ins><span class="cx"> 
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.prototype = {
</span><span class="cx">     constructor: WebInspector.TimelineRecordTreeElement,
</span></span></pre>
</div>
</div>

</body>
</html>