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

Unified Diff: tracing/tracing/base/settings.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/base/raf_test.html ('k') | tracing/tracing/base/sinebow_color_generator.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/settings.html
diff --git a/tracing/tracing/base/settings.html b/tracing/tracing/base/settings.html
index 4aa2da0f98600eda0822f785314863e043f88b89..9d2546a4d91c7d5a04ddef75a685f99a02ed1240 100644
--- a/tracing/tracing/base/settings.html
+++ b/tracing/tracing/base/settings.html
@@ -27,10 +27,11 @@ tr.exportTo('tr.b', function() {
tr.b.unittest.TestRunner.addEventListener(
'tr-unittest-will-run',
function() {
- if (tr.isHeadless)
+ if (tr.isHeadless) {
Settings.setAlternativeStorageInstance(new HeadlessStorage());
- else
+ } else {
Settings.setAlternativeStorageInstance(global.sessionStorage);
+ }
});
}
@@ -53,8 +54,9 @@ tr.exportTo('tr.b', function() {
inputClass.get = function(key, opt_default, opt_namespace) {
key = inputClass.namespace_(key, opt_namespace);
var rawVal = inputClass.storage_.getItem(key);
- if (rawVal === null || rawVal === undefined)
+ if (rawVal === null || rawVal === undefined) {
return opt_default;
+ }
// Old settings versions used to stringify objects instead of putting them
// into JSON. If those are encountered, parse will fail. In that case,
@@ -77,8 +79,9 @@ tr.exportTo('tr.b', function() {
* a set of related settings.
*/
inputClass.set = function(key, value, opt_namespace) {
- if (value === undefined)
+ if (value === undefined) {
throw new Error('Settings.set: value must not be undefined');
+ }
var v = JSON.stringify({value: value});
inputClass.storage_.setItem(
inputClass.namespace_(key, opt_namespace), v);
@@ -96,8 +99,9 @@ tr.exportTo('tr.b', function() {
opt_namespace = opt_namespace || '';
for (var i = 0; i < inputClass.storage_.length; i++) {
var key = inputClass.storage_.key(i);
- if (inputClass.isnamespaced_(key, opt_namespace))
+ if (inputClass.isnamespaced_(key, opt_namespace)) {
result.push(inputClass.unnamespace_(key, opt_namespace));
+ }
}
return result;
};
@@ -129,8 +133,9 @@ tr.exportTo('tr.b', function() {
};
inputClass.getAlternativeStorageInstance = function() {
- if (!tr.isHeadless && inputClass.storage_ === localStorage)
+ if (!tr.isHeadless && inputClass.storage_ === localStorage) {
return undefined;
+ }
return inputClass.storage_;
};
@@ -149,24 +154,28 @@ tr.exportTo('tr.b', function() {
},
get itemsAsArray() {
- if (this.itemsAsArray_ !== undefined)
+ if (this.itemsAsArray_ !== undefined) {
return this.itemsAsArray_;
+ }
var itemsAsArray = [];
- for (var k in this.items_)
+ for (var k in this.items_) {
itemsAsArray.push(k);
+ }
this.itemsAsArray_ = itemsAsArray;
return this.itemsAsArray_;
},
getItem: function(key) {
- if (!this.hasItem_[key])
+ if (!this.hasItem_[key]) {
return null;
+ }
return this.items_[key];
},
removeItem: function(key) {
- if (!this.hasItem_[key])
+ if (!this.hasItem_[key]) {
return;
+ }
var value = this.items_[key];
delete this.hasItem_[key];
delete this.items_[key];
« no previous file with comments | « tracing/tracing/base/raf_test.html ('k') | tracing/tracing/base/sinebow_color_generator.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698