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

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

Issue 339493005: Move more methods into implementation specific timeline UI utils (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
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 * @param {!WebInspector.TracingModel} tracingModel 6 * @param {!WebInspector.TracingModel} tracingModel
7 * @constructor 7 * @constructor
8 * @extends {WebInspector.TimelineModel} 8 * @extends {WebInspector.TimelineModel}
9 */ 9 */
10 WebInspector.TracingTimelineModel = function(tracingModel) 10 WebInspector.TracingTimelineModel = function(tracingModel)
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 _findAncestorEvent: function(name) 456 _findAncestorEvent: function(name)
457 { 457 {
458 for (var i = this._eventStack.length - 1; i >= 0; --i) { 458 for (var i = this._eventStack.length - 1; i >= 0; --i) {
459 var event = this._eventStack[i]; 459 var event = this._eventStack[i];
460 if (event.name === name) 460 if (event.name === name)
461 return event; 461 return event;
462 } 462 }
463 return null; 463 return null;
464 }, 464 },
465 465
466 /**
467 * @param {!WebInspector.TimelineModel.Record} record
468 * @return {!WebInspector.TracingModel.Event}
469 */
470 traceEventFrom: function(record)
471 {
472 if (!(record instanceof WebInspector.TracingTimelineModel.TraceEventReco rd))
473 throw new Error("Illegal argument.");
474 return record._event;
475 },
476
477 __proto__: WebInspector.TimelineModel.prototype 466 __proto__: WebInspector.TimelineModel.prototype
478 } 467 }
479 468
480 /** 469 /**
481 * @constructor 470 * @constructor
482 * @implements {WebInspector.TimelineModel.Record} 471 * @implements {WebInspector.TimelineModel.Record}
483 * @param {!WebInspector.TimelineModel} model 472 * @param {!WebInspector.TimelineModel} model
484 * @param {!WebInspector.TracingModel.Event} traceEvent 473 * @param {!WebInspector.TracingModel.Event} traceEvent
485 * @param {?WebInspector.TracingTimelineModel.TraceEventRecord} parentRecord 474 * @param {?WebInspector.TracingTimelineModel.TraceEventRecord} parentRecord
486 */ 475 */
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 children: function() 526 children: function()
538 { 527 {
539 return this._children; 528 return this._children;
540 }, 529 },
541 530
542 /** 531 /**
543 * @return {!WebInspector.TimelineCategory} 532 * @return {!WebInspector.TimelineCategory}
544 */ 533 */
545 category: function() 534 category: function()
546 { 535 {
547 var style = WebInspector.TimelineUIUtils.styleForTimelineEvent(this._eve nt.name); 536 var style = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(this. _event.name);
548 return style.category; 537 return style.category;
549 }, 538 },
550 539
551 /** 540 /**
552 * @return {string} 541 * @return {string}
553 */ 542 */
554 title: function() 543 title: function()
555 { 544 {
556 return WebInspector.TimelineUIUtils.recordTitle(this, this._model); 545 return WebInspector.TracingTimelineUIUtils.styleForTraceEvent(this._even t.name).title;
557 }, 546 },
558 547
559 /** 548 /**
560 * @return {number} 549 * @return {number}
561 */ 550 */
562 startTime: function() 551 startTime: function()
563 { 552 {
564 return this._event.startTime; 553 return this._event.startTime;
565 }, 554 },
566 555
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 }, 675 },
687 676
688 /** 677 /**
689 * @return {!WebInspector.TracingModel.Event} 678 * @return {!WebInspector.TracingModel.Event}
690 */ 679 */
691 traceEvent: function() 680 traceEvent: function()
692 { 681 {
693 return this._event; 682 return this._event;
694 } 683 }
695 } 684 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineView.js ('k') | Source/devtools/front_end/timeline/TracingTimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698