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

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

Issue 363343004: DevTools: Unify main thread name across vanilla and tracing timeline modes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * @constructor 6 * @constructor
7 * @extends {WebInspector.TimelineModel} 7 * @extends {WebInspector.TimelineModel}
8 * @param {!WebInspector.TimelineManager} timelineManager 8 * @param {!WebInspector.TimelineManager} timelineManager
9 */ 9 */
10 WebInspector.TimelineModelImpl = function(timelineManager) 10 WebInspector.TimelineModelImpl = function(timelineManager)
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 * @implements {WebInspector.TimelineModel.Record} 292 * @implements {WebInspector.TimelineModel.Record}
293 * @param {!WebInspector.TimelineModelImpl} model 293 * @param {!WebInspector.TimelineModelImpl} model
294 * @param {!TimelineAgent.TimelineEvent} timelineEvent 294 * @param {!TimelineAgent.TimelineEvent} timelineEvent
295 * @param {?WebInspector.TimelineModel.Record} parentRecord 295 * @param {?WebInspector.TimelineModel.Record} parentRecord
296 */ 296 */
297 WebInspector.TimelineModel.RecordImpl = function(model, timelineEvent, parentRec ord) 297 WebInspector.TimelineModel.RecordImpl = function(model, timelineEvent, parentRec ord)
298 { 298 {
299 this._model = model; 299 this._model = model;
300 var bindings = this._model._bindings; 300 var bindings = this._model._bindings;
301 this._record = timelineEvent; 301 this._record = timelineEvent;
302 this._thread = this._record.thread || WebInspector.TimelineModel.MainThreadN ame;
302 this._children = []; 303 this._children = [];
303 if (parentRecord) { 304 if (parentRecord) {
304 this.parent = parentRecord; 305 this.parent = parentRecord;
305 parentRecord.children().push(this); 306 parentRecord.children().push(this);
306 } 307 }
307 308
308 this._selfTime = this.endTime() - this.startTime(); 309 this._selfTime = this.endTime() - this.startTime();
309 310
310 var recordTypes = WebInspector.TimelineModel.RecordType; 311 var recordTypes = WebInspector.TimelineModel.RecordType;
311 switch (timelineEvent.type) { 312 switch (timelineEvent.type) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 416
416 /** 417 /**
417 * @return {number} 418 * @return {number}
418 */ 419 */
419 startTime: function() 420 startTime: function()
420 { 421 {
421 return this._record.startTime; 422 return this._record.startTime;
422 }, 423 },
423 424
424 /** 425 /**
425 * @return {string|undefined} 426 * @return {string}
426 */ 427 */
427 thread: function() 428 thread: function()
428 { 429 {
429 return this._record.thread; 430 return this._thread;
430 }, 431 },
431 432
432 /** 433 /**
433 * @return {number} 434 * @return {number}
434 */ 435 */
435 endTime: function() 436 endTime: function()
436 { 437 {
437 return this._endTime || this._record.endTime || this._record.startTime; 438 return this._endTime || this._record.endTime || this._record.startTime;
438 }, 439 },
439 440
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 break; 701 break;
701 length += itemLength; 702 length += itemLength;
702 data.push(item); 703 data.push(item);
703 ++this._recordIndex; 704 ++this._recordIndex;
704 } 705 }
705 if (this._recordIndex === this._payloads.length) 706 if (this._recordIndex === this._payloads.length)
706 data.push(data.pop() + "]"); 707 data.push(data.pop() + "]");
707 stream.write(data.join(separator), this._writeNextChunk.bind(this)); 708 stream.write(data.join(separator), this._writeNextChunk.bind(this));
708 } 709 }
709 } 710 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModel.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698