OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 /** | 5 /** |
6 * @fileoverview Interactive visualizaiton of TimelineModel objects | 6 * @fileoverview Interactive visualizaiton of TimelineModel objects |
7 * based loosely on gantt charts. Each thread in the TimelineModel is given a | 7 * based loosely on gantt charts. Each thread in the TimelineModel is given a |
8 * set of TimelineTracks, one per subrow in the thread. The Timeline class | 8 * set of TimelineTracks, one per subrow in the thread. The Timeline class |
9 * acts as a controller, creating the individual tracks, while TimelineTracks | 9 * acts as a controller, creating the individual tracks, while TimelineTracks |
10 * do actual drawing. | 10 * do actual drawing. |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // Get a sorted list of threads. | 389 // Get a sorted list of threads. |
390 var threads = []; | 390 var threads = []; |
391 for (var tid in process.threads) | 391 for (var tid in process.threads) |
392 threads.push(process.threads[tid]); | 392 threads.push(process.threads[tid]); |
393 threads.sort(tracing.TimelineThread.compare); | 393 threads.sort(tracing.TimelineThread.compare); |
394 | 394 |
395 // Create the threads. | 395 // Create the threads. |
396 threads.forEach(function(thread) { | 396 threads.forEach(function(thread) { |
397 var track = new tracing.TimelineThreadTrack(); | 397 var track = new tracing.TimelineThreadTrack(); |
398 track.heading = thread.userFriendlyName + ':'; | 398 track.heading = thread.userFriendlyName + ':'; |
399 track.tooltip = thread.userFriendlyDetials; | 399 track.tooltip = thread.userFriendlyDetails; |
400 track.headingWidth = maxHeadingWidth; | 400 track.headingWidth = maxHeadingWidth; |
401 track.viewport = this.viewport_; | 401 track.viewport = this.viewport_; |
402 track.thread = thread; | 402 track.thread = thread; |
403 this.tracks_.appendChild(track); | 403 this.tracks_.appendChild(track); |
404 }.bind(this)); | 404 }.bind(this)); |
405 }.bind(this)); | 405 }.bind(this)); |
406 | 406 |
407 // Set up a reasonable viewport. | 407 // Set up a reasonable viewport. |
408 this.viewport_.setWhenPossible(function() { | 408 this.viewport_.setWhenPossible(function() { |
409 var rangeTimestamp = this.model_.maxTimestamp - | 409 var rangeTimestamp = this.model_.maxTimestamp - |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 * The TimelineModel being viewed by the timeline | 755 * The TimelineModel being viewed by the timeline |
756 * @type {TimelineModel} | 756 * @type {TimelineModel} |
757 */ | 757 */ |
758 cr.defineProperty(Timeline, 'model', cr.PropertyKind.JS); | 758 cr.defineProperty(Timeline, 'model', cr.PropertyKind.JS); |
759 | 759 |
760 return { | 760 return { |
761 Timeline: Timeline, | 761 Timeline: Timeline, |
762 TimelineViewport: TimelineViewport | 762 TimelineViewport: TimelineViewport |
763 }; | 763 }; |
764 }); | 764 }); |
OLD | NEW |