OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="stylesheet" href="/tracing/ui/tracks/thread_track.css"> | 8 <link rel="stylesheet" href="/tracing/ui/tracks/thread_track.css"> |
9 | 9 |
10 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 10 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 this.appendAsyncSliceTracks_(); | 71 this.appendAsyncSliceTracks_(); |
72 | 72 |
73 this.appendThreadSamplesTracks_(); | 73 this.appendThreadSamplesTracks_(); |
74 | 74 |
75 if (this.thread_.timeSlices) { | 75 if (this.thread_.timeSlices) { |
76 var timeSlicesTrack = new tr.ui.tracks.SliceTrack(this.viewport); | 76 var timeSlicesTrack = new tr.ui.tracks.SliceTrack(this.viewport); |
77 timeSlicesTrack.heading = ''; | 77 timeSlicesTrack.heading = ''; |
78 timeSlicesTrack.height = tr.ui.b.THIN_SLICE_HEIGHT + 'px'; | 78 timeSlicesTrack.height = tr.ui.b.THIN_SLICE_HEIGHT + 'px'; |
79 timeSlicesTrack.slices = this.thread_.timeSlices; | 79 timeSlicesTrack.slices = this.thread_.timeSlices; |
80 if (timeSlicesTrack.hasVisibleContent) | 80 if (timeSlicesTrack.hasVisibleContent) |
81 this.appendChild(timeSlicesTrack); | 81 Polymer.dom(this).appendChild(timeSlicesTrack); |
82 } | 82 } |
83 | 83 |
84 if (this.thread_.sliceGroup.length) { | 84 if (this.thread_.sliceGroup.length) { |
85 var track = new tr.ui.tracks.SliceGroupTrack(this.viewport); | 85 var track = new tr.ui.tracks.SliceGroupTrack(this.viewport); |
86 track.heading = this.thread_.userFriendlyName; | 86 track.heading = this.thread_.userFriendlyName; |
87 track.tooltip = this.thread_.userFriendlyDetails; | 87 track.tooltip = this.thread_.userFriendlyDetails; |
88 track.group = this.thread_.sliceGroup; | 88 track.group = this.thread_.sliceGroup; |
89 if (track.hasVisibleContent) | 89 if (track.hasVisibleContent) |
90 this.appendChild(track); | 90 Polymer.dom(this).appendChild(track); |
91 } | 91 } |
92 }, | 92 }, |
93 | 93 |
94 appendAsyncSliceTracks_: function() { | 94 appendAsyncSliceTracks_: function() { |
95 var subGroups = this.thread_.asyncSliceGroup.viewSubGroups; | 95 var subGroups = this.thread_.asyncSliceGroup.viewSubGroups; |
96 subGroups.forEach(function(subGroup) { | 96 subGroups.forEach(function(subGroup) { |
97 var asyncTrack = new tr.ui.tracks.AsyncSliceGroupTrack(this.viewport); | 97 var asyncTrack = new tr.ui.tracks.AsyncSliceGroupTrack(this.viewport); |
98 var title = subGroup.slices[0].viewSubGroupTitle; | 98 var title = subGroup.slices[0].viewSubGroupTitle; |
99 asyncTrack.group = subGroup; | 99 asyncTrack.group = subGroup; |
100 asyncTrack.heading = title; | 100 asyncTrack.heading = title; |
101 if (asyncTrack.hasVisibleContent) | 101 if (asyncTrack.hasVisibleContent) |
102 this.appendChild(asyncTrack); | 102 Polymer.dom(this).appendChild(asyncTrack); |
103 }, this); | 103 }, this); |
104 }, | 104 }, |
105 | 105 |
106 appendThreadSamplesTracks_: function() { | 106 appendThreadSamplesTracks_: function() { |
107 var threadSamples = this.thread_.samples; | 107 var threadSamples = this.thread_.samples; |
108 if (threadSamples === undefined || threadSamples.length === 0) | 108 if (threadSamples === undefined || threadSamples.length === 0) |
109 return; | 109 return; |
110 var samplesByTitle = {}; | 110 var samplesByTitle = {}; |
111 threadSamples.forEach(function(sample) { | 111 threadSamples.forEach(function(sample) { |
112 if (samplesByTitle[sample.title] === undefined) | 112 if (samplesByTitle[sample.title] === undefined) |
(...skipping 12 matching lines...) Expand all Loading... |
125 samplesTrack.heading = this.thread_.userFriendlyName + ': ' + | 125 samplesTrack.heading = this.thread_.userFriendlyName + ': ' + |
126 sampleTitle; | 126 sampleTitle; |
127 samplesTrack.tooltip = this.thread_.userFriendlyDetails; | 127 samplesTrack.tooltip = this.thread_.userFriendlyDetails; |
128 samplesTrack.selectionGenerator = function() { | 128 samplesTrack.selectionGenerator = function() { |
129 var selection = new tr.model.EventSet(); | 129 var selection = new tr.model.EventSet(); |
130 for (var i = 0; i < samplesTrack.samples.length; i++) { | 130 for (var i = 0; i < samplesTrack.samples.length; i++) { |
131 selection.push(samplesTrack.samples[i]); | 131 selection.push(samplesTrack.samples[i]); |
132 } | 132 } |
133 return selection; | 133 return selection; |
134 }; | 134 }; |
135 this.appendChild(samplesTrack); | 135 Polymer.dom(this).appendChild(samplesTrack); |
136 }, this); | 136 }, this); |
137 }, | 137 }, |
138 | 138 |
139 collapsedDidChange: function(collapsed) { | 139 collapsedDidChange: function(collapsed) { |
140 if (collapsed) { | 140 if (collapsed) { |
141 var h = parseInt(this.tracks[0].height); | 141 var h = parseInt(this.tracks[0].height); |
142 for (var i = 0; i < this.tracks.length; ++i) { | 142 for (var i = 0; i < this.tracks.length; ++i) { |
143 if (h > 2) { | 143 if (h > 2) { |
144 this.tracks[i].height = Math.floor(h) + 'px'; | 144 this.tracks[i].height = Math.floor(h) + 'px'; |
145 } else { | 145 } else { |
146 this.tracks[i].style.display = 'none'; | 146 this.tracks[i].style.display = 'none'; |
147 } | 147 } |
148 h = h * 0.5; | 148 h = h * 0.5; |
149 } | 149 } |
150 } else { | 150 } else { |
151 for (var i = 0; i < this.tracks.length; ++i) { | 151 for (var i = 0; i < this.tracks.length; ++i) { |
152 this.tracks[i].height = this.tracks[0].height; | 152 this.tracks[i].height = this.tracks[0].height; |
153 this.tracks[i].style.display = ''; | 153 this.tracks[i].style.display = ''; |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 }; | 157 }; |
158 | 158 |
159 return { | 159 return { |
160 ThreadTrack: ThreadTrack | 160 ThreadTrack: ThreadTrack |
161 }; | 161 }; |
162 }); | 162 }); |
163 </script> | 163 </script> |
OLD | NEW |