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

Unified Diff: tracing/tracing/base/xhr.html

Issue 2755943002: tracing: Stream processing for some importers (Closed)
Patch Set: review / sync Created 3 years, 8 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/base/xhr.html
diff --git a/tracing/tracing/base/xhr.html b/tracing/tracing/base/xhr.html
index 439fc68a7646980d3fca316da517b46c97cebc02..424fd55dde703cb0de75f4d75b54b160f9925724 100644
--- a/tracing/tracing/base/xhr.html
+++ b/tracing/tracing/base/xhr.html
@@ -6,6 +6,7 @@ found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/base.html">
+<link rel="import" href="/tracing/base/in_memory_trace_stream.html">
<script>
'use strict';
@@ -93,7 +94,7 @@ tr.exportTo('tr.b', function() {
});
}
- function getSync(url) {
+ function getSync(url, asTraceStream) {
// Browser.
if (!tr.isHeadless) return xhr('GET', url, false);
@@ -116,7 +117,12 @@ tr.exportTo('tr.b', function() {
// Vinn.
try {
- if (isBinary) return readbuffer(filename);
+ if (asTraceStream) {
+ return new tr.b.InMemoryTraceStream(
+ new Uint8Array(readbuffer(filename)), isBinary);
+ } else if (isBinary) {
+ return readbuffer(filename);
+ }
return read(filename);
} catch (ex) {
if (ex.message) {
« no previous file with comments | « tracing/tracing/base/in_memory_trace_stream.html ('k') | tracing/tracing/extras/importer/gzip_importer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698