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

Unified Diff: tracing/tracing/model/process.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/power_series_test.html ('k') | tracing/tracing/model/process_base.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/model/process.html
diff --git a/tracing/tracing/model/process.html b/tracing/tracing/model/process.html
index c2a898091f5ba8514e2544d65d2386ab2f806ebf..490ea5cc45541c402c94473ea55b71580332cc5e 100644
--- a/tracing/tracing/model/process.html
+++ b/tracing/tracing/model/process.html
@@ -26,10 +26,12 @@ tr.exportTo('tr.model', function() {
* @constructor
*/
function Process(model, pid) {
- if (model === undefined)
+ if (model === undefined) {
throw new Error('model must be provided');
- if (pid === undefined)
+ }
+ if (pid === undefined) {
throw new Error('pid must be provided');
+ }
tr.model.ProcessBase.call(this, model);
this.pid = pid;
this.name = undefined;
@@ -46,19 +48,16 @@ tr.exportTo('tr.model', function() {
*/
Process.compare = function(x, y) {
var tmp = tr.model.ProcessBase.compare(x, y);
- if (tmp)
- return tmp;
+ if (tmp) return tmp;
tmp = tr.b.comparePossiblyUndefinedValues(
x.name, y.name,
function(x, y) { return x.localeCompare(y); });
- if (tmp)
- return tmp;
+ if (tmp) return tmp;
tmp = tr.b.compareArrays(x.labels, y.labels,
function(x, y) { return x.localeCompare(y); });
- if (tmp)
- return tmp;
+ if (tmp) return tmp;
return x.pid - y.pid;
};
@@ -83,51 +82,56 @@ tr.exportTo('tr.model', function() {
addLabelIfNeeded: function(labelName) {
for (var i = 0; i < this.labels.length; i++) {
- if (this.labels[i] === labelName)
- return;
+ if (this.labels[i] === labelName) return;
}
this.labels.push(labelName);
},
get userFriendlyName() {
var res;
- if (this.name)
+ if (this.name) {
res = this.name + ' (pid ' + this.pid + ')';
- else
+ } else {
res = 'Process ' + this.pid;
- if (this.labels.length)
+ }
+ if (this.labels.length) {
res += ': ' + this.labels.join(', ');
- if (this.uptime_seconds)
+ }
+ if (this.uptime_seconds) {
res += ', uptime:' + this.uptime_seconds + 's';
+ }
return res;
},
get userFriendlyDetails() {
- if (this.name)
+ if (this.name) {
return this.name + ' (pid ' + this.pid + ')';
+ }
return 'pid: ' + this.pid;
},
getSettingsKey: function() {
- if (!this.name)
- return undefined;
- if (!this.labels.length)
- return 'processes.' + this.name;
+ if (!this.name) return undefined;
+ if (!this.labels.length) return 'processes.' + this.name;
return 'processes.' + this.name + '.' + this.labels.join('.');
},
shiftTimestampsForward: function(amount) {
- for (var i = 0; i < this.instantEvents.length; i++)
+ for (var i = 0; i < this.instantEvents.length; i++) {
this.instantEvents[i].start += amount;
+ }
- for (var i = 0; i < this.frames.length; i++)
+ for (var i = 0; i < this.frames.length; i++) {
this.frames[i].shiftTimestampsForward(amount);
+ }
- for (var i = 0; i < this.memoryDumps.length; i++)
+ for (var i = 0; i < this.memoryDumps.length; i++) {
this.memoryDumps[i].shiftTimestampsForward(amount);
+ }
- for (var i = 0; i < this.activities.length; i++)
+ for (var i = 0; i < this.activities.length; i++) {
this.activities[i].shiftTimestampsForward(amount);
+ }
tr.model.ProcessBase.prototype
.shiftTimestampsForward.apply(this, arguments);
@@ -136,14 +140,17 @@ tr.exportTo('tr.model', function() {
updateBounds: function() {
tr.model.ProcessBase.prototype.updateBounds.apply(this);
- for (var i = 0; i < this.frames.length; i++)
+ for (var i = 0; i < this.frames.length; i++) {
this.frames[i].addBoundsToRange(this.bounds);
+ }
- for (var i = 0; i < this.memoryDumps.length; i++)
+ for (var i = 0; i < this.memoryDumps.length; i++) {
this.memoryDumps[i].addBoundsToRange(this.bounds);
+ }
- for (var i = 0; i < this.activities.length; i++)
+ for (var i = 0; i < this.activities.length; i++) {
this.activities[i].addBoundsToRange(this.bounds);
+ }
},
sortMemoryDumps: function() {
« no previous file with comments | « tracing/tracing/model/power_series_test.html ('k') | tracing/tracing/model/process_base.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698