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

Unified Diff: tracing/tracing/ui/extras/about_tracing/inspector_tracing_controller_client.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
Index: tracing/tracing/ui/extras/about_tracing/inspector_tracing_controller_client.html
diff --git a/tracing/tracing/ui/extras/about_tracing/inspector_tracing_controller_client.html b/tracing/tracing/ui/extras/about_tracing/inspector_tracing_controller_client.html
index 31ed9a5fd188a20eb5bfe8e64e1d8266b8856fa0..8a46463b93c80c87b3f10b97e1b9f6ea885e3985 100644
--- a/tracing/tracing/ui/extras/about_tracing/inspector_tracing_controller_client.html
+++ b/tracing/tracing/ui/extras/about_tracing/inspector_tracing_controller_client.html
@@ -15,24 +15,28 @@ found in the LICENSE file.
tr.exportTo('tr.ui.e.about_tracing', function() {
function createResolvedPromise(data) {
var promise = new Promise(function(resolve, reject) {
- if (data)
+ if (data) {
resolve(data);
- else
+ } else {
resolve();
+ }
});
return promise;
}
function appendTraceChunksTo(chunks, messageString) {
- if (typeof messageString !== 'string')
+ if (typeof messageString !== 'string') {
throw new Error('Invalid data');
+ }
var re = /"params":\s*\{\s*"value":\s*\[([^]+)\]\s*\}\s*\}/;
var m = re.exec(messageString);
- if (!m)
+ if (!m) {
throw new Error('Malformed response');
+ }
- if (chunks.length > 1)
+ if (chunks.length > 1) {
chunks.push(',');
+ }
chunks.push(m[1]);
}
@@ -83,8 +87,9 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
},
beginRecording: function(recordingOptions) {
- if (this.recording_)
+ if (this.recording_) {
throw new Error('Already recording');
+ }
this.recording_ = 'starting';
var res = this.conn_.req(
'Tracing.start',
@@ -126,11 +131,13 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
},
endRecording: function() {
- if (this.recording_ === false)
+ if (this.recording_ === false) {
return createResolvedPromise();
+ }
- if (this.recording_ !== true)
+ if (this.recording_ !== true) {
throw new Error('Cannot end');
+ }
this.currentTraceTextChunks_ = ['['];
this.conn_.setNotificationListener(

Powered by Google App Engine
This is Rietveld 408576698