Web Inspector: add closure compiler annotations for profiler code
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 12:03:46 +0000 (12:03 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 12:03:46 +0000 (12:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83700

Basic type annotations are added to most of the profiler front-end. Some
dead code removed.

Reviewed by Pavel Feldman.

* inspector/compile-front-end.py:
* inspector/front-end/BinarySearch.js:
(Object.defineProperty):
* inspector/front-end/BottomUpProfileDataGridTree.js:
(WebInspector.BottomUpProfileDataGridNode.prototype._restore):
(WebInspector.BottomUpProfileDataGridNode.prototype._sharedPopulate):
(WebInspector.BottomUpProfileDataGridNode.prototype._willHaveChildren):
(WebInspector.BottomUpProfileDataGridTree):
* inspector/front-end/DataGrid.js:
* inspector/front-end/DetailedHeapshotGridNodes.js:
(WebInspector.HeapSnapshotInstanceNode.prototype._createChildNode):
(WebInspector.HeapSnapshotDiffNode.prototype.populateChildren.firstProviderPopulated):
(WebInspector.HeapSnapshotDiffNode.prototype.populateChildren.else.firstProviderPopulated):
(WebInspector.HeapSnapshotDiffNode.prototype.populateChildren):
* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.DetailedHeapshotView.prototype._changeBase):
(WebInspector.DetailedHeapshotView.prototype._setRetainmentDataGridSource):
(WebInspector.DetailedHeapshotView.prototype._helpClicked.appendHelp):
(WebInspector.DetailedHeapshotView.prototype._helpClicked):
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot):
(HeapSnapshotMetainfo):
(WebInspector.HeapSnapshot.prototype._buildRetainers):
(WebInspector.HeapSnapshot.prototype._buildDominatedNodes):
(WebInspector.HeapSnapshot.prototype._markQueriableHeapObjects):
* inspector/front-end/ProfileDataGridTree.js:
(WebInspector.ProfileDataGridNode.prototype.insertChild):
(WebInspector.ProfileDataGridNode.prototype.removeChild):
(WebInspector.ProfileDataGridNode.prototype.removeChildren):
(WebInspector.ProfileDataGridNode.prototype._populate):
(WebInspector.ProfileDataGridTree.propertyComparator):
* inspector/front-end/ProfileView.js:
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfileHeader):
(WebInspector.ProfilesPanel.prototype._finishHeapSnapshot.parsed):
(WebInspector.ProfilesPanel.prototype._finishHeapSnapshot):
(WebInspector.ProfilesPanel.prototype.performSearch.finishedCallback):
(WebInspector.ProfilesPanel.prototype.setRecordingProfile):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
(WebInspector.ProfilerDispatcher.prototype.addProfileHeader):
* inspector/front-end/TopDownProfileDataGridTree.js:
(WebInspector.TopDownProfileDataGridTree):
(WebInspector.TopDownProfileDataGridTree.prototype.exclude):
* inspector/front-end/externs.js:
(Array.prototype.binaryIndexOf):
(Array.prototype.sortRange):
(WebInspector.CSSSelectorProfileType):
(WebInspector.HeapSnapshotWorker):
(WebInspector.HeapSnapshotWorker.prototype.createObject):
(WebInspector.HeapSnapshotWorker.prototype.startCheckingForLongRunningCalls):
* inspector/front-end/heapProfiler.css:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113963 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/compile-front-end.py
Source/WebCore/inspector/front-end/BinarySearch.js
Source/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
Source/WebCore/inspector/front-end/DataGrid.js
Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js
Source/WebCore/inspector/front-end/DetailedHeapshotView.js
Source/WebCore/inspector/front-end/HeapSnapshot.js
Source/WebCore/inspector/front-end/ProfileDataGridTree.js
Source/WebCore/inspector/front-end/ProfileView.js
Source/WebCore/inspector/front-end/ProfilesPanel.js
Source/WebCore/inspector/front-end/TopDownProfileDataGridTree.js
Source/WebCore/inspector/front-end/externs.js
Source/WebCore/inspector/front-end/heapProfiler.css

index 1a57864..df3cb71 100644 (file)
@@ -1,3 +1,65 @@
+2012-04-11  Yury Semikhatsky  <yurys@chromium.org>
+
+        Web Inspector: add closure compiler annotations for profiler code
+        https://bugs.webkit.org/show_bug.cgi?id=83700
+
+        Basic type annotations are added to most of the profiler front-end. Some
+        dead code removed.
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/compile-front-end.py:
+        * inspector/front-end/BinarySearch.js:
+        (Object.defineProperty):
+        * inspector/front-end/BottomUpProfileDataGridTree.js:
+        (WebInspector.BottomUpProfileDataGridNode.prototype._restore):
+        (WebInspector.BottomUpProfileDataGridNode.prototype._sharedPopulate):
+        (WebInspector.BottomUpProfileDataGridNode.prototype._willHaveChildren):
+        (WebInspector.BottomUpProfileDataGridTree):
+        * inspector/front-end/DataGrid.js:
+        * inspector/front-end/DetailedHeapshotGridNodes.js:
+        (WebInspector.HeapSnapshotInstanceNode.prototype._createChildNode):
+        (WebInspector.HeapSnapshotDiffNode.prototype.populateChildren.firstProviderPopulated):
+        (WebInspector.HeapSnapshotDiffNode.prototype.populateChildren.else.firstProviderPopulated):
+        (WebInspector.HeapSnapshotDiffNode.prototype.populateChildren):
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.DetailedHeapshotView.prototype._changeBase):
+        (WebInspector.DetailedHeapshotView.prototype._setRetainmentDataGridSource):
+        (WebInspector.DetailedHeapshotView.prototype._helpClicked.appendHelp):
+        (WebInspector.DetailedHeapshotView.prototype._helpClicked):
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshot):
+        (HeapSnapshotMetainfo):
+        (WebInspector.HeapSnapshot.prototype._buildRetainers):
+        (WebInspector.HeapSnapshot.prototype._buildDominatedNodes):
+        (WebInspector.HeapSnapshot.prototype._markQueriableHeapObjects):
+        * inspector/front-end/ProfileDataGridTree.js:
+        (WebInspector.ProfileDataGridNode.prototype.insertChild):
+        (WebInspector.ProfileDataGridNode.prototype.removeChild):
+        (WebInspector.ProfileDataGridNode.prototype.removeChildren):
+        (WebInspector.ProfileDataGridNode.prototype._populate):
+        (WebInspector.ProfileDataGridTree.propertyComparator):
+        * inspector/front-end/ProfileView.js:
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfileHeader):
+        (WebInspector.ProfilesPanel.prototype._finishHeapSnapshot.parsed):
+        (WebInspector.ProfilesPanel.prototype._finishHeapSnapshot):
+        (WebInspector.ProfilesPanel.prototype.performSearch.finishedCallback):
+        (WebInspector.ProfilesPanel.prototype.setRecordingProfile):
+        (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
+        (WebInspector.ProfilerDispatcher.prototype.addProfileHeader):
+        * inspector/front-end/TopDownProfileDataGridTree.js:
+        (WebInspector.TopDownProfileDataGridTree):
+        (WebInspector.TopDownProfileDataGridTree.prototype.exclude):
+        * inspector/front-end/externs.js:
+        (Array.prototype.binaryIndexOf):
+        (Array.prototype.sortRange):
+        (WebInspector.CSSSelectorProfileType):
+        (WebInspector.HeapSnapshotWorker):
+        (WebInspector.HeapSnapshotWorker.prototype.createObject):
+        (WebInspector.HeapSnapshotWorker.prototype.startCheckingForLongRunningCalls):
+        * inspector/front-end/heapProfiler.css:
+
 2012-04-12  Zalan Bujtas  <zbujtas@gmail.com>
 
         [Qt][WK2] Zoom gesture with double tap crashes on iframe when main frame has scroll offset.
index f30695d..903aa82 100755 (executable)
@@ -271,6 +271,21 @@ modules = [
             "TestController.js",
         ]
     },
+    {
+        "target_name": "profiler",
+        "dependencies": ["components"],
+        "sources": [
+            "BottomUpProfileDataGridTree.js",
+            "DetailedHeapshotView.js",
+            "DetailedHeapshotGridNodes.js",
+            "ProfileDataGridTree.js",
+            "ProfilesPanel.js",
+            "ProfileLauncherView.js",
+            "ProfileView.js",
+            "TopDownProfileDataGridTree.js",
+            "HeapSnapshot.js",
+        ]
+    },
 #    {
 #        "target_name": "tokenizers",
 #        "dependencies": ["components"],
@@ -286,17 +301,9 @@ modules = [
 #
 # [Profiler]
 # CSSSelectorProfileView
-# BottomUpProfileDataGridTree
-# DetailedHeapshotGridNodes
-# DetailedHeapshotView
-# HeapSnapshot
 # HeapSnapshotProxy
 # HeapSnapshotWorker
 # HeapSnapshotWorkerDispatcher
-# ProfileDataGridTree
-# ProfilesPanel
-# ProfileView
-# TopDownProfileDataGridTree
 #
 # [Misc]
 # inspector
index e6c99c2..8d03ca4 100644 (file)
@@ -54,11 +54,17 @@ function binarySearch(object, array, comparator)
     return -(first + 1);
 }
 
-Object.defineProperty(Array.prototype, "binaryIndexOf", { value: function(value, comparator)
+Object.defineProperty(Array.prototype, "binaryIndexOf",
 {
-    var result = binarySearch(value, this, comparator);
-    return result >= 0 ? result : -1;
-}});
+    /**
+     * @this {Array.<*>}
+     */
+    value: function(value, comparator)
+    {
+        var result = binarySearch(value, this, comparator);
+        return result >= 0 ? result : -1;
+    }
+});
 
 /**
  * @param {*} anObject
index 5aaae0c..f5982ad 100644 (file)
 // each child still represent the root node. We have to be particularly careful of recursion with this mode
 // because a root node can represent itself AND an ancestor.
 
+/**
+ * @constructor
+ * @extends {WebInspector.ProfileDataGridNode}
+ */
 WebInspector.BottomUpProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*BottomUpProfileDataGridTree*/ owningTree)
 {
     WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, this._willHaveChildren(profileNode));
@@ -79,7 +83,7 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
         WebInspector.ProfileDataGridNode.prototype._restore();
 
         if (!this.children.length)
-            this.hasChildren = this._willHaveChildren();
+            this.hasChildren = this._willHaveChildren(this.profileNode);
     },
 
     _merge: function(/*ProfileDataGridNode*/ child, /*Boolean*/ shouldAbsorb)
@@ -112,7 +116,7 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
             } else {
                 // If not, add it as a true ancestor.
                 // In heavy mode, we take our visual identity from ancestor node...
-                var child = new WebInspector.BottomUpProfileDataGridNode(this.profileView, ancestor, this.tree);
+                child = new WebInspector.BottomUpProfileDataGridNode(this.profileView, ancestor, this.tree);
 
                 if (ancestor !== focusNode) {
                     // but the actual statistics from the "root" node (bottom of the callstack).
@@ -136,7 +140,6 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
 
     _willHaveChildren: function(profileNode)
     {
-        profileNode = profileNode || this.profileNode;
         // In bottom up mode, our parents are our children since we display an inverted tree.
         // However, we don't want to show the very top parent since it is redundant.
         return !!(profileNode.parent && profileNode.parent.parent);
@@ -145,6 +148,10 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
 
 WebInspector.BottomUpProfileDataGridNode.prototype.__proto__ = WebInspector.ProfileDataGridNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.ProfileDataGridTree}
+ */
 WebInspector.BottomUpProfileDataGridTree = function(/*ProfileView*/ aProfileView, /*ProfileNode*/ aProfileNode)
 {
     WebInspector.ProfileDataGridTree.call(this, aProfileView, aProfileNode);
@@ -201,7 +208,9 @@ WebInspector.BottomUpProfileDataGridTree = function(/*ProfileView*/ aProfileView
     }
 
     // Populate the top level nodes.
-    WebInspector.BottomUpProfileDataGridNode.prototype._populate.call(this);
+    var any = /** @type{*} */this;
+    var node = /** @type{WebInspector.ProfileDataGridNode} */any;
+    WebInspector.BottomUpProfileDataGridNode.prototype._populate.call(node);
 
     return this;
 }
index 24fd777..2376de4 100644 (file)
@@ -677,6 +677,9 @@ WebInspector.DataGrid.prototype = {
         this.insertChild(child, this.children.length);
     },
 
+    /**
+     * @this {WebInspector.DataGrid|WebInspector.DataGridNode}
+     */
     insertChild: function(child, index)
     {
         if (!child)
index 940de45..473d50b 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.DataGridNode}
+ */
 WebInspector.HeapSnapshotGridNode = function(tree, hasChildren)
 {
     WebInspector.DataGridNode.call(this, null, hasChildren);
@@ -203,6 +207,10 @@ WebInspector.HeapSnapshotGridNode.prototype = {
 
 WebInspector.HeapSnapshotGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotGridNode}
+ */
 WebInspector.HeapSnapshotLazyGridNode = function(tree, hasChildren)
 {
     WebInspector.HeapSnapshotGridNode.call(this, tree, hasChildren);
@@ -228,6 +236,10 @@ WebInspector.HeapSnapshotLazyGridNode.prototype = {
 
 WebInspector.HeapSnapshotLazyGridNode.prototype.__proto__ = WebInspector.HeapSnapshotGridNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotGridNode}
+ */
 WebInspector.HeapSnapshotGenericObjectNode = function(tree, node)
 {
     WebInspector.HeapSnapshotGridNode.call(this, tree, false);
@@ -285,11 +297,6 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
         return cell;
     },
 
-    get _countPercent()
-    {
-        return this._count / this.dataGrid.snapshot.nodeCount * 100.0;
-    },
-
     get data()
     {
         var data = this._emptyData();
@@ -397,6 +404,10 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
 
 WebInspector.HeapSnapshotGenericObjectNode.prototype.__proto__ = WebInspector.HeapSnapshotGridNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotGenericObjectNode}
+ */
 WebInspector.HeapSnapshotObjectNode = function(tree, isFromBaseSnapshot, edge, parentGridNode)
 {
     WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, edge.node);
@@ -517,6 +528,10 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
 
 WebInspector.HeapSnapshotObjectNode.prototype.__proto__ = WebInspector.HeapSnapshotGenericObjectNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotGenericObjectNode}
+ */
 WebInspector.HeapSnapshotInstanceNode = function(tree, baseSnapshot, snapshot, node)
 {
     WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, node);
@@ -528,7 +543,7 @@ WebInspector.HeapSnapshotInstanceNode = function(tree, baseSnapshot, snapshot, n
 WebInspector.HeapSnapshotInstanceNode.prototype = {
     _createChildNode: function(item)
     {
-        return new WebInspector.HeapSnapshotObjectNode(this.dataGrid, this._isDeletedNode, item);
+        return new WebInspector.HeapSnapshotObjectNode(this.dataGrid, this._isDeletedNode, item, null);
     },
 
     _createProvider: function(snapshot, nodeIndex)
@@ -597,6 +612,10 @@ WebInspector.HeapSnapshotInstanceNode.prototype = {
 
 WebInspector.HeapSnapshotInstanceNode.prototype.__proto__ = WebInspector.HeapSnapshotGenericObjectNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotLazyGridNode}
+ */
 WebInspector.HeapSnapshotConstructorNode = function(tree, className, aggregate, aggregatesKey)
 {
     WebInspector.HeapSnapshotLazyGridNode.call(this, tree, aggregate.count > 0);
@@ -683,6 +702,9 @@ WebInspector.HeapSnapshotConstructorNode.prototype = {
 
 WebInspector.HeapSnapshotConstructorNode.prototype.__proto__ = WebInspector.HeapSnapshotLazyGridNode.prototype;
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotIteratorsTuple = function(it1, it2)
 {
     this._it1 = it1;
@@ -706,6 +728,10 @@ WebInspector.HeapSnapshotIteratorsTuple.prototype = {
     }
 };
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotLazyGridNode}
+ */
 WebInspector.HeapSnapshotDiffNode = function(tree, className, baseAggregate, aggregate)
 {
     WebInspector.HeapSnapshotLazyGridNode.call(this, tree, true);
@@ -811,17 +837,17 @@ WebInspector.HeapSnapshotDiffNode.prototype = {
         if (!provider && !howMany) {
             var firstProviderPopulated = function()
             {
-                WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it2, this._defaultPopulateCount, atIndex, afterPopulate);
+                WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it2, this._defaultPopulateCount, atIndex, afterPopulate, false);
             };
             WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it1, this._defaultPopulateCount, atIndex, firstProviderPopulated.bind(this), true);
         } else if (!howMany) {
             var firstProviderPopulated = function()
             {
-                WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it2, null, atIndex, afterPopulate);
+                WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it2, null, atIndex, afterPopulate, false);
             };
             WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, this._provider._it1, null, atIndex, firstProviderPopulated.bind(this), true);
         } else
-            WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, provider, howMany, atIndex, afterPopulate);
+            WebInspector.HeapSnapshotGridNode.prototype.populateChildren.call(this, provider, howMany, atIndex, afterPopulate, false);
     },
 
     _signForDelta: function(delta)
@@ -851,6 +877,10 @@ WebInspector.HeapSnapshotDiffNode.prototype = {
 
 WebInspector.HeapSnapshotDiffNode.prototype.__proto__ = WebInspector.HeapSnapshotLazyGridNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotGenericObjectNode}
+ */
 WebInspector.HeapSnapshotDominatorObjectNode = function(tree, node)
 {
     WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, node);
index ad4bde0..1763626 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.DataGrid}
+ * @param {boolean=} deferNodeContentCreation
+ */
 WebInspector.HeapSnapshotSortableDataGrid = function(columns, deferNodeContentCreation)
 {
     WebInspector.DataGrid.call(this, columns);
@@ -160,6 +165,11 @@ WebInspector.HeapSnapshotSortableDataGrid.prototype = {
 
 WebInspector.HeapSnapshotSortableDataGrid.prototype.__proto__ = WebInspector.DataGrid.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotSortableDataGrid}
+ * @param {Object=} columns
+ */
 WebInspector.HeapSnapshotContainmentDataGrid = function(columns)
 {
     columns = columns || {
@@ -228,6 +238,10 @@ WebInspector.HeapSnapshotContainmentDataGrid.prototype = {
 MixInSnapshotNodeFunctions(WebInspector.HeapSnapshotObjectNode.prototype, WebInspector.HeapSnapshotContainmentDataGrid.prototype);
 WebInspector.HeapSnapshotContainmentDataGrid.prototype.__proto__ = WebInspector.HeapSnapshotSortableDataGrid.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotContainmentDataGrid}
+ */
 WebInspector.HeapSnapshotRetainmentDataGrid = function()
 {
     this.showRetainingEdges = true;
@@ -261,6 +275,10 @@ WebInspector.HeapSnapshotRetainmentDataGrid.prototype = {
 
 WebInspector.HeapSnapshotRetainmentDataGrid.prototype.__proto__ = WebInspector.HeapSnapshotContainmentDataGrid.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotSortableDataGrid}
+ */
 WebInspector.HeapSnapshotConstructorsDataGrid = function()
 {
     var columns = {
@@ -334,6 +352,10 @@ WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
 
 WebInspector.HeapSnapshotConstructorsDataGrid.prototype.__proto__ = WebInspector.HeapSnapshotSortableDataGrid.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotSortableDataGrid}
+ */
 WebInspector.HeapSnapshotDiffDataGrid = function()
 {
     var columns = {
@@ -423,6 +445,10 @@ WebInspector.HeapSnapshotDiffDataGrid.prototype = {
 
 WebInspector.HeapSnapshotDiffDataGrid.prototype.__proto__ = WebInspector.HeapSnapshotSortableDataGrid.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotSortableDataGrid}
+ */
 WebInspector.HeapSnapshotDominatorsDataGrid = function()
 {
     var columns = {
@@ -454,6 +480,10 @@ WebInspector.HeapSnapshotDominatorsDataGrid.prototype = {
 MixInSnapshotNodeFunctions(WebInspector.HeapSnapshotDominatorObjectNode.prototype, WebInspector.HeapSnapshotDominatorsDataGrid.prototype);
 WebInspector.HeapSnapshotDominatorsDataGrid.prototype.__proto__ = WebInspector.HeapSnapshotSortableDataGrid.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ */
 WebInspector.DetailedHeapshotView = function(parent, profile)
 {
     WebInspector.View.call(this);
@@ -516,7 +546,6 @@ WebInspector.DetailedHeapshotView = function(parent, profile)
     this.retainmentView.element.addStyleClass("view");
     this.retainmentView.element.addStyleClass("retaining-paths-view");
     this.retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid();
-    this.retainmentDataGrid.element.addEventListener("click", this._mouseClickInRetainmentGrid.bind(this), true);
     this.retainmentDataGrid.show(this.retainmentView.element);
     this.retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._inspectedObjectChanged, this);
     this.retainmentView.show(this.element);
@@ -554,7 +583,7 @@ WebInspector.DetailedHeapshotView = function(parent, profile)
     this._updateFilterOptions();
 
     this.helpButton = new WebInspector.StatusBarButton("", "heapshot-help-status-bar-item status-bar-item");
-    this.helpButton.addEventListener("click", this._helpClicked.bind(this), false);
+    this.helpButton.addEventListener("click", this._helpClicked, this);
 
     this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.element, this._getHoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), undefined, true);
 
@@ -792,7 +821,8 @@ WebInspector.DetailedHeapshotView.prototype = {
             return;
 
         this._baseProfileUid = this._profiles()[this.baseSelectElement.selectedIndex].uid;
-        this.dataGrid._baseProfileIndexChanged(this._loadProfileByIndex.bind(this), this.baseSelectElement.selectedIndex);
+        var dataGrid = /** @type {WebInspector.HeapSnapshotDiffDataGrid} */ this.dataGrid;
+        dataGrid._baseProfileIndexChanged(this._loadProfileByIndex.bind(this), this.baseSelectElement.selectedIndex);
 
         if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
             return;
@@ -893,7 +923,7 @@ WebInspector.DetailedHeapshotView.prototype = {
     _setRetainmentDataGridSource: function(nodeItem)
     {
         if (nodeItem && nodeItem.snapshotNodeIndex)
-            this.retainmentDataGrid.setDataSource(this, nodeItem.isDeletedNode ? nodeItem.dataGrid.baseSnapshot : nodeItem.dataGrid.snapshot, nodeItem.snapshotNodeIndex, nodeItem.isDeletedNode ? this.baseSelectElement.childNodes[this.baseSelectElement.selectedIndex].label + " | " : "");
+            this.retainmentDataGrid.setDataSource(this, nodeItem.isDeletedNode ? nodeItem.dataGrid.baseSnapshot : nodeItem.dataGrid.snapshot, nodeItem.snapshotNodeIndex);
         else
             this.retainmentDataGrid.reset();
     },
@@ -910,22 +940,6 @@ WebInspector.DetailedHeapshotView.prototype = {
         event.consume(true);
     },
 
-    _mouseClickInRetainmentGrid: function(event)
-    {
-        var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
-        if (!cell || (!cell.hasStyleClass("path-column")))
-            return;
-        var row = event.target.enclosingNodeOrSelfWithNodeName("tr");
-        var nodeItem = row._dataGridNode;
-        if (!nodeItem || !nodeItem.route)
-            return;
-        function expandRoute()
-        {
-            this.dataGrid.expandRoute(nodeItem.route);
-        }
-        this.changeView("Containment", expandRoute.bind(this));
-    },
-
     changeView: function(viewTitle, callback)
     {
         var viewIndex = null;
@@ -1037,6 +1051,21 @@ WebInspector.DetailedHeapshotView.prototype = {
             objsHeader.textContent = WebInspector.UIString("Object types:");
             headerRow.appendChild(objsHeader);
             contentElement.appendChild(headerRow);
+
+            function appendHelp(help, index, cell)
+            {
+                var div = document.createElement("div");
+                div.className = "source-code event-properties";
+                var name = document.createElement("span");
+                name.textContent = help[index];
+                name.className = help[index + 1];
+                div.appendChild(name);
+                var desc = document.createElement("span");
+                desc.textContent = " " + help[index + 2];
+                div.appendChild(desc);
+                cell.appendChild(div);
+            }
+
             var len = Math.max(refTypes.length, objTypes.length);
             for (var i = 0; i < len; i += 3) {
                 var row = document.createElement("tr");
@@ -1052,20 +1081,6 @@ WebInspector.DetailedHeapshotView.prototype = {
             }
             this._helpPopoverContentElement = contentElement;
             this.helpPopover = new WebInspector.Popover();
-
-            function appendHelp(help, index, cell)
-            {
-                var div = document.createElement("div");
-                div.className = "source-code event-properties";
-                var name = document.createElement("span");
-                name.textContent = help[index];
-                name.className = help[index + 1];
-                div.appendChild(name);
-                var desc = document.createElement("span");
-                desc.textContent = " " + help[index + 2];
-                div.appendChild(desc);
-                cell.appendChild(div);
-            }
         }
         if (this.helpPopover.visible)
             this.helpPopover.hide();
@@ -1156,6 +1171,10 @@ WebInspector.DetailedHeapshotView.prototype.__proto__ = WebInspector.View.protot
 
 WebInspector.settings.showHeapSnapshotObjectsHiddenProperties = WebInspector.settings.createSetting("showHeaSnapshotObjectsHiddenProperties", false);
 
+/**
+ * @constructor
+ * @extends {WebInspector.ProfileType}
+ */
 WebInspector.DetailedHeapshotProfileType = function()
 {
     WebInspector.ProfileType.call(this, WebInspector.DetailedHeapshotProfileType.TypeId, WebInspector.UIString("Take Heap Snapshot"));
index 490261e..11036a1 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @param {number=} size
+ */
 WebInspector.Uint32Array = function(size)
 {
     const preallocateSize = 1000;
@@ -53,6 +57,9 @@ WebInspector.Uint32Array.prototype = {
     }
 }
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotLoader = function()
 {
     this._json = "";
@@ -241,6 +248,9 @@ WebInspector.HeapSnapshotLoader.prototype = {
     }
 };
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotArraySlice = function(array, start, end)
 {
     this._array = array;
@@ -262,6 +272,10 @@ WebInspector.HeapSnapshotArraySlice.prototype = {
     }
 }
 
+/**
+ * @constructor
+ * @param {number=} edgeIndex
+ */
 WebInspector.HeapSnapshotEdge = function(snapshot, edges, edgeIndex)
 {
     this._snapshot = snapshot;
@@ -383,6 +397,9 @@ WebInspector.HeapSnapshotEdge.prototype = {
     }
 };
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotEdgeIterator = function(edge)
 {
     this.edge = edge;
@@ -420,6 +437,9 @@ WebInspector.HeapSnapshotEdgeIterator.prototype = {
     }
 };
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotRetainerEdge = function(snapshot, retainedNodeIndex, retainerIndex)
 {
     this._snapshot = snapshot;
@@ -537,6 +557,9 @@ WebInspector.HeapSnapshotRetainerEdge.prototype = {
     }
 }
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotRetainerEdgeIterator = function(retainer)
 {
     this.retainer = retainer;
@@ -574,6 +597,10 @@ WebInspector.HeapSnapshotRetainerEdgeIterator.prototype = {
     }
 };
 
+/**
+ * @constructor
+ * @param {number=} nodeIndex
+ */
 WebInspector.HeapSnapshotNode = function(snapshot, nodeIndex)
 {
     this._snapshot = snapshot;
@@ -746,6 +773,9 @@ WebInspector.HeapSnapshotNode.prototype = {
     }
 };
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotNodeIterator = function(node)
 {
     this.node = node;
@@ -783,18 +813,38 @@ WebInspector.HeapSnapshotNodeIterator.prototype = {
     }
 }
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshot = function(profile)
 {
     this.uid = profile.snapshot.uid;
     this._nodes = profile.nodes;
     this._onlyNodes = profile.onlyNodes;
     this._containmentEdges = profile.containmentEdges;
+    /** @type{HeapSnapshotMetainfo} */
     this._metaNode = profile.metaNode;
     this._strings = profile.strings;
 
     this._init();
 }
 
+/**
+ * @constructor
+ */
+function HeapSnapshotMetainfo()
+{
+    // New format.
+    this.node_fields = [];
+    this.node_types = [];
+    this.edge_fields = [];
+    this.edge_types = [];
+
+    // Old format.
+    this.fields = [];
+    this.types = [];
+}
+
 WebInspector.HeapSnapshot.prototype = {
     _init: function()
     {
@@ -1003,9 +1053,9 @@ WebInspector.HeapSnapshot.prototype = {
         while (srcNodeIndex < onlyNodesLength) {
             var firstEdgeIndex = nextNodeFirstEdgeIndex;
             var nextNodeIndex = srcNodeIndex + nodeFieldCount;
-            var nextNodeFirstEdgeIndex = nextNodeIndex < onlyNodesLength
-                                       ? onlyNodes[nextNodeIndex + firstEdgeIndexOffset]
-                                       : containmentEdges.length;
+            nextNodeFirstEdgeIndex = nextNodeIndex < onlyNodesLength
+                                   ? onlyNodes[nextNodeIndex + firstEdgeIndexOffset]
+                                   : containmentEdges.length;
             for (var edgeIndex = firstEdgeIndex; edgeIndex < nextNodeFirstEdgeIndex; edgeIndex += edgeFieldsCount) {
                 var toNodeIndex = containmentEdges[edgeIndex + edgeToNodeOffset];
                 if (toNodeIndex % nodeFieldCount)
@@ -1087,6 +1137,9 @@ WebInspector.HeapSnapshot.prototype = {
         return this._flags[node.nodeIndex];
     },
 
+    /**
+     * @param {String=} filterString
+     */
     aggregates: function(sortedIndexes, key, filterString)
     {
         if (!this._aggregates) {
@@ -1312,7 +1365,7 @@ WebInspector.HeapSnapshot.prototype = {
         // Put in the first slot of each dominatedNodes slice the count of entries
         // that will be filled.
         var firstDominatedNodeIndex = 0;
-        for (i = 0; i < this.nodeCount; ++i) {
+        for (var i = 0; i < this.nodeCount; ++i) {
             var dominatedCount = dominatedNodes[firstDominatedNodeIndex] = indexArray[i];
             indexArray[i] = firstDominatedNodeIndex;
             firstDominatedNodeIndex += dominatedCount;
@@ -1400,7 +1453,7 @@ WebInspector.HeapSnapshot.prototype = {
                 list.push(iter.edge.node.nodeIndex);
         }
 
-        var edge = new WebInspector.HeapSnapshotEdge(this);
+        var edge = new WebInspector.HeapSnapshotEdge(this, undefined);
         var node = new WebInspector.HeapSnapshotNode(this);
         while (list.length) {
             var nodeIndex = list.pop();
@@ -1412,7 +1465,7 @@ WebInspector.HeapSnapshot.prototype = {
             edge._edges = node.rawEdges;
             for (var j = 0; j < edgesCount; ++j) {
                 edge.edgeIndex = j * this._edgeFieldsCount;
-                var nodeIndex = edge.nodeIndex;
+                nodeIndex = edge.nodeIndex;
                 if (this._flags[nodeIndex] & flag)
                     continue;
                 if (edge.isHidden || edge.isInvisible)
@@ -1495,6 +1548,10 @@ WebInspector.HeapSnapshot.prototype = {
     }
 };
 
+/**
+ * @constructor
+ * @param {Array.<number>=} unfilteredIterationOrder
+ */
 WebInspector.HeapSnapshotFilteredOrderedIterator = function(iterator, filter, unfilteredIterationOrder)
 {
     this._filter = filter;
@@ -1621,6 +1678,10 @@ WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.createComparator = fu
     return {fieldName1:fieldNames[0], ascending1:fieldNames[1], fieldName2:fieldNames[2], ascending2:fieldNames[3]};
 }
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotFilteredOrderedIterator}
+ */
 WebInspector.HeapSnapshotEdgesProvider = function(snapshot, nodeIndex, filter, edgesIter)
 {
     this.snapshot = snapshot;
@@ -1711,6 +1772,11 @@ WebInspector.HeapSnapshotEdgesProvider.prototype = {
 
 WebInspector.HeapSnapshotEdgesProvider.prototype.__proto__ = WebInspector.HeapSnapshotFilteredOrderedIterator.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.HeapSnapshotFilteredOrderedIterator}
+ * @param {Array.<number>=} nodeIndexes
+ */
 WebInspector.HeapSnapshotNodesProvider = function(snapshot, filter, nodeIndexes)
 {
     this.snapshot = snapshot;
@@ -1765,6 +1831,9 @@ WebInspector.HeapSnapshotNodesProvider.prototype = {
 
 WebInspector.HeapSnapshotNodesProvider.prototype.__proto__ = WebInspector.HeapSnapshotFilteredOrderedIterator.prototype;
 
+/**
+ * @constructor
+ */
 WebInspector.HeapSnapshotsDiff = function(snapshot, className)
 {
     this._snapshot = snapshot;
index 7490b4b..3e8a59c 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.DataGridNode}
+ */
 WebInspector.ProfileDataGridNode = function(profileView, profileNode, owningTree, hasChildren)
 {
     this.profileView = profileView;
@@ -156,21 +160,27 @@ WebInspector.ProfileDataGridNode.prototype = {
 
     insertChild: function(/*ProfileDataGridNode*/ profileDataGridNode, index)
     {
-        WebInspector.DataGridNode.prototype.insertChild.call(this, profileDataGridNode, index);
+        var any = /** @type {*} */this;
+        var dataGrid = /** @type {WebInspector.DataGrid} */any;
+        WebInspector.DataGridNode.prototype.insertChild.call(dataGrid, profileDataGridNode, index);
 
         this.childrenByCallUID[profileDataGridNode.callUID] = profileDataGridNode;
     },
 
     removeChild: function(/*ProfileDataGridNode*/ profileDataGridNode)
     {
-        WebInspector.DataGridNode.prototype.removeChild.call(this, profileDataGridNode);
+        var any = /** @type {*} */this;
+        var dataGrid = /** @type {WebInspector.DataGrid} */any;
+        WebInspector.DataGridNode.prototype.removeChild.call(dataGrid, profileDataGridNode);
 
         delete this.childrenByCallUID[profileDataGridNode.callUID];
     },
 
     removeChildren: function(/*ProfileDataGridNode*/ profileDataGridNode)
     {
-        WebInspector.DataGridNode.prototype.removeChildren.call(this);
+        var any = /** @type {*} */this;
+        var dataGrid = /** @type {WebInspector.DataGrid} */any;
+        WebInspector.DataGridNode.prototype.removeChildren.call(dataGrid);
 
         this.childrenByCallUID = {};
     },
@@ -207,7 +217,7 @@ WebInspector.ProfileDataGridNode.prototype = {
         return this.parent !== this.dataGrid ? this.parent : this.tree;
     },
 
-    _populate: function(event)
+    _populate: function()
     {
         this._sharedPopulate();
 
@@ -295,6 +305,9 @@ WebInspector.ProfileDataGridNode.prototype = {
 
 WebInspector.ProfileDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
 
+/**
+ * @constructor
+ */
 WebInspector.ProfileDataGridTree = function(profileView, profileNode)
 {
     this.tree = this;
@@ -365,7 +378,7 @@ WebInspector.ProfileDataGridTree.propertyComparators = [{}, {}];
 
 WebInspector.ProfileDataGridTree.propertyComparator = function(/*String*/ property, /*Boolean*/ isAscending)
 {
-    var comparator = this.propertyComparators[(isAscending ? 1 : 0)][property];
+    var comparator = WebInspector.ProfileDataGridTree.propertyComparators[(isAscending ? 1 : 0)][property];
 
     if (!comparator) {
         if (isAscending) {
@@ -392,7 +405,7 @@ WebInspector.ProfileDataGridTree.propertyComparator = function(/*String*/ proper
             }
         }
 
-        this.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;
+        WebInspector.ProfileDataGridTree.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;
     }
 
     return comparator;
index 2ee4bb2..f474011 100644 (file)
 
 // FIXME: Rename the file.
 
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ */
 WebInspector.CPUProfileView = function(profile)
 {
     WebInspector.View.call(this);
@@ -48,7 +52,7 @@ WebInspector.CPUProfileView = function(profile)
     }
 
     this.dataGrid = new WebInspector.DataGrid(columns);
-    this.dataGrid.addEventListener("sorting changed", this._sortData, this);
+    this.dataGrid.addEventListener("sorting changed", this._sortProfile, this);
     this.dataGrid.element.addEventListener("mousedown", this._mouseDownInDataGrid.bind(this), true);
     this.dataGrid.show(this.element);
 
@@ -65,19 +69,19 @@ WebInspector.CPUProfileView = function(profile)
     this.viewSelectElement.selectedIndex = this._viewType.get() === WebInspector.CPUProfileView._TypeHeavy ? 0 : 1;
 
     this.percentButton = new WebInspector.StatusBarButton("", "percent-time-status-bar-item");
-    this.percentButton.addEventListener("click", this._percentClicked.bind(this), false);
+    this.percentButton.addEventListener("click", this._percentClicked, this);
 
     this.focusButton = new WebInspector.StatusBarButton(WebInspector.UIString("Focus selected function."), "focus-profile-node-status-bar-item");
     this.focusButton.disabled = true;
-    this.focusButton.addEventListener("click", this._focusClicked.bind(this), false);
+    this.focusButton.addEventListener("click", this._focusClicked, this);
 
     this.excludeButton = new WebInspector.StatusBarButton(WebInspector.UIString("Exclude selected function."), "exclude-profile-node-status-bar-item");
     this.excludeButton.disabled = true;
-    this.excludeButton.addEventListener("click", this._excludeClicked.bind(this), false);
+    this.excludeButton.addEventListener("click", this._excludeClicked, this);
 
     this.resetButton = new WebInspector.StatusBarButton(WebInspector.UIString("Restore all functions."), "reset-profile-status-bar-item");
     this.resetButton.visible = false;
-    this.resetButton.addEventListener("click", this._resetClicked.bind(this), false);
+    this.resetButton.addEventListener("click", this._resetClicked, this);
 
     this.profile = profile;
 
@@ -149,26 +153,6 @@ WebInspector.CPUProfileView.prototype = {
         this.refresh();
     },
 
-    get topDownTree()
-    {
-        if (!this._topDownTree) {
-            this._topDownTree = WebInspector.TopDownTreeFactory.create(this.profile.head);
-            this._sortProfile(this._topDownTree);
-        }
-
-        return this._topDownTree;
-    },
-
-    get bottomUpTree()
-    {
-        if (!this._bottomUpTree) {
-            this._bottomUpTree = WebInspector.BottomUpTreeFactory.create(this.profile.head);
-            this._sortProfile(this._bottomUpTree);
-        }
-
-        return this._bottomUpTree;
-    },
-
     willHide: function()
     {
         this._currentSearchResultIndex = -1;
@@ -500,11 +484,6 @@ WebInspector.CPUProfileView.prototype = {
         this.excludeButton.disabled = true;
     },
 
-    _sortData: function(event)
-    {
-        this._sortProfile(this.profile);
-    },
-
     _sortProfile: function()
     {
         var sortAscending = this.dataGrid.sortOrder === "ascending";
@@ -566,6 +545,10 @@ WebInspector.CPUProfileView.prototype = {
 
 WebInspector.CPUProfileView.prototype.__proto__ = WebInspector.View.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.ProfileType}
+ */
 WebInspector.CPUProfileType = function()
 {
     WebInspector.ProfileType.call(this, WebInspector.CPUProfileType.TypeId, WebInspector.UIString("Collect JavaScript CPU Profile"));
index 6d139b7..35a2d62 100644 (file)
@@ -25,6 +25,9 @@
 
 const UserInitiatedProfileName = "org.webkit.profiles.user-initiated";
 
+/**
+ * @constructor
+ */
 WebInspector.ProfileType = function(id, name)
 {
     this._id = id;
@@ -95,6 +98,27 @@ WebInspector.registerLinkifierPlugin(function(title)
     return title;
 });
 
+/**
+ * @constructor
+ * @param {string} profileType
+ * @param {string} title
+ * @param {number} uid
+ * @param {boolean} isTemporary
+ */
+WebInspector.ProfileHeader = function(profileType, title, uid, isTemporary)
+{
+    this.typeId = profileType,
+    this.title = title;
+    this.uid = uid;
+    this.isTemporary = isTemporary;
+
+    this.maxJSObjectId = 0;
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.Panel}
+ */
 WebInspector.ProfilesPanel = function()
 {
     WebInspector.Panel.call(this, "profiles");
@@ -120,7 +144,7 @@ WebInspector.ProfilesPanel = function()
     this.splitView.mainElement.appendChild(this.profileViews);
 
     this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
-    this.enableToggleButton.addEventListener("click", this._toggleProfiling.bind(this), false);
+    this.enableToggleButton.addEventListener("click", this._toggleProfiling, this);
     if (!Capabilities.profilerCausesRecompilation)
         this.enableToggleButton.element.addStyleClass("hidden");
 
@@ -128,7 +152,7 @@ WebInspector.ProfilesPanel = function()
     this.recordButton.addEventListener("click", this.toggleRecordButton, this);
 
     this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear all profiles."), "clear-status-bar-item");
-    this.clearResultsButton.addEventListener("click", this._clearProfiles.bind(this), false);
+    this.clearResultsButton.addEventListener("click", this._clearProfiles, this);
 
     this.profileViewStatusBarItemsContainer = document.createElement("div");
     this.profileViewStatusBarItemsContainer.className = "status-bar-items";
@@ -281,6 +305,10 @@ WebInspector.ProfilesPanel.prototype = {
         return escape(text) + '/' + escape(profileTypeId);
     },
 
+
+    /**
+     * @param {WebInspector.ProfileHeader} profile
+     */
     addProfileHeader: function(profile)
     {
         if (this.hasTemporaryProfile(profile.typeId))
@@ -488,7 +516,8 @@ WebInspector.ProfilesPanel.prototype = {
             profile.proxy = snapshotProxy;
             profile.sidebarElement.subtitle = Number.bytesToString(snapshotProxy.totalSize);
             profile.sidebarElement.wait = false;
-            snapshotProxy.worker.startCheckingForLongRunningCalls();
+            var worker = /** @type {WebInspector.HeapSnapshotWorker} */ snapshotProxy.worker;
+            worker.startCheckingForLongRunningCalls();
         }
         if (proxy.finishLoading(parsed))
             profile.sidebarElement.subtitle = WebInspector.UIString("Parsing\u2026");
@@ -548,9 +577,7 @@ WebInspector.ProfilesPanel.prototype = {
         if (!searchableViews || !searchableViews.length)
             return;
 
-        var parentElement = this.viewsContainerElement;
         var visibleView = this.visibleView;
-        var sortFuction = this.searchResultsSortFunction;
 
         var matchesCountUpdateTimeout = null;
 
@@ -576,9 +603,6 @@ WebInspector.ProfilesPanel.prototype = {
             this._totalSearchMatches += searchMatches;
             this._searchResults.push(view);
 
-            if (sortFuction)
-                this._searchResults.sort(sortFuction);
-
             if (this.searchMatchFound)
                 this.searchMatchFound(view, searchMatches);
 
@@ -822,14 +846,8 @@ WebInspector.ProfilesPanel.prototype = {
     {
         this.getProfileType(profileType).setRecordingProfile(isProfiling);
         if (this.hasTemporaryProfile(profileType) !== isProfiling) {
-            if (!this._temporaryRecordingProfile) {
-                this._temporaryRecordingProfile = {
-                    typeId: profileType,
-                    title: WebInspector.UIString("Recording\u2026"),
-                    uid: -1,
-                    isTemporary: true
-                };
-            }
+            if (!this._temporaryRecordingProfile)
+                this._temporaryRecordingProfile = new WebInspector.ProfileHeader(profileType, WebInspector.UIString("Recording\u2026"), -1, true);
             if (isProfiling) {
                 this.addProfileHeader(this._temporaryRecordingProfile);
                 if (profileType === WebInspector.CPUProfileType.TypeId)
@@ -843,12 +861,11 @@ WebInspector.ProfilesPanel.prototype = {
     {
         if (!this.hasTemporaryProfile(WebInspector.DetailedHeapshotProfileType.TypeId)) {
             if (!this._temporaryRecordingProfile) {
-                this._temporaryRecordingProfile = {
-                    typeId: WebInspector.DetailedHeapshotProfileType.TypeId,
-                    title: WebInspector.UIString("Snapshotting\u2026"),
-                    uid: -1,
-                    isTemporary: true
-                };
+                this._temporaryRecordingProfile = new WebInspector.ProfileHeader(
+                    WebInspector.DetailedHeapshotProfileType.TypeId,
+                    WebInspector.UIString("Snapshotting\u2026"),
+                    -1,
+                    true);
             }
             this.addProfileHeader(this._temporaryRecordingProfile);
         }
@@ -869,7 +886,10 @@ WebInspector.ProfilesPanel.prototype = {
 
 WebInspector.ProfilesPanel.prototype.__proto__ = WebInspector.Panel.prototype;
 
-
+/**
+ * @constructor
+ * @implements {ProfilerAgent.Dispatcher}
+ */
 WebInspector.ProfilerDispatcher = function(profiler)
 {
     this._profiler = profiler;
@@ -881,9 +901,12 @@ WebInspector.ProfilerDispatcher.prototype = {
         this._profiler._reset();
     },
 
+    /**
+     * @param {ProfilerAgent.ProfileHeader} profile
+     */
     addProfileHeader: function(profile)
     {
-        this._profiler.addProfileHeader(profile);
+        this._profiler.addProfileHeader(new WebInspector.ProfileHeader(profile["typeId"], profile["title"], profile["uid"], false));
     },
 
     addHeapSnapshotChunk: function(uid, chunk)
@@ -907,6 +930,10 @@ WebInspector.ProfilerDispatcher.prototype = {
     }
 }
 
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarTreeElement}
+ */
 WebInspector.ProfileSidebarTreeElement = function(profile, titleFormat, className)
 {
     this.profile = profile;
@@ -965,6 +992,12 @@ WebInspector.ProfileSidebarTreeElement.prototype = {
 
 WebInspector.ProfileSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarTreeElement}
+ * @param {string} title
+ * @param {string=} subtitle
+ */
 WebInspector.ProfileGroupSidebarTreeElement = function(title, subtitle)
 {
     WebInspector.SidebarTreeElement.call(this, "profile-group-sidebar-tree-item", title, subtitle, null, true);
index bfcc25e..41629ed 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.ProfileDataGridNode}
+ */
 WebInspector.TopDownProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*TopDownProfileDataGridTree*/ owningTree)
 {
     var hasChildren = (profileNode.children && profileNode.children.length);
@@ -66,13 +70,19 @@ WebInspector.TopDownProfileDataGridNode.prototype = {
 
 WebInspector.TopDownProfileDataGridNode.prototype.__proto__ = WebInspector.ProfileDataGridNode.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.ProfileDataGridTree}
+ */
 WebInspector.TopDownProfileDataGridTree = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode)
 {
     WebInspector.ProfileDataGridTree.call(this, profileView, profileNode);
 
     this._remainingChildren = profileNode.children;
 
-    WebInspector.TopDownProfileDataGridNode.prototype._populate.call(this);
+    var any = /** @type{*} */this;
+    var node = /** @type{WebInspector.ProfileDataGridNode} */
+    WebInspector.TopDownProfileDataGridNode.prototype._populate.call(node);
 }
 
 WebInspector.TopDownProfileDataGridTree.prototype = {
@@ -97,7 +107,9 @@ WebInspector.TopDownProfileDataGridTree.prototype = {
 
         var excludedCallUID = profileDataGrideNode.callUID;
 
-        WebInspector.TopDownProfileDataGridNode.prototype._exclude.call(this, excludedCallUID);
+        var any = /** @type{*} */this;
+        var node = /** @type{WebInspector.ProfileDataGridNode} */
+        WebInspector.TopDownProfileDataGridNode.prototype._exclude.call(node, excludedCallUID);
 
         if (this.lastComparator)
             this.sort(this.lastComparator, true);
index 45f325d..0444e8e 100644 (file)
@@ -65,6 +65,9 @@ Array.prototype.remove = function(obj, onlyFirst) {}
 Array.prototype.keySet = function() {}
 /** @return {number} */
 Array.prototype.upperBound = function(anchor) {}
+/** @return {number} */
+Array.prototype.binaryIndexOf = function(anchor) {}
+Array.prototype.sortRange = function(comparator, leftBound, rightBound, k) {}
 
 
 DOMApplicationCache.prototype.UNCACHED = 0;
@@ -203,3 +206,14 @@ WebInspector.isCompactMode = function() { return false; }
 
 WebInspector.SourceJavaScriptTokenizer = {}
 WebInspector.SourceJavaScriptTokenizer.Keywords = {}
+
+/** @constructor */
+WebInspector.CSSSelectorProfileType = function() {}
+/**
+ * @constructor
+ * @extends {WebInspector.Object}
+ */
+WebInspector.HeapSnapshotWorker = function() {}
+WebInspector.HeapSnapshotWorker.prototype.createObject = function(type) {}
+WebInspector.HeapSnapshotWorker.prototype.startCheckingForLongRunningCalls = function() {}
+
index 757ff0f..79c7399 100644 (file)
@@ -257,11 +257,6 @@ table.heapshot-help {
     border-spacing: 12px 2px;
 }
 
-div.retaining-paths-view td.path-column div:hover {
-    text-decoration: underline;
-    color: blue;
-}
-
 .cycled-ancessor-node {
     opacity: 0.6;
 }