Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js

Issue 2144153002: [DevTools] Remove CallUID from CPUProfileNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make-profile-0-based
Patch Set: rebased tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js
index 69ac9c8fdece95668b9651e8d58562e7037c0ba8..c244cf00e0aa6ab4d973adfe5b2be4066a0d8469 100644
--- a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js
@@ -37,7 +37,8 @@ WebInspector.ProfileDataGridNode = function(profileNode, owningTree, hasChildren
WebInspector.DataGridNode.call(this, null, hasChildren);
this.tree = owningTree;
- this.childrenByCallUID = {};
+ /** @type {!Map<string, !WebInspector.ProfileDataGridNode>} */
+ this.childrenByCallUID = new Map();
this.lastComparator = null;
this.callUID = profileNode.callUID;
@@ -154,7 +155,7 @@ WebInspector.ProfileDataGridNode.prototype = {
{
WebInspector.DataGridNode.prototype.insertChild.call(this, profileDataGridNode, index);
- this.childrenByCallUID[profileDataGridNode.callUID] = /** @type {!WebInspector.ProfileDataGridNode} */ (profileDataGridNode);
+ this.childrenByCallUID.set(profileDataGridNode.callUID, /** @type {!WebInspector.ProfileDataGridNode} */ (profileDataGridNode));
},
/**
@@ -165,14 +166,14 @@ WebInspector.ProfileDataGridNode.prototype = {
{
WebInspector.DataGridNode.prototype.removeChild.call(this, profileDataGridNode);
- delete this.childrenByCallUID[/** @type {!WebInspector.ProfileDataGridNode} */ (profileDataGridNode).callUID];
+ this.childrenByCallUID.delete((/** @type {!WebInspector.ProfileDataGridNode} */ (profileDataGridNode)).callUID);
},
removeChildren: function()
{
WebInspector.DataGridNode.prototype.removeChildren.call(this);
- this.childrenByCallUID = {};
+ this.childrenByCallUID.clear();
},
/**
@@ -183,7 +184,7 @@ WebInspector.ProfileDataGridNode.prototype = {
{
if (!node)
return null;
- return this.childrenByCallUID[node.callUID];
+ return this.childrenByCallUID.get(node.callUID);
},
get selfPercent()
@@ -286,10 +287,10 @@ WebInspector.ProfileDataGridNode.merge = function(container, child, shouldAbsorb
for (var index = 0; index < count; ++index) {
var orphanedChild = children[index];
- var existingChild = container.childrenByCallUID[orphanedChild.callUID];
+ var existingChild = container.childrenByCallUID.get(orphanedChild.callUID);
if (existingChild)
- existingChild.merge(orphanedChild, false);
+ existingChild.merge(/** @type{!WebInspector.ProfileDataGridNode} */(orphanedChild), false);
else
container.appendChild(orphanedChild);
}
@@ -327,7 +328,7 @@ WebInspector.ProfileDataGridTree = function(formatter, searchableView, total)
this._searchableView = searchableView;
this.total = total;
this.lastComparator = null;
- this.childrenByCallUID = {};
+ this.childrenByCallUID = new Map();
}
WebInspector.ProfileDataGridTree.prototype = {
@@ -344,13 +345,13 @@ WebInspector.ProfileDataGridTree.prototype = {
insertChild: function(child, index)
{
this.children.splice(index, 0, child);
- this.childrenByCallUID[child.callUID] = child;
+ this.childrenByCallUID.set(child.callUID, child);
},
removeChildren: function()
{
this.children = [];
- this.childrenByCallUID = {};
+ this.childrenByCallUID.clear();
},
populateChildren: function()

Powered by Google App Engine
This is Rietveld 408576698