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; |
} |
}; |