OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 * @implements {WebInspector.TimelineModeView} | 9 * @implements {WebInspector.TimelineModeView} |
10 * @implements {WebInspector.FlameChartDelegate} | 10 * @implements {WebInspector.FlameChartDelegate} |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 this._appendRecord(objects[objectIndex]); | 329 this._appendRecord(objects[objectIndex]); |
330 ++this._currentLevel; | 330 ++this._currentLevel; |
331 } | 331 } |
332 var threads = process.sortedThreads(); | 332 var threads = process.sortedThreads(); |
333 for (var threadIndex = 0; threadIndex < threads.length; ++threadInde x) { | 333 for (var threadIndex = 0; threadIndex < threads.length; ++threadInde x) { |
334 this._appendHeaderRecord(threads[threadIndex].name(), this._thre adHeaderRecord); | 334 this._appendHeaderRecord(threads[threadIndex].name(), this._thre adHeaderRecord); |
335 var events = threads[threadIndex].events(); | 335 var events = threads[threadIndex].events(); |
336 for (var eventIndex = 0; eventIndex < events.length; ++eventInde x) { | 336 for (var eventIndex = 0; eventIndex < events.length; ++eventInde x) { |
337 var event = events[eventIndex]; | 337 var event = events[eventIndex]; |
338 if (event.duration) | 338 if (event.duration) |
339 this._appendRecord(event); | 339 this._appendRecord(event, event.level); |
340 } | 340 } |
341 this._currentLevel += threads[threadIndex].maxStackDepth(); | 341 this._currentLevel += threads[threadIndex].maxStackDepth(); |
342 } | 342 } |
343 ++this._currentLevel; | 343 ++this._currentLevel; |
344 } | 344 } |
345 return this._timelineData; | 345 return this._timelineData; |
346 }, | 346 }, |
347 | 347 |
348 /** | 348 /** |
349 * @return {number} | 349 * @return {number} |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 var index = this._records.length; | 470 var index = this._records.length; |
471 this._records.push(record); | 471 this._records.push(record); |
472 this._timelineData.entryLevels[index] = this._currentLevel++; | 472 this._timelineData.entryLevels[index] = this._currentLevel++; |
473 this._timelineData.entryTotalTimes[index] = this.totalTime(); | 473 this._timelineData.entryTotalTimes[index] = this.totalTime(); |
474 this._timelineData.entryStartTimes[index] = this._minimumBoundary; | 474 this._timelineData.entryStartTimes[index] = this._minimumBoundary; |
475 this._headerTitles[index] = title; | 475 this._headerTitles[index] = title; |
476 }, | 476 }, |
477 | 477 |
478 /** | 478 /** |
479 * @param {!WebInspector.TracingModel.Event} record | 479 * @param {!WebInspector.TracingModel.Event} record |
480 * @param {number=} level | |
480 */ | 481 */ |
481 _appendRecord: function(record) | 482 _appendRecord: function(record, level) |
yurys
2014/06/09 15:25:59
Let's always pass level value explicitly.
| |
482 { | 483 { |
483 var index = this._records.length; | 484 var index = this._records.length; |
484 this._records.push(record); | 485 this._records.push(record); |
485 this._timelineData.entryLevels[index] = this._currentLevel + record.leve l; | 486 this._timelineData.entryLevels[index] = this._currentLevel + (level || 0 ); |
486 this._timelineData.entryTotalTimes[index] = record.phase === WebInspecto r.TracingModel.Phase.SnapshotObject ? NaN : record.duration || 0; | 487 this._timelineData.entryTotalTimes[index] = record.phase === WebInspecto r.TracingModel.Phase.SnapshotObject ? NaN : record.duration || 0; |
487 this._timelineData.entryStartTimes[index] = record.startTime; | 488 this._timelineData.entryStartTimes[index] = record.startTime; |
488 }, | 489 }, |
489 | 490 |
490 /** | 491 /** |
491 * @param {!WebInspector.TracingModel.Event} record | 492 * @param {!WebInspector.TracingModel.Event} record |
492 */ | 493 */ |
493 _isHeaderRecord: function(record) | 494 _isHeaderRecord: function(record) |
494 { | 495 { |
495 return record === this._threadHeaderRecord || record === this._processHe aderRecord; | 496 return record === this._threadHeaderRecord || record === this._processHe aderRecord; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
573 /** | 574 /** |
574 * @param {string} string | 575 * @param {string} string |
575 * @return {string} | 576 * @return {string} |
576 */ | 577 */ |
577 colorForString: function(string) | 578 colorForString: function(string) |
578 { | 579 { |
579 var hash = WebInspector.TraceViewPalette._stringHash(string); | 580 var hash = WebInspector.TraceViewPalette._stringHash(string); |
580 return this._palette[hash % this._palette.length]; | 581 return this._palette[hash % this._palette.length]; |
581 } | 582 } |
582 }; | 583 }; |
OLD | NEW |