Title: [172375] trunk/Source/WebInspectorUI
Revision
172375
Author
[email protected]
Date
2014-08-09 21:34:34 -0700 (Sat, 09 Aug 2014)

Log Message

Web Inspector: TimelineManager should reuse empty recordings
https://bugs.webkit.org/show_bug.cgi?id=135749

Reviewed by Timothy Hatcher.

Check whether the recording is empty before creating a new one.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype._loadNewRecording):
* UserInterface/Models/TimelineRecording.js:
(WebInspector.TimelineRecording.prototype.isEmpty):
(WebInspector.TimelineRecording.prototype.unloaded):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (172374 => 172375)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-08-10 01:04:23 UTC (rev 172374)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-08-10 04:34:34 UTC (rev 172375)
@@ -1,3 +1,18 @@
+2014-08-09  Brian J. Burg  <[email protected]>
+
+        Web Inspector: TimelineManager should reuse empty recordings
+        https://bugs.webkit.org/show_bug.cgi?id=135749
+
+        Reviewed by Timothy Hatcher.
+
+        Check whether the recording is empty before creating a new one.
+
+        * UserInterface/Controllers/TimelineManager.js:
+        (WebInspector.TimelineManager.prototype._loadNewRecording):
+        * UserInterface/Models/TimelineRecording.js:
+        (WebInspector.TimelineRecording.prototype.isEmpty):
+        (WebInspector.TimelineRecording.prototype.unloaded):
+
 2014-08-08  Brian J. Burg  <[email protected]>
 
         Web Inspector: add debugging flag to InspectorTest for unbuffered logging to stderr

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (172374 => 172375)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2014-08-10 01:04:23 UTC (rev 172374)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2014-08-10 04:34:34 UTC (rev 172375)
@@ -398,6 +398,9 @@
 
     _loadNewRecording: function()
     {
+        if (this._activeRecording && this._activeRecording.isEmpty())
+            return;
+
         var identifier = this._nextRecordingIdentifier++;
         var newRecording = new WebInspector.TimelineRecording(identifier, WebInspector.UIString("Timeline Recording %d").format(identifier));
         this._recordings.push(newRecording);

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js (172374 => 172375)


--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js	2014-08-10 01:04:23 UTC (rev 172374)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js	2014-08-10 04:34:34 UTC (rev 172375)
@@ -90,8 +90,20 @@
         return this._isWritable;
     },
 
+    isEmpty: function()
+    {
+        for (var timeline of this._timelines.values()) {
+            if (timeline.records.length)
+                return false;
+        }
+
+        return true;
+    },
+
     unloaded: function()
     {
+        console.assert(!this.isEmpty(), "Shouldn't unload an empty recording; it should be reused instead.");
+
         this._isWritable = false;
     },
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to