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

Unified Diff: tools/telemetry/telemetry/value/trace.py

Issue 1066903002: Roll trace-viewer deps to the latest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update trace-viewer DEPS to fix license problem Created 5 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
« no previous file with comments | « content/browser/tracing/tracing_ui.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/value/trace.py
diff --git a/tools/telemetry/telemetry/value/trace.py b/tools/telemetry/telemetry/value/trace.py
index 416eb746b37297f57d7c7695d217c9ebce86d835..176eb29ddabb40d6f9876f153aeb9ad1dfb50120 100644
--- a/tools/telemetry/telemetry/value/trace.py
+++ b/tools/telemetry/telemetry/value/trace.py
@@ -7,6 +7,7 @@ import logging
import os
import random
import shutil
+import StringIO
import sys
import tempfile
@@ -39,15 +40,17 @@ class TraceValue(value_module.Value):
self._serialized_file_handle = None
def _GetTempFileHandle(self, trace_data):
- tf = tempfile.NamedTemporaryFile(delete=False, suffix='.html')
if self.page:
title = self.page.display_name
else:
title = ''
+ content = StringIO.StringIO()
trace2html.WriteHTMLForTraceDataToFile(
[trace_data.GetEventsFor(trace_data_module.CHROME_TRACE_PART)],
title,
- tf)
+ content)
+ tf = tempfile.NamedTemporaryFile(delete=False, suffix='.html')
+ tf.write(content.getvalue().encode('utf-8'))
tf.close()
return file_handle.FromTempFile(tf)
« no previous file with comments | « content/browser/tracing/tracing_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698