Title: [122950] trunk/Source/WebCore
Revision
122950
Author
[email protected]
Date
2012-07-18 05:38:44 -0700 (Wed, 18 Jul 2012)

Log Message

Web Inspector: create timeline detail records lazily
https://bugs.webkit.org/show_bug.cgi?id=91513

Reviewed by Pavel Feldman.

- only create timeline record details when these are used;

* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelineRecordListRow.prototype.update):
* inspector/front-end/TimelinePresentationModel.js:
(WebInspector.TimelinePresentationModel.Record.prototype.generatePopupContent):
(WebInspector.TimelinePresentationModel.Record.prototype._refreshDetails):
(WebInspector.TimelinePresentationModel.Record.prototype.details):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (122949 => 122950)


--- trunk/Source/WebCore/ChangeLog	2012-07-18 12:16:05 UTC (rev 122949)
+++ trunk/Source/WebCore/ChangeLog	2012-07-18 12:38:44 UTC (rev 122950)
@@ -1,3 +1,19 @@
+2012-07-18  Andrey Kosyakov  <[email protected]>
+
+        Web Inspector: create timeline detail records lazily
+        https://bugs.webkit.org/show_bug.cgi?id=91513
+
+        Reviewed by Pavel Feldman.
+
+        - only create timeline record details when these are used;
+
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelineRecordListRow.prototype.update):
+        * inspector/front-end/TimelinePresentationModel.js:
+        (WebInspector.TimelinePresentationModel.Record.prototype.generatePopupContent):
+        (WebInspector.TimelinePresentationModel.Record.prototype._refreshDetails):
+        (WebInspector.TimelinePresentationModel.Record.prototype.details):
+
 2012-07-18  Simon Hausmann  <[email protected]>
 
         [ANGLE] On QT, use Bison and Flex during ANGLE build

Modified: trunk/Source/WebCore/inspector/front-end/TimelinePanel.js (122949 => 122950)


--- trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-07-18 12:16:05 UTC (rev 122949)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-07-18 12:38:44 UTC (rev 122950)
@@ -1048,14 +1048,15 @@
 
         if (this._dataElement.firstChild)
             this._dataElement.removeChildren();
-        if (record.details) {
+        var details = record.details();
+        if (details) {
             var detailsContainer = document.createElement("span");
-            if (typeof record.details === "object") {
+            if (typeof details === "object") {
                 detailsContainer.appendChild(document.createTextNode("("));
-                detailsContainer.appendChild(record.details);
+                detailsContainer.appendChild(details);
                 detailsContainer.appendChild(document.createTextNode(")"));
             } else
-                detailsContainer.textContent = "(" + record.details + ")";
+                detailsContainer.textContent = "(" + details + ")";
             this._dataElement.appendChild(detailsContainer);
         }
     },

Modified: trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js (122949 => 122950)


--- trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js	2012-07-18 12:16:05 UTC (rev 122949)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js	2012-07-18 12:38:44 UTC (rev 122950)
@@ -605,8 +605,8 @@
                     contentHelper._appendTextRow(WebInspector.UIString("Interval Duration"), Number.secondsToString(this.intervalDuration, true));
                 break;
             default:
-                if (this.details)
-                    contentHelper._appendTextRow(WebInspector.UIString("Details"), this.details);
+                if (this.details())
+                    contentHelper._appendTextRow(WebInspector.UIString("Details"), this.details());
                 break;
         }
 
@@ -627,9 +627,19 @@
 
     _refreshDetails: function()
     {
-        this.details = this._getRecordDetails();
+        delete this._details;
     },
 
+    /**
+     * @return {Object?|string}
+     */
+    details: function()
+    {
+        if (!this._details)
+            this._details = this._getRecordDetails();
+        return this._details;
+    },
+
     _getRecordDetails: function()
     {
         switch (this.type) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to