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

Unified Diff: tracing/tracing/extras/importer/zip_importer.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/extras/importer/zip_importer.html
diff --git a/tracing/tracing/extras/importer/zip_importer.html b/tracing/tracing/extras/importer/zip_importer.html
index dc2eda3929263cb4a8cda63c2b6cb16c5609c01f..a85150544b49d4829cc0733963ec0aa40e4ab0bb 100644
--- a/tracing/tracing/extras/importer/zip_importer.html
+++ b/tracing/tracing/extras/importer/zip_importer.html
@@ -19,8 +19,9 @@ found in the LICENSE file.
*/
tr.exportTo('tr.e.importer', function() {
function ZipImporter(model, eventData) {
- if (eventData instanceof ArrayBuffer)
+ if (eventData instanceof ArrayBuffer) {
eventData = new Uint8Array(eventData);
+ }
this.model_ = model;
this.eventData_ = eventData;
}
@@ -31,12 +32,13 @@ tr.exportTo('tr.e.importer', function() {
*/
ZipImporter.canImport = function(eventData) {
var header;
- if (eventData instanceof ArrayBuffer)
+ if (eventData instanceof ArrayBuffer) {
header = new Uint8Array(eventData.slice(0, 2));
- else if (typeof(eventData) === 'string' || eventData instanceof String)
+ } else if (typeof(eventData) === 'string' || eventData instanceof String) {
header = [eventData.charCodeAt(0), eventData.charCodeAt(1)];
- else
+ } else {
return false;
+ }
return header[0] === 'P'.charCodeAt(0) && header[1] === 'K'.charCodeAt(0);
};
@@ -54,8 +56,9 @@ tr.exportTo('tr.e.importer', function() {
extractSubtraces: function() {
var zip = new JSZip(this.eventData_);
var subtraces = [];
- for (var idx in zip.files)
+ for (var idx in zip.files) {
subtraces.push(zip.files[idx].asBinary());
+ }
return subtraces;
}
};
« no previous file with comments | « tracing/tracing/extras/importer/v8/v8_log_importer.html ('k') | tracing/tracing/extras/net/net_async_slice.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698