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

Unified Diff: tracing/tracing/extras/importer/gzip_importer.html

Issue 2864743002: tracing: Enable stream processing when input is large (Closed)
Patch Set: sync Created 3 years, 7 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 | « no previous file | tracing/tracing/extras/importer/trace2html_importer.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/extras/importer/gzip_importer.html
diff --git a/tracing/tracing/extras/importer/gzip_importer.html b/tracing/tracing/extras/importer/gzip_importer.html
index c849e223813b00fedf0ce6272b0848b00d8ac47f..3d58ca9cb99fd8c3ddd08eff47a5af4737a6594a 100644
--- a/tracing/tracing/extras/importer/gzip_importer.html
+++ b/tracing/tracing/extras/importer/gzip_importer.html
@@ -133,7 +133,14 @@ tr.exportTo('tr.e.importer', function() {
return GzipImporter.transformToStream(inflatedData);
}
- const string = GzipImporter.transformToString(inflatedData);
+ let string;
+ try {
+ string = GzipImporter.transformToString(inflatedData);
+ } catch (err) {
+ // It may be the case that inflated data does not fit into a V8 string. In
+ // that case, try to transform to a trace stream.
+ return GzipImporter.transformToStream(inflatedData);
+ }
if (inflatedData.length > 0 && string.length === 0) {
throw new RangeError('Inflated gzip data too long to fit into a string' +
« no previous file with comments | « no previous file | tracing/tracing/extras/importer/trace2html_importer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698