Title: [195566] trunk/Source/WebInspectorUI
Revision
195566
Author
[email protected]
Date
2016-01-25 16:25:42 -0800 (Mon, 25 Jan 2016)

Log Message

Web Inspector: Have top-level ScriptTimelineDataGridNode events show sample counts
https://bugs.webkit.org/show_bug.cgi?id=153447
<rdar://problem/24334137>

Reviewed by Joseph Pecoraro.

* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord):
(WebInspector.ScriptTimelineRecord.prototype.get profile):
(WebInspector.ScriptTimelineRecord.prototype.get callCount):
(WebInspector.ScriptTimelineRecord.prototype.isGarbageCollection):
(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload):
* UserInterface/Views/ScriptTimelineDataGridNode.js:
(WebInspector.ScriptTimelineDataGridNode.prototype.get data):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (195565 => 195566)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-01-26 00:16:31 UTC (rev 195565)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-01-26 00:25:42 UTC (rev 195566)
@@ -1,3 +1,20 @@
+2016-01-25  Saam barati  <[email protected]>
+
+        Web Inspector: Have top-level ScriptTimelineDataGridNode events show sample counts
+        https://bugs.webkit.org/show_bug.cgi?id=153447
+        <rdar://problem/24334137>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Models/ScriptTimelineRecord.js:
+        (WebInspector.ScriptTimelineRecord):
+        (WebInspector.ScriptTimelineRecord.prototype.get profile):
+        (WebInspector.ScriptTimelineRecord.prototype.get callCount):
+        (WebInspector.ScriptTimelineRecord.prototype.isGarbageCollection):
+        (WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload):
+        * UserInterface/Views/ScriptTimelineDataGridNode.js:
+        (WebInspector.ScriptTimelineDataGridNode.prototype.get data):
+
 2016-01-25  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Reduce unnecessary forced layouts in TimelineOverview

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (195565 => 195566)


--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js	2016-01-26 00:16:31 UTC (rev 195565)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js	2016-01-26 00:25:42 UTC (rev 195566)
@@ -38,6 +38,14 @@
         this._details = details || "";
         this._profilePayload = profilePayload || null;
         this._profile = null;
+
+        // COMPATIBILITY(iOS 9): Before the ScriptProfilerAgent we did not have sample data. Return NaN to match old behavior.
+        if (!window.ScriptProfilerAgent)
+            this._callCountOrSamples = NaN;
+        else {
+            // NOTE: _callCountOrSamples is being treated as the number of samples.
+            this._callCountOrSamples = 0;
+        }
     }
 
     // Public
@@ -58,6 +66,11 @@
         return this._profile;
     }
 
+    get callCountOrSamples()
+    {
+        return this._callCountOrSamples;
+    }
+
     isGarbageCollection()
     {
         return this._eventType === WebInspector.ScriptTimelineRecord.EventType.GarbageCollected;
@@ -159,6 +172,12 @@
             }
         }
 
+        // COMPATIBILITY (iOS 9): We only do this when we have ScriptProfilerAgent because before that we didn't have a Sampling Profiler.
+        if (window.ScriptProfilerAgent) {
+            for (let i = 0; i < rootNodes.length; i++)
+                this._callCountOrSamples += rootNodes[i].callInfo.callCount;
+        }
+
         this._profile = new WebInspector.Profile(rootNodes);
     }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js (195565 => 195566)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js	2016-01-26 00:16:31 UTC (rev 195565)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js	2016-01-26 00:25:42 UTC (rev 195566)
@@ -83,7 +83,7 @@
             selfTime: duration,
             totalTime: duration,
             averageTime: duration,
-            callCount: NaN,
+            callCount: this._record.callCountOrSamples,
             location: callFrameOrSourceCodeLocation
         };
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to