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 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 /** | 1812 /** |
1813 * @param {!TimelineModel.TimelineModel.PageFrame} frame | 1813 * @param {!TimelineModel.TimelineModel.PageFrame} frame |
1814 * @param {number=} trimAt | 1814 * @param {number=} trimAt |
1815 */ | 1815 */ |
1816 static displayNameForFrame(frame, trimAt) { | 1816 static displayNameForFrame(frame, trimAt) { |
1817 var url = frame.url; | 1817 var url = frame.url; |
1818 if (!trimAt) | 1818 if (!trimAt) |
1819 trimAt = 30; | 1819 trimAt = 30; |
1820 return url.startsWith('about:') ? `"${frame.name.trimMiddle(trimAt)}"` : fra
me.url.trimEnd(trimAt); | 1820 return url.startsWith('about:') ? `"${frame.name.trimMiddle(trimAt)}"` : fra
me.url.trimEnd(trimAt); |
1821 } | 1821 } |
| 1822 |
| 1823 /** |
| 1824 * @param {!SDK.FilmStripModel} filmStripModel |
| 1825 * @param {!TimelineModel.TimelineFrame} frame |
| 1826 * @return {?SDK.FilmStripModel.Frame} |
| 1827 */ |
| 1828 static filmStripModelFrame(filmStripModel, frame) { |
| 1829 var screenshotTime = frame.idle ? |
| 1830 frame.startTime : |
| 1831 frame.endTime; // For idle frames, look at the state at the beginning o
f the frame. |
| 1832 var filmStripFrame = filmStripModel.frameByTimestamp(screenshotTime); |
| 1833 if (filmStripFrame && filmStripFrame.timestamp - frame.endTime > 10) |
| 1834 filmStripFrame = null; |
| 1835 return filmStripFrame; |
| 1836 } |
1822 }; | 1837 }; |
1823 | 1838 |
1824 /** | 1839 /** |
1825 * @unrestricted | 1840 * @unrestricted |
1826 */ | 1841 */ |
1827 Timeline.TimelineRecordStyle = class { | 1842 Timeline.TimelineRecordStyle = class { |
1828 /** | 1843 /** |
1829 * @param {string} title | 1844 * @param {string} title |
1830 * @param {!Timeline.TimelineCategory} category | 1845 * @param {!Timeline.TimelineCategory} category |
1831 * @param {boolean=} hidden | 1846 * @param {boolean=} hidden |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 * @param {string=} warningType | 2310 * @param {string=} warningType |
2296 */ | 2311 */ |
2297 appendWarningRow(event, warningType) { | 2312 appendWarningRow(event, warningType) { |
2298 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); | 2313 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); |
2299 if (warning) | 2314 if (warning) |
2300 this.appendElementRow(Common.UIString('Warning'), warning, true); | 2315 this.appendElementRow(Common.UIString('Warning'), warning, true); |
2301 } | 2316 } |
2302 }; | 2317 }; |
2303 | 2318 |
2304 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo
wnCache'); | 2319 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo
wnCache'); |
OLD | NEW |