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

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

Issue 337283004: Inline usages of TimelineUIUtils.categoryForRecord (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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 /** 84 /**
85 * @param {!WebInspector.TimelineModel.Record} record 85 * @param {!WebInspector.TimelineModel.Record} record
86 * @this {WebInspector.TimelineEventOverview} 86 * @this {WebInspector.TimelineEventOverview}
87 */ 87 */
88 function appendRecord(record) 88 function appendRecord(record)
89 { 89 {
90 if (record.type() === WebInspector.TimelineModel.RecordType.BeginFra me) 90 if (record.type() === WebInspector.TimelineModel.RecordType.BeginFra me)
91 return; 91 return;
92 var recordStart = Math.floor((record.startTime() - timeOffset) * sca le); 92 var recordStart = Math.floor((record.startTime() - timeOffset) * sca le);
93 var recordEnd = Math.ceil((record.endTime() - timeOffset) * scale); 93 var recordEnd = Math.ceil((record.endTime() - timeOffset) * scale);
94 var category = WebInspector.TimelineUIUtils.categoryForRecord(record ); 94 var category = record.category();
95 if (category.overviewStripGroupIndex < 0) 95 if (category.overviewStripGroupIndex < 0)
96 return; 96 return;
97 var bar = lastBarByGroup[category.overviewStripGroupIndex]; 97 var bar = lastBarByGroup[category.overviewStripGroupIndex];
98 // This bar may be merged with previous -- so just adjust the previo us bar. 98 // This bar may be merged with previous -- so just adjust the previo us bar.
99 if (bar) { 99 if (bar) {
100 // If record fits entirely into previous bar just absorb it igno ring the category match. 100 // If record fits entirely into previous bar just absorb it igno ring the category match.
101 if (recordEnd <= bar.end) 101 if (recordEnd <= bar.end)
102 return; 102 return;
103 if (bar.category === category && recordStart <= bar.end) { 103 if (bar.category === category && recordStart <= bar.end) {
104 bar.end = recordEnd; 104 bar.end = recordEnd;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 this._context.moveTo(0, 0); 145 this._context.moveTo(0, 0);
146 this._context.lineTo(width, 0); 146 this._context.lineTo(width, 0);
147 this._context.moveTo(0, WebInspector.TimelineEventOverview._stripGradien tHeight); 147 this._context.moveTo(0, WebInspector.TimelineEventOverview._stripGradien tHeight);
148 this._context.lineTo(width, WebInspector.TimelineEventOverview._stripGra dientHeight); 148 this._context.lineTo(width, WebInspector.TimelineEventOverview._stripGra dientHeight);
149 this._context.stroke(); 149 this._context.stroke();
150 this._context.restore(); 150 this._context.restore();
151 }, 151 },
152 152
153 __proto__: WebInspector.TimelineOverviewBase.prototype 153 __proto__: WebInspector.TimelineOverviewBase.prototype
154 } 154 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/timeline/timeline-script-tag-1.html ('k') | Source/devtools/front_end/timeline/TimelineFlameChart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698