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

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

Issue 645673004: DevTools: fix aggegated pie chart for JSFrame events on Timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.TimelineUIUtils} 7 * @extends {WebInspector.TimelineUIUtils}
8 */ 8 */
9 WebInspector.TracingTimelineUIUtils = function() 9 WebInspector.TracingTimelineUIUtils = function()
10 { 10 {
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 * @param {!WebInspector.TracingTimelineModel} model 524 * @param {!WebInspector.TracingTimelineModel} model
525 * @param {!WebInspector.Linkifier} linkifier 525 * @param {!WebInspector.Linkifier} linkifier
526 * @param {?WebInspector.DOMNode} relatedNode 526 * @param {?WebInspector.DOMNode} relatedNode
527 * @return {!DocumentFragment} 527 * @return {!DocumentFragment}
528 */ 528 */
529 WebInspector.TracingTimelineUIUtils._buildTraceEventDetailsSynchronously = funct ion(event, model, linkifier, relatedNode) 529 WebInspector.TracingTimelineUIUtils._buildTraceEventDetailsSynchronously = funct ion(event, model, linkifier, relatedNode)
530 { 530 {
531 var fragment = document.createDocumentFragment(); 531 var fragment = document.createDocumentFragment();
532 var stats = {}; 532 var stats = {};
533 var hasChildren = WebInspector.TracingTimelineUIUtils._aggregatedStatsForTra ceEvent(stats, model, event); 533 var hasChildren = WebInspector.TracingTimelineUIUtils._aggregatedStatsForTra ceEvent(stats, model, event);
534
535 var selfTime = event.selfTime;
536 var selfCategory = WebInspector.TracingTimelineUIUtils.eventStyle(event).cat egory;
537 // JSFrame events have 0 selfTime so we need to work around this below and a dd the event's time to scripting category.
538 if (event.name === WebInspector.TracingTimelineModel.RecordType.JSFrame && ! event.selfTime && event.duration) {
539 selfTime = event.duration;
540 for (var categoryName in stats)
541 selfTime -= stats[categoryName];
542 stats[selfCategory.name] = selfTime + (stats[selfCategory.name] || 0);
543 }
544
534 var pieChart = hasChildren ? 545 var pieChart = hasChildren ?
535 WebInspector.TimelineUIUtils.generatePieChart(stats, WebInspector.Tracin gTimelineUIUtils.eventStyle(event).category, event.selfTime) : 546 WebInspector.TimelineUIUtils.generatePieChart(stats, selfCategory, selfT ime) :
536 WebInspector.TimelineUIUtils.generatePieChart(stats); 547 WebInspector.TimelineUIUtils.generatePieChart(stats);
537 fragment.appendChild(pieChart); 548 fragment.appendChild(pieChart);
538 549
539 var recordTypes = WebInspector.TracingTimelineModel.RecordType; 550 var recordTypes = WebInspector.TracingTimelineModel.RecordType;
540 551
541 // This message may vary per event.name; 552 // This message may vary per event.name;
542 var relatedNodeLabel; 553 var relatedNodeLabel;
543 554
544 var contentHelper = new WebInspector.TimelineDetailsContentHelper(event.thre ad.target(), linkifier, true); 555 var contentHelper = new WebInspector.TimelineDetailsContentHelper(event.thre ad.target(), linkifier, true);
545 contentHelper.appendTextRow(WebInspector.UIString("Self Time"), Number.milli sToString(event.selfTime, true)); 556 contentHelper.appendTextRow(WebInspector.UIString("Self Time"), Number.milli sToString(event.selfTime, true));
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 return result; 846 return result;
836 } 847 }
837 848
838 /** 849 /**
839 * @return {!WebInspector.TracingTimelineModel.Filter} 850 * @return {!WebInspector.TracingTimelineModel.Filter}
840 */ 851 */
841 WebInspector.TracingTimelineUIUtils.hiddenEventsFilter = function() 852 WebInspector.TracingTimelineUIUtils.hiddenEventsFilter = function()
842 { 853 {
843 return new WebInspector.TracingTimelineModel.InclusiveEventNameFilter(WebIns pector.TracingTimelineUIUtils._visibleTypes()); 854 return new WebInspector.TracingTimelineModel.InclusiveEventNameFilter(WebIns pector.TracingTimelineUIUtils._visibleTypes());
844 } 855 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698