Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: tools/turbolizer/view.js

Issue 2174803002: [turbolizer] Add support for showing perf profiling information. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [turbolizer] Add support for showing perf profiling information. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/turbolizer/turbo-visualizer.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 class View { 7 class View {
8 constructor(id, broker) { 8 constructor(id, broker) {
9 this.divElement = d3.select("#" + id); 9 this.divElement = d3.select("#" + id);
10 this.divNode = this.divElement[0][0]; 10 this.divNode = this.divElement[0][0];
11 this.parentNode = this.divNode.parentNode; 11 this.parentNode = this.divNode.parentNode;
12 this.hide(); 12 this.hide();
13 } 13 }
14 14
15 isScrollable() { 15 isScrollable() {
16 return false; 16 return false;
17 } 17 }
18 18
19 show(data, rememberedSelection) { 19 show(data, rememberedSelection) {
20 this.parentNode.appendChild(this.divElement[0][0]); 20 this.parentNode.appendChild(this.divElement[0][0]);
21 this.initializeContent(data, rememberedSelection); 21 this.initializeContent(data, rememberedSelection);
22 this.resizeToParent(); 22 this.resizeToParent();
23 this.divElement.attr(VISIBILITY, 'visible'); 23 this.divElement.attr(VISIBILITY, 'visible');
24 } 24 }
25 25
26 resizeToParent() { 26 resizeToParent() {
27 var view = this; 27 var view = this;
28 var documentElement = document.documentElement; 28 var documentElement = document.documentElement;
29 var y = this.parentNode.clientHeight || documentElement.clientHeight; 29 var y;
30 if (this.parentNode.clientHeight)
31 y = Math.max(this.parentNode.clientHeight, documentElement.clientHeight);
32 else
33 y = documentElement.clientHeight;
30 this.parentNode.style.height = y + 'px'; 34 this.parentNode.style.height = y + 'px';
31 } 35 }
32 36
33 hide() { 37 hide() {
34 this.divElement.attr(VISIBILITY, 'hidden'); 38 this.divElement.attr(VISIBILITY, 'hidden');
35 this.deleteContent(); 39 this.deleteContent();
36 this.parentNode.removeChild(this.divNode); 40 this.parentNode.removeChild(this.divNode);
37 } 41 }
38 42
39 detachSelection() { 43 detachSelection() {
40 return null; 44 return null;
41 } 45 }
42 } 46 }
OLDNEW
« no previous file with comments | « tools/turbolizer/turbo-visualizer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698