blob: 8effd0f259395c151c8aed6bfc33e9ec5c961049 [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
8<link rel="import" href="/core/analysis/analysis_results.html">
9<link rel="import" href="/core/analysis/analysis_sub_view.html">
10<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">
14 <script>
15 'use strict';
16
17 Polymer({
18 created: function() {
19 this.currentSelection_ = undefined;
20 },
21
22 set selection(selection) {
23 this.currentSelection_ = selection;
24 this.textContent = '';
25
26 selection = tv.b.asArray(selection).sort(
27 tv.b.Range.compareByMinTimes);
28
29 var results = new tv.c.analysis.AnalysisResults();
30 this.appendChild(results);
31
32 var table = results.appendTable('analysis-global-memory-dump-table', 1);
33
34 selection.forEach(function(dump) {
35 var row = results.appendBodyRow(table);
36 var linkContainer = results.appendTableCell(table, row, '');
37 var label = 'Dump at ' + tv.c.analysis.tsString(dump.start);
38 var selectionGenerator = function() {
39 var selection = new tv.c.Selection();
40 selection.push(dump);
41 return selection;
42 }
43 linkContainer.appendChild(results.createSelectionChangingLink(
44 label, selectionGenerator));
45 });
46 },
47
48 get selection() {
49 return this.currentSelection_;
50 }
51 });
52 </script>
53</polymer>