Index: chrome/browser/resources/tracing/timeline_track.js |
diff --git a/chrome/browser/resources/tracing/timeline_track.js b/chrome/browser/resources/tracing/timeline_track.js |
index cf2310771dedb109e43f4b4a3d8898c2a045eaf9..f4942c741334fb8ae80c4a833ae57ecd0bffe735 100644 |
--- a/chrome/browser/resources/tracing/timeline_track.js |
+++ b/chrome/browser/resources/tracing/timeline_track.js |
@@ -93,6 +93,19 @@ cr.define('tracing', function() { |
this.updateChildTracks_(); |
}, |
+ get heading() { |
James Hawkins
2011/11/05 17:51:37
Document return type.
nduca
2011/11/09 22:52:19
Done.
|
+ if (!this.thread_) |
+ return ''; |
+ var tname = this.thread_.name || this.thread_.tid; |
+ return this.thread_.parent.pid + ': ' + |
+ tname + ':'; |
+ }, |
+ |
+ set headingWidth(width) { |
+ for (var i = 0; i < this.tracks_.length; i++) |
+ this.tracks_[i].headingWidth = width; |
+ }, |
+ |
set viewport(v) { |
this.viewport_ = v; |
for (var i = 0; i < this.tracks_.length; i++) |
@@ -132,9 +145,7 @@ cr.define('tracing', function() { |
addTrack(this, this.thread_.subRows[srI]); |
} |
if (this.tracks_.length > 0) { |
- var tname = this.thread_.name || this.thread_.tid; |
- this.tracks_[0].heading = this.thread_.parent.pid + ': ' + |
- tname + ':'; |
+ this.tracks_[0].heading = this.heading; |
this.tracks_[0].tooltip = 'pid: ' + this.thread_.parent.pid + |
', tid: ' + this.thread_.tid + |
(this.thread_.name ? ', name: ' + this.thread_.name : ''); |
@@ -212,6 +223,14 @@ cr.define('tracing', function() { |
this.ctx_ = this.canvas_.getContext('2d'); |
}, |
+ set headingWidth(width) { |
+ this.headingDiv_.style.width = width; |
+ }, |
+ |
+ get heading() { |
+ return this.headingDiv_.textContent; |
+ }, |
+ |
set heading(text) { |
this.headingDiv_.textContent = text; |
}, |
@@ -443,7 +462,7 @@ cr.define('tracing', function() { |
return index != undefined ? this.slices_[index] : undefined; |
}, |
- /** |
+ /** |
* Return the previous slice, if any, before the given slice. |
* @param {slice} A slice. |
* @return {slice} The previous slice, or undefined. |
@@ -455,7 +474,7 @@ cr.define('tracing', function() { |
else if ((index != undefined) && (index > 0)) |
index--; |
return index != undefined ? this.slices_[index] : undefined; |
- }, |
+ } |
}; |