| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2015 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="/core/analysis/analysis_sub_view.html"> |
| <link rel="import" href="/core/analysis/memory_dump_overview_pane.html"> |
| <link rel="import" href="/core/analysis/memory_dump_details_pane.html"> |
| |
| <polymer-element name="tv-c-single-process-memory-dump-sub-view" |
| extends="tracing-analysis-sub-view"> |
| <template> |
| <style> |
| :host { |
| display: flex; |
| flex-direction: column; |
| } |
| </style> |
| <tv-c-memory-dump-overview-pane id="overview_pane"> |
| </tv-c-memory-dump-overview-pane> |
| <tv-c-memory-dump-details-pane id="details_pane"> |
| </tv-c-memory-dump-details-pane> |
| </template> |
| <script> |
| 'use strict'; |
| |
| Polymer({ |
| created: function() { |
| this.currentSelection_ = undefined; |
| }, |
| |
| ready: function() { |
| this.$.overview_pane.addEventListener( |
| 'selected-memory-dump-changed', function(e) { |
| this.$.details_pane.memoryDump = |
| this.$.overview_pane.selectedMemoryDump; |
| }.bind(this)); |
| }, |
| |
| set selection(selection) { |
| if (selection.length !== 1) |
| throw new Error('Only supports a single process memory dump'); |
| if (!(selection[0] instanceof tv.c.trace_model.ProcessMemoryDump)) |
| throw new Error('Only supports process memory dumps'); |
| this.setSelectionWithoutErrorChecks(selection); |
| }, |
| |
| get selection() { |
| return this.currentSelection_; |
| }, |
| |
| get requiresTallView() { |
| return true; |
| }, |
| |
| setSelectionWithoutErrorChecks: function(selection) { |
| this.currentSelection_ = selection; |
| this.$.overview_pane.processMemoryDumps = [selection[0]]; |
| this.$.details_pane.memoryDump = undefined; |
| } |
| }); |
| </script> |
| </polymer-element> |