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

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

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: all done Created 4 years, 1 month 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/TopDownProfileDataGrid.js
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js b/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js
index 65694a1cc0fd5dbf5eda4918220077741d149047..f294431fe7a0021cc27d44d880ddb3191558bcf6 100644
--- a/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js
@@ -22,56 +22,43 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
/**
- * @constructor
- * @extends {WebInspector.ProfileDataGridNode}
- * @param {!WebInspector.ProfileNode} profileNode
- * @param {!WebInspector.TopDownProfileDataGridTree} owningTree
+ * @unrestricted
*/
-WebInspector.TopDownProfileDataGridNode = function(profileNode, owningTree)
-{
+WebInspector.TopDownProfileDataGridNode = class extends WebInspector.ProfileDataGridNode {
+ /**
+ * @param {!WebInspector.ProfileNode} profileNode
+ * @param {!WebInspector.TopDownProfileDataGridTree} owningTree
+ */
+ constructor(profileNode, owningTree) {
var hasChildren = !!(profileNode.children && profileNode.children.length);
- WebInspector.ProfileDataGridNode.call(this, profileNode, owningTree, hasChildren);
+ super(profileNode, owningTree, hasChildren);
this._remainingChildren = profileNode.children;
-};
+ }
-WebInspector.TopDownProfileDataGridNode.prototype = {
- /**
- * @override
- */
- populateChildren: function()
- {
- WebInspector.TopDownProfileDataGridNode._sharedPopulate(this);
- },
-
- __proto__: WebInspector.ProfileDataGridNode.prototype
-};
-
-/**
- * @param {!WebInspector.TopDownProfileDataGridNode|!WebInspector.TopDownProfileDataGridTree} container
- */
-WebInspector.TopDownProfileDataGridNode._sharedPopulate = function(container)
-{
+ /**
+ * @param {!WebInspector.TopDownProfileDataGridNode|!WebInspector.TopDownProfileDataGridTree} container
+ */
+ static _sharedPopulate(container) {
var children = container._remainingChildren;
var childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i)
- container.appendChild(new WebInspector.TopDownProfileDataGridNode(children[i], /** @type {!WebInspector.TopDownProfileDataGridTree} */(container.tree)));
+ container.appendChild(new WebInspector.TopDownProfileDataGridNode(
+ children[i], /** @type {!WebInspector.TopDownProfileDataGridTree} */ (container.tree)));
container._remainingChildren = null;
-};
+ }
-/**
- * @param {!WebInspector.TopDownProfileDataGridNode|!WebInspector.TopDownProfileDataGridTree} container
- * @param {string} aCallUID
- */
-WebInspector.TopDownProfileDataGridNode._excludeRecursively = function(container, aCallUID)
-{
+ /**
+ * @param {!WebInspector.TopDownProfileDataGridNode|!WebInspector.TopDownProfileDataGridTree} container
+ * @param {string} aCallUID
+ */
+ static _excludeRecursively(container, aCallUID) {
if (container._remainingChildren)
- container.populate();
+ container.populate();
container.save();
@@ -79,78 +66,84 @@ WebInspector.TopDownProfileDataGridNode._excludeRecursively = function(container
var index = container.children.length;
while (index--)
- WebInspector.TopDownProfileDataGridNode._excludeRecursively(children[index], aCallUID);
+ WebInspector.TopDownProfileDataGridNode._excludeRecursively(children[index], aCallUID);
var child = container.childrenByCallUID.get(aCallUID);
if (child)
- WebInspector.ProfileDataGridNode.merge(container, child, true);
+ WebInspector.ProfileDataGridNode.merge(container, child, true);
+ }
+
+ /**
+ * @override
+ */
+ populateChildren() {
+ WebInspector.TopDownProfileDataGridNode._sharedPopulate(this);
+ }
};
+
/**
- * @constructor
- * @extends {WebInspector.ProfileDataGridTree}
- * @param {!WebInspector.ProfileDataGridNode.Formatter} formatter
- * @param {!WebInspector.SearchableView} searchableView
- * @param {!WebInspector.ProfileNode} rootProfileNode
- * @param {number} total
+ * @unrestricted
*/
-WebInspector.TopDownProfileDataGridTree = function(formatter, searchableView, rootProfileNode, total)
-{
- WebInspector.ProfileDataGridTree.call(this, formatter, searchableView, total);
+WebInspector.TopDownProfileDataGridTree = class extends WebInspector.ProfileDataGridTree {
+ /**
+ * @param {!WebInspector.ProfileDataGridNode.Formatter} formatter
+ * @param {!WebInspector.SearchableView} searchableView
+ * @param {!WebInspector.ProfileNode} rootProfileNode
+ * @param {number} total
+ */
+ constructor(formatter, searchableView, rootProfileNode, total) {
+ super(formatter, searchableView, total);
this._remainingChildren = rootProfileNode.children;
WebInspector.ProfileDataGridNode.populate(this);
-};
-
-WebInspector.TopDownProfileDataGridTree.prototype = {
- /**
- * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode
- */
- focus: function(profileDataGridNode)
- {
- if (!profileDataGridNode)
- return;
-
- this.save();
- profileDataGridNode.savePosition();
-
- this.children = [profileDataGridNode];
- this.total = profileDataGridNode.total;
- },
-
- /**
- * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode
- */
- exclude: function(profileDataGridNode)
- {
- if (!profileDataGridNode)
- return;
-
- this.save();
-
- WebInspector.TopDownProfileDataGridNode._excludeRecursively(this, profileDataGridNode.callUID);
-
- if (this.lastComparator)
- this.sort(this.lastComparator, true);
- },
-
- restore: function()
- {
- if (!this._savedChildren)
- return;
-
- this.children[0].restorePosition();
-
- WebInspector.ProfileDataGridTree.prototype.restore.call(this);
- },
-
- /**
- * @override
- */
- populateChildren: function()
- {
- WebInspector.TopDownProfileDataGridNode._sharedPopulate(this);
- },
-
- __proto__: WebInspector.ProfileDataGridTree.prototype
+ }
+
+ /**
+ * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode
+ */
+ focus(profileDataGridNode) {
+ if (!profileDataGridNode)
+ return;
+
+ this.save();
+ profileDataGridNode.savePosition();
+
+ this.children = [profileDataGridNode];
+ this.total = profileDataGridNode.total;
+ }
+
+ /**
+ * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode
+ */
+ exclude(profileDataGridNode) {
+ if (!profileDataGridNode)
+ return;
+
+ this.save();
+
+ WebInspector.TopDownProfileDataGridNode._excludeRecursively(this, profileDataGridNode.callUID);
+
+ if (this.lastComparator)
+ this.sort(this.lastComparator, true);
+ }
+
+ /**
+ * @override
+ */
+ restore() {
+ if (!this._savedChildren)
+ return;
+
+ this.children[0].restorePosition();
+
+ super.restore();
+ }
+
+ /**
+ * @override
+ */
+ populateChildren() {
+ WebInspector.TopDownProfileDataGridNode._sharedPopulate(this);
+ }
};

Powered by Google App Engine
This is Rietveld 408576698