blob: 7abb6a99e687b4aae164d540a821503ff4205592 [file] [log] [blame]
Chris Craikb122baf2015-03-05 13:58:42 -08001<!DOCTYPE html>
2<!--
3Copyright (c) 2015 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7
Chris Craikb122baf2015-03-05 13:58:42 -08008<link rel="import" href="/core/analysis/analysis_sub_view.html">
Chris Craikbeca7ae2015-04-07 13:29:55 -07009<link rel="import" href="/core/analysis/table_builder.html">
Chris Craikb122baf2015-03-05 13:58:42 -080010<link rel="import" href="/core/analysis/util.html">
11
12<polymer-element name="tv-c-multi-global-memory-dump-sub-view"
13 extends="tracing-analysis-sub-view">
Chris Craikbeca7ae2015-04-07 13:29:55 -070014 <template>
15 <style>
16 :host {
17 display: flex;
18 }
19 </style>
20 <tracing-analysis-nested-table id="content"></tracing-analysis-nested-table>
21 </template>
22
Chris Craikb122baf2015-03-05 13:58:42 -080023 <script>
24 'use strict';
25
26 Polymer({
27 created: function() {
28 this.currentSelection_ = undefined;
29 },
30
Chris Craikbeca7ae2015-04-07 13:29:55 -070031 get selection() {
32 return this.currentSelection_;
33 },
34
Chris Craikb122baf2015-03-05 13:58:42 -080035 set selection(selection) {
36 this.currentSelection_ = selection;
Chris Craikb122baf2015-03-05 13:58:42 -080037
38 selection = tv.b.asArray(selection).sort(
39 tv.b.Range.compareByMinTimes);
40
Chris Craikbeca7ae2015-04-07 13:29:55 -070041 var table = this.$.content;
42 table.tableColumns = [
43 {
44 title: 'Dump',
45 value: function(row) {
46 var linkEl = document.createElement('tv-c-analysis-link');
47 linkEl.setSelectionAndContent(function() {
48 return new tv.c.Selection(row);
49 });
50 var spanEl = document.createElement('span');
Chris Craik44c28202015-05-12 17:25:16 -070051 spanEl.textContent = 'Global memory dump at ';
Chris Craikbeca7ae2015-04-07 13:29:55 -070052 linkEl.appendChild(spanEl);
53 linkEl.appendChild(tv.c.analysis.createTimeStamp(row.start));
54 return linkEl;
55 }
Chris Craikb122baf2015-03-05 13:58:42 -080056 }
Chris Craikbeca7ae2015-04-07 13:29:55 -070057 ];
58 table.showHeader = false;
Chris Craik44c28202015-05-12 17:25:16 -070059 table.tableRows = selection;
Chris Craikbeca7ae2015-04-07 13:29:55 -070060 table.rebuild();
Chris Craikb122baf2015-03-05 13:58:42 -080061 }
62 });
63 </script>
Chris Craik44c28202015-05-12 17:25:16 -070064</polymer-element>