diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-05 17:34:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-06 10:04:14 +0000 |
commit | eaf1da4d961fbbda9455f9af3b23d1af777f43fa (patch) | |
tree | 95970599ecee31c4f7f940bc97ac98c61a3d0cad /chromium/third_party/catapult/tracing/tracing/trace2html.html | |
parent | 38a9a29f4f9436cace7f0e7abf9c586057df8a4e (diff) |
BASELINE: Update Chromium to 73.0.3683.64
Change-Id: I76517dc277ba4e16bfd7e098fda3d079656b3b9f
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/catapult/tracing/tracing/trace2html.html')
-rw-r--r-- | chromium/third_party/catapult/tracing/tracing/trace2html.html | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/chromium/third_party/catapult/tracing/tracing/trace2html.html b/chromium/third_party/catapult/tracing/tracing/trace2html.html new file mode 100644 index 00000000000..640f042bc3d --- /dev/null +++ b/chromium/third_party/catapult/tracing/tracing/trace2html.html @@ -0,0 +1,76 @@ +<!DOCTYPE html> +<!-- +Copyright (c) 2014 The Chromium Authors. All rights reserved. +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> +<link rel="import" href="/tracing/base/base64.html"> +<link rel="import" href="/tracing/ui/base/base.html"> +<link rel="import" href="/tracing/ui/timeline_view.html"> +<script> +'use strict'; + +let g_timelineViewEl; + +(function() { + const styleEl = document.createElement('style'); + const lines = [ + 'html, body {', + ' box-sizing: border-box;', + ' overflow: hidden;', + ' margin: 0px;', + ' padding: 0;', + ' width: 100%;', + ' height: 100%;', + '}', + 'tr-ui-timeline-view {', + ' width: 100%;', + ' height: 100%;', + '}', + 'tr-ui-timeline-view:focus {', + ' outline: none;', + '}' + ]; + Polymer.dom(styleEl).textContent = lines.join('\n'); + Polymer.dom(document.head).appendChild(styleEl); +})(); + +document.addEventListener('DOMContentLoaded', function() { + const container = document.createElement('track-view-container'); + container.id = 'track_view_container'; + + g_timelineViewEl = document.createElement('tr-ui-timeline-view'); + Polymer.dom(g_timelineViewEl).appendChild(container); + + Polymer.dom(document.body).appendChild(g_timelineViewEl); + + const traces = []; + const viewerDataScripts = Polymer.dom(document).querySelectorAll( + '#viewer-data'); + for (let i = 0; i < viewerDataScripts.length; i++) { + let text = Polymer.dom(viewerDataScripts[i]).textContent; + // Trim leading newlines off the text. They happen during writing. + while (text[0] === '\n') { + text = text.substring(1); + } + traces.push(tr.b.Base64.atob(text)); + } + + const m = new tr.Model(); + const i = new tr.importer.Import(m); + const p = i.importTracesWithProgressDialog(traces); + p.then( + function() { + g_timelineViewEl.model = m; + g_timelineViewEl.updateDocumentFavicon(); + g_timelineViewEl.globalMode = true; + g_timelineViewEl.viewTitle = document.title; + }, + function(err) { + const overlay = new tr.ui.b.Overlay(); + Polymer.dom(overlay).textContent = tr.b.normalizeException(err).message; + overlay.title = 'Import error'; + overlay.visible = true; + }); +}); +</script> |