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

Unified Diff: tracing/tracing/model/vm_region.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: rebase Created 3 years, 9 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
« no previous file with comments | « tracing/tracing/model/user_model/user_expectation.html ('k') | tracing/tracing/mre/file_handle.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/model/vm_region.html
diff --git a/tracing/tracing/model/vm_region.html b/tracing/tracing/model/vm_region.html
index 7397cf7116bee0dc54b2fca204b558141a2ff49e..dbb506addd39adc453d28a15f7e32797862b5243 100644
--- a/tracing/tracing/model/vm_region.html
+++ b/tracing/tracing/model/vm_region.html
@@ -42,8 +42,7 @@ tr.exportTo('tr.model', function() {
},
get protectionFlagsToString() {
- if (this.protectionFlags === undefined)
- return undefined;
+ if (this.protectionFlags === undefined) return undefined;
return (
(this.protectionFlags & VMRegion.PROTECTION_FLAG_READ ? 'r' : '-') +
(this.protectionFlags & VMRegion.PROTECTION_FLAG_WRITE ? 'w' : '-') +
@@ -221,8 +220,9 @@ tr.exportTo('tr.model', function() {
VMRegionClassificationNode.fromRegions = function(regions, opt_rules) {
var tree = new VMRegionClassificationNode(opt_rules);
tree.regions_ = regions;
- for (var i = 0; i < regions.length; i++)
+ for (var i = 0; i < regions.length; i++) {
tree.addStatsFromRegion_(regions[i]);
+ }
return tree;
};
@@ -232,10 +232,12 @@ tr.exportTo('tr.model', function() {
},
get children() {
- if (this.isLeafNode)
+ if (this.isLeafNode) {
return undefined; // Leaf nodes don't have children (by definition).
- if (this.children_ === undefined)
+ }
+ if (this.children_ === undefined) {
this.buildTree_(); // Lazily classify VM regions.
+ }
return this.children_;
},
@@ -288,8 +290,9 @@ tr.exportTo('tr.model', function() {
},
addRegionRecursively_: function(region, addStatsToThisNode) {
- if (addStatsToThisNode)
+ if (addStatsToThisNode) {
this.addStatsFromRegion_(region);
+ }
if (this.regions_ !== undefined) {
if (this.children_ !== undefined) {
@@ -305,8 +308,7 @@ tr.exportTo('tr.model', function() {
// Non-leaf rule (classify region row further down the tree).
function regionRowMatchesChildNide(child) {
var fileRegExp = child.rule_.file;
- if (fileRegExp === undefined)
- return true;
+ if (fileRegExp === undefined) return true;
return fileRegExp.test(region.mappedFile);
}
@@ -314,8 +316,9 @@ tr.exportTo('tr.model', function() {
this.children_, regionRowMatchesChildNide);
if (matchedChild === undefined) {
// Region belongs to the 'Other' node (created lazily).
- if (this.children_.length !== this.rule_.children.length)
+ if (this.children_.length !== this.rule_.children.length) {
throw new Error('Internal error');
+ }
matchedChild = new VMRegionClassificationNode(
VMRegionClassificationNode.OTHER_RULE);
this.children_.push(matchedChild);
@@ -347,8 +350,9 @@ tr.exportTo('tr.model', function() {
'Internal error: Classification node should have no regions');
}
- if (this.isLeafNode)
+ if (this.isLeafNode) {
return; // Leaf node: Nothing to do.
+ }
// Intermediate node: Clear regions and build children recursively.
this.regions_ = undefined;
@@ -364,16 +368,16 @@ tr.exportTo('tr.model', function() {
// Aggregate virtual size.
var regionSizeInBytes = region.sizeInBytes;
- if (regionSizeInBytes !== undefined)
+ if (regionSizeInBytes !== undefined) {
this.sizeInBytes = (this.sizeInBytes || 0) + regionSizeInBytes;
+ }
// Aggregate byte stats.
var thisByteStats = this.byteStats;
var regionByteStats = region.byteStats;
for (var byteStatName in regionByteStats) {
var regionByteStatValue = regionByteStats[byteStatName];
- if (regionByteStatValue === undefined)
- continue;
+ if (regionByteStatValue === undefined) continue;
thisByteStats[byteStatName] =
(thisByteStats[byteStatName] || 0) + regionByteStatValue;
}
« no previous file with comments | « tracing/tracing/model/user_model/user_expectation.html ('k') | tracing/tracing/mre/file_handle.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698