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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineTracingView.js

Issue 323873002: Timeline: do not remove trace object snapshots from event list of their threads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments addressed Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TracingModel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 this._timeSpan = Math.max(this._model.maximumRecordTime() - this._minimu mBoundary, 1000); 319 this._timeSpan = Math.max(this._model.maximumRecordTime() - this._minimu mBoundary, 1000);
320 var processes = this._model.sortedProcesses(); 320 var processes = this._model.sortedProcesses();
321 for (var processIndex = 0; processIndex < processes.length; ++processInd ex) { 321 for (var processIndex = 0; processIndex < processes.length; ++processInd ex) {
322 var process = processes[processIndex]; 322 var process = processes[processIndex];
323 this._appendHeaderRecord(process.name(), this._processHeaderRecord); 323 this._appendHeaderRecord(process.name(), this._processHeaderRecord);
324 var objectNames = process.sortedObjectNames(); 324 var objectNames = process.sortedObjectNames();
325 for (var objectNameIndex = 0; objectNameIndex < objectNames.length; ++objectNameIndex) { 325 for (var objectNameIndex = 0; objectNameIndex < objectNames.length; ++objectNameIndex) {
326 this._appendHeaderRecord(WebInspector.UIString("Object %s", obje ctNames[objectNameIndex]), this._threadHeaderRecord); 326 this._appendHeaderRecord(WebInspector.UIString("Object %s", obje ctNames[objectNameIndex]), this._threadHeaderRecord);
327 var objects = process.objectsByName(objectNames[objectNameIndex] ); 327 var objects = process.objectsByName(objectNames[objectNameIndex] );
328 for (var objectIndex = 0; objectIndex < objects.length; ++object Index) 328 for (var objectIndex = 0; objectIndex < objects.length; ++object Index)
329 this._appendRecord(objects[objectIndex]); 329 this._appendRecord(objects[objectIndex], 0);
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
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)
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;
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
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 };
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TracingModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698