• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<html>
3<head i18n-values="dir:textdirection;">
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5<meta charset="utf-8"/>
6<title>Android System Trace</title>
7<style>
8  html,
9  body {
10    height: 100%;
11  }
12
13  body {
14    -webkit-flex-direction: column;
15    display: -webkit-flex;
16    margin: 0;
17    padding: 0;
18  }
19
20  body > tr-ui-timeline-view {
21    -webkit-flex: 1 1 auto;
22    min-height: 0;
23  }
24  body > tr-ui-timeline-view:focus {
25    outline: none;
26  }
27</style>
28
29<!-- WebComponent V0 polyfill. See https://crbug.com/1036492 -->
30<script>
31'use strict';
32{{WEBCOMPONENTS_V0_POLYFILL_JS}}
33</script>
34{{SYSTRACE_TRACE_VIEWER_HTML}}
35</head>
36<body>
37  <tr-ui-timeline-view>
38    <track-view-container id='track_view_container'></track-view-container>
39  </tr-ui-timeline-view>
40
41  <script>
42  'use strict';
43  var timelineViewEl;
44
45  function onLoad() {
46    timelineViewEl = document.querySelector('tr-ui-timeline-view');
47    timelineViewEl.globalMode = true;
48
49    var traceDataEls = document.body.querySelectorAll('.trace-data');
50    var traces = [];
51    for (var i = 0; i < traceDataEls.length; i++) {
52      var traceText = traceDataEls[i].textContent;
53      // Remove the leading newline.
54      traceText = traceText.substring(1);
55      traces.push(traceText);
56    }
57
58    var m = new tr.Model();
59    var i = new tr.importer.Import(m);
60    var p = i.importTracesWithProgressDialog(traces);
61    p.then(
62      function() {
63        timelineViewEl.model = m;
64        timelineViewEl.updateDocumentFavicon();
65        timelineViewEl.globalMode = true;
66        timelineViewEl.viewTitle = 'Android System Trace';
67      },
68      function(err) {
69        var overlay = new tr.ui.b.Overlay();
70        overlay.textContent = tr.b.normalizeException(err).message;
71        overlay.title = 'Import error';
72        overlay.visible = true;
73      });
74  }
75  window.addEventListener('load', onLoad);
76  </script>
77