Title: [114872] trunk
Revision
114872
Author
yu...@chromium.org
Date
2012-04-22 23:16:49 -0700 (Sun, 22 Apr 2012)

Log Message

Web Inspector: make populateChildren methods private in heap profiler front-end
https://bugs.webkit.org/show_bug.cgi?id=84562

Source/WebCore:

- populateChildren method on HeapSnapshotConstructorsDataGrid and
HeapSnapshotDiffDataGrid now is private.
- Made _defaultPopulateCount a public method on HeapSnapshotSortableDataGrid which
is overriden in some descendants
- Removed unused HeapSnapshotPathFinderProxy
- added closure compiler annotations

Reviewed by Pavel Feldman.

* inspector/front-end/HeapSnapshotDataGrids.js:
(WebInspector.HeapSnapshotSortableDataGrid.prototype.defaultPopulateCount):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
(WebInspector.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount):
(WebInspector.HeapSnapshotDiffDataGrid.prototype.setBaseDataSource):
(WebInspector.HeapSnapshotDominatorsDataGrid.prototype.defaultPopulateCount):
* inspector/front-end/HeapSnapshotGridNodes.js:
(WebInspector.HeapSnapshotGridNode):
(WebInspector.HeapSnapshotGridNode.prototype.populateChildren.callSerialize):
(WebInspector.HeapSnapshotDiffNode):
(WebInspector.HeapSnapshotDiffNode.prototype.populateChildren.firstProviderPopulated):
* inspector/front-end/HeapSnapshotProxy.js:

LayoutTests:

- Made _defaultPopulateCount a public method on HeapSnapshotSortableDataGrid which
is overriden in some descendants

Reviewed by Pavel Feldman.

* inspector/profiler/heap-snapshot-test.js:
(initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotContainmentDataGrid.prototype.defaultPopulateCount):
(initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotConstructorsDataGrid.prototype.defaultPopulateCount):
(initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount):
(initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotDominatorsDataGrid.prototype.defaultPopulateCount):
(initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (114871 => 114872)


--- trunk/LayoutTests/ChangeLog	2012-04-23 05:59:55 UTC (rev 114871)
+++ trunk/LayoutTests/ChangeLog	2012-04-23 06:16:49 UTC (rev 114872)
@@ -1,3 +1,20 @@
+2012-04-22  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: make populateChildren methods private in heap profiler front-end
+        https://bugs.webkit.org/show_bug.cgi?id=84562
+
+        - Made _defaultPopulateCount a public method on HeapSnapshotSortableDataGrid which
+        is overriden in some descendants
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/profiler/heap-snapshot-test.js:
+        (initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotContainmentDataGrid.prototype.defaultPopulateCount):
+        (initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotConstructorsDataGrid.prototype.defaultPopulateCount):
+        (initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount):
+        (initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled.WebInspector.HeapSnapshotDominatorsDataGrid.prototype.defaultPopulateCount):
+        (initialize_HeapSnapshotTest.InspectorTest.startProfilerTest.detailedHeapProfilesEnabled):
+
 2012-04-22  Pablo Flouret  <pab...@motorola.com>
 
         Reset event propagation and canceled flags in Event.initEvent

Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js (114871 => 114872)


--- trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js	2012-04-23 05:59:55 UTC (rev 114871)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js	2012-04-23 06:16:49 UTC (rev 114872)
@@ -175,10 +175,10 @@
     function detailedHeapProfilesEnabled()
     {
         // Reduce the number of populated nodes to speed up testing.
-        WebInspector.HeapSnapshotContainmentDataGrid.prototype._defaultPopulateCount = 10;
-        WebInspector.HeapSnapshotConstructorsDataGrid.prototype._defaultPopulateCount = 10;
-        WebInspector.HeapSnapshotDiffDataGrid.prototype._defaultPopulateCount = 5;
-        WebInspector.HeapSnapshotDominatorsDataGrid.prototype._defaultPopulateCount = 3;
+        WebInspector.HeapSnapshotContainmentDataGrid.prototype.defaultPopulateCount = function() { return 10; };
+        WebInspector.HeapSnapshotConstructorsDataGrid.prototype.defaultPopulateCount = function() { return 10; };
+        WebInspector.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount = function() { return 5; };
+        WebInspector.HeapSnapshotDominatorsDataGrid.prototype.defaultPopulateCount = function() { return 3; }
         InspectorTest.addResult("Detailed heap profiles were enabled.");
         InspectorTest.safeWrap(callback)();
     }

Modified: trunk/Source/WebCore/ChangeLog (114871 => 114872)


--- trunk/Source/WebCore/ChangeLog	2012-04-23 05:59:55 UTC (rev 114871)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 06:16:49 UTC (rev 114872)
@@ -1,3 +1,31 @@
+2012-04-22  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: make populateChildren methods private in heap profiler front-end
+        https://bugs.webkit.org/show_bug.cgi?id=84562
+
+        - populateChildren method on HeapSnapshotConstructorsDataGrid and
+        HeapSnapshotDiffDataGrid now is private.
+        - Made _defaultPopulateCount a public method on HeapSnapshotSortableDataGrid which
+        is overriden in some descendants
+        - Removed unused HeapSnapshotPathFinderProxy
+        - added closure compiler annotations
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/HeapSnapshotDataGrids.js:
+        (WebInspector.HeapSnapshotSortableDataGrid.prototype.defaultPopulateCount):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
+        (WebInspector.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount):
+        (WebInspector.HeapSnapshotDiffDataGrid.prototype.setBaseDataSource):
+        (WebInspector.HeapSnapshotDominatorsDataGrid.prototype.defaultPopulateCount):
+        * inspector/front-end/HeapSnapshotGridNodes.js:
+        (WebInspector.HeapSnapshotGridNode):
+        (WebInspector.HeapSnapshotGridNode.prototype.populateChildren.callSerialize):
+        (WebInspector.HeapSnapshotDiffNode):
+        (WebInspector.HeapSnapshotDiffNode.prototype.populateChildren.firstProviderPopulated):
+        * inspector/front-end/HeapSnapshotProxy.js:
+
 2012-04-22  Andreas Kling  <kl...@webkit.org>
 
         Unreviewed build fix, remove Attribute.cpp from DOMAllInOne.cpp.

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js (114871 => 114872)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js	2012-04-23 05:59:55 UTC (rev 114871)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js	2012-04-23 06:16:49 UTC (rev 114872)
@@ -39,6 +39,14 @@
 }
 
 WebInspector.HeapSnapshotSortableDataGrid.prototype = {
+    /**
+     * @return {number}
+     */
+    defaultPopulateCount: function()
+    {
+        return 100;
+    },
+
     dispose: function()
     {
         var children = this.topLevelNodes();
@@ -293,8 +301,6 @@
 }
 
 WebInspector.HeapSnapshotContainmentDataGrid.prototype = {
-    _defaultPopulateCount: 100,
-
     expandRoute: function(route)
     {
         function nextStep(parent, hopIndex)
@@ -405,8 +411,6 @@
 }
 
 WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
-    _defaultPopulateCount: 100,
-
     _sortFields: function(sortColumn, sortAscending)
     {
         return {
@@ -423,10 +427,10 @@
         this.snapshotView = snapshotView;
         this.snapshot = snapshot;
         if (this._profileIndex === -1)
-            this.populateChildren();
+            this._populateChildren();
     },
 
-    populateChildren: function()
+    _populateChildren: function()
     {
         function aggregatesReceived(key, aggregates)
         {
@@ -457,7 +461,7 @@
             this._maxNodeId = profiles[profileIndex].maxJSObjectId;
         }
 
-        this.populateChildren();
+        this._populateChildren();
     },
 
 };
@@ -483,7 +487,14 @@
 }
 
 WebInspector.HeapSnapshotDiffDataGrid.prototype = {
-    _defaultPopulateCount: 50,
+    /**
+     * @override
+     * @return {number}
+     */
+    defaultPopulateCount: function()
+    {
+        return 50;
+    },
 
     _sortFields: function(sortColumn, sortAscending)
     {
@@ -519,10 +530,10 @@
             this.dispatchEventToListeners("sorting complete");
             return;
         }
-        this.populateChildren();
+        this._populateChildren();
     },
 
-    populateChildren: function()
+    _populateChildren: function()
     {
         function baseAggregatesReceived(baseClasses)
         {
@@ -572,7 +583,14 @@
 }
 
 WebInspector.HeapSnapshotDominatorsDataGrid.prototype = {
-    _defaultPopulateCount: 25,
+    /**
+     * @override
+     * @return {number}
+     */
+    defaultPopulateCount: function()
+    {
+        return 25;
+    },
 
     setDataSource: function(snapshotView, snapshot)
     {

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js (114871 => 114872)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js	2012-04-23 05:59:55 UTC (rev 114871)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js	2012-04-23 06:16:49 UTC (rev 114872)
@@ -37,7 +37,9 @@
 WebInspector.HeapSnapshotGridNode = function(tree, hasChildren)
 {
     WebInspector.DataGridNode.call(this, null, hasChildren);
-    this._defaultPopulateCount = tree._defaultPopulateCount;
+    /**
+     * @type {WebInspector.HeapSnapshotProviderProxy}
+     */
     this._provider = null;
     this._dataGrid = tree;
     this.addEventListener("populate", this._populate, this);
@@ -109,6 +111,10 @@
         this._provider.sortAndRewind(this.comparator(), sorted.bind(this));
     },
 
+    /**
+     * @param {?number} howMany
+     * @param {?number} atIndex
+     */
     populateChildren: function(provider, howMany, atIndex, afterPopulate, suppressNotifyAboutCompletion)
     {
         if (!howMany && provider) {
@@ -118,7 +124,7 @@
         provider = provider || this._provider;
         if (!("instanceCount" in provider))
             provider.instanceCount = 0;
-        howMany = howMany || this._defaultPopulateCount;
+        howMany = howMany || this._dataGrid.defaultPopulateCount();
         atIndex = atIndex || this.children.length;
         var haveSavedChildren = !!this._savedChildren;
         if (haveSavedChildren) {
@@ -134,8 +140,8 @@
         {
             if (part >= howMany)
                 return;
-            part += this._defaultPopulateCount;
-            provider.serializeNextItems(this._defaultPopulateCount, childrenRetrieved.bind(this));
+            part += this._dataGrid.defaultPopulateCount();
+            provider.serializeNextItems(this._dataGrid.defaultPopulateCount(), childrenRetrieved.bind(this));
         }
         function childrenRetrieved(items)
         {
@@ -158,7 +164,7 @@
             }
 
             if (items.hasNext)
-                this.insertChild(new WebInspector.ShowMoreDataGridNode(this.populateChildren.bind(this, provider), this._defaultPopulateCount, length), atIndex++);
+                this.insertChild(new WebInspector.ShowMoreDataGridNode(this.populateChildren.bind(this, provider), this._dataGrid.defaultPopulateCount(), length), atIndex++);
             if (afterPopulate)
                 afterPopulate();
             if (!suppressNotifyAboutCompletion) {
@@ -682,6 +688,8 @@
 
 /**
  * @constructor
+ * @param {WebInspector.HeapSnapshotProviderProxy} it1
+ * @param {WebInspector.HeapSnapshotProviderProxy} it2
  */
 WebInspector.HeapSnapshotIteratorsTuple = function(it1, it2)
 {
@@ -716,6 +724,10 @@
     this._name = className;
     this._baseIndexes = baseAggregate ? baseAggregate.idxs : [];
     this._indexes = aggregate ? aggregate.idxs : [];
+
+    /**
+     * @type {WebInspector.HeapSnapshotIteratorsTuple}
+     */
     this._provider = this._createNodesProvider(tree.baseSnapshot, tree.snapshot, aggregate ? aggregate.type : baseAggregate.type, className);
 }
 
@@ -815,9 +827,9 @@
         if (!provider && !howMany) {
             var firstProviderPopulated = function()
             {
-                WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it2, this._defaultPopulateCount, atIndex, afterPopulate, false);
+                WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it2, this._dataGrid.defaultPopulateCount(), atIndex, afterPopulate, false);
             };
-            WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it1, this._defaultPopulateCount, atIndex, firstProviderPopulated.bind(this), true);
+            WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it1, this._dataGrid.defaultPopulateCount(), atIndex, firstProviderPopulated.bind(this), true);
         } else if (!howMany) {
             var firstProviderPopulated = function()
             {

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js (114871 => 114872)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js	2012-04-23 05:59:55 UTC (rev 114871)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js	2012-04-23 06:16:49 UTC (rev 114872)
@@ -503,29 +503,6 @@
  * @constructor
  * @extends {WebInspector.HeapSnapshotProxyObject}
  */
-WebInspector.HeapSnapshotPathFinderProxy = function(worker, objectId)
-{
-    WebInspector.HeapSnapshotProxyObject.call(this, worker, objectId);
-}
-
-WebInspector.HeapSnapshotPathFinderProxy.prototype = {
-    findNext: function(callback)
-    {
-        this.callMethod(callback, "findNext");
-    },
-
-    updateRoots: function(filter)
-    {
-        this.callMethod(null, "updateRoots", filter);
-    }
-};
-
-WebInspector.HeapSnapshotPathFinderProxy.prototype.__proto__ = WebInspector.HeapSnapshotProxyObject.prototype;
-
-/**
- * @constructor
- * @extends {WebInspector.HeapSnapshotProxyObject}
- */
 WebInspector.HeapSnapshotsDiffProxy = function(worker, objectId)
 {
     WebInspector.HeapSnapshotProxyObject.call(this, worker, objectId);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to