Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1813 /** | 1813 /** |
| 1814 * @param {!TimelineModel.TimelineModel.PageFrame} frame | 1814 * @param {!TimelineModel.TimelineModel.PageFrame} frame |
| 1815 * @param {number=} trimAt | 1815 * @param {number=} trimAt |
| 1816 */ | 1816 */ |
| 1817 static displayNameForFrame(frame, trimAt) { | 1817 static displayNameForFrame(frame, trimAt) { |
| 1818 var url = frame.url; | 1818 var url = frame.url; |
| 1819 if (!trimAt) | 1819 if (!trimAt) |
| 1820 trimAt = 30; | 1820 trimAt = 30; |
| 1821 return url.startsWith('about:') ? `"${frame.name.trimMiddle(trimAt)}"` : fra me.url.trimEnd(trimAt); | 1821 return url.startsWith('about:') ? `"${frame.name.trimMiddle(trimAt)}"` : fra me.url.trimEnd(trimAt); |
| 1822 } | 1822 } |
| 1823 | |
| 1824 /** | |
| 1825 * @param {!SDK.FilmStripModel} filmStripModel | |
| 1826 * @param {!TimelineModel.TimelineFrame} frame | |
| 1827 * @return {?SDK.FilmStripModel.Frame} | |
| 1828 */ | |
| 1829 static filmStripModelFrame(filmStripModel, frame) { | |
|
caseq
2017/05/01 22:13:35
Let's rather move it to PerformanceModel, it does
alph
2017/05/02 18:31:13
Done.
| |
| 1830 var screenshotTime = frame.idle ? | |
| 1831 frame.startTime : | |
| 1832 frame.endTime; // For idle frames, look at the state at the beginning o f the frame. | |
| 1833 var filmStripFrame = filmStripModel.frameByTimestamp(screenshotTime); | |
| 1834 if (filmStripFrame && filmStripFrame.timestamp - frame.endTime > 10) | |
| 1835 filmStripFrame = null; | |
|
caseq
2017/05/01 22:13:35
nit: return null instead.
alph
2017/05/02 18:31:13
Done.
| |
| 1836 return filmStripFrame; | |
| 1837 } | |
| 1823 }; | 1838 }; |
| 1824 | 1839 |
| 1825 /** | 1840 /** |
| 1826 * @unrestricted | 1841 * @unrestricted |
| 1827 */ | 1842 */ |
| 1828 Timeline.TimelineRecordStyle = class { | 1843 Timeline.TimelineRecordStyle = class { |
| 1829 /** | 1844 /** |
| 1830 * @param {string} title | 1845 * @param {string} title |
| 1831 * @param {!Timeline.TimelineCategory} category | 1846 * @param {!Timeline.TimelineCategory} category |
| 1832 * @param {boolean=} hidden | 1847 * @param {boolean=} hidden |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2296 * @param {string=} warningType | 2311 * @param {string=} warningType |
| 2297 */ | 2312 */ |
| 2298 appendWarningRow(event, warningType) { | 2313 appendWarningRow(event, warningType) { |
| 2299 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); | 2314 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); |
| 2300 if (warning) | 2315 if (warning) |
| 2301 this.appendElementRow(Common.UIString('Warning'), warning, true); | 2316 this.appendElementRow(Common.UIString('Warning'), warning, true); |
| 2302 } | 2317 } |
| 2303 }; | 2318 }; |
| 2304 | 2319 |
| 2305 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache'); | 2320 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache'); |
| OLD | NEW |