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 } | |
1837 }; | 1822 }; |
1838 | 1823 |
1839 /** | 1824 /** |
1840 * @unrestricted | 1825 * @unrestricted |
1841 */ | 1826 */ |
1842 Timeline.TimelineRecordStyle = class { | 1827 Timeline.TimelineRecordStyle = class { |
1843 /** | 1828 /** |
1844 * @param {string} title | 1829 * @param {string} title |
1845 * @param {!Timeline.TimelineCategory} category | 1830 * @param {!Timeline.TimelineCategory} category |
1846 * @param {boolean=} hidden | 1831 * @param {boolean=} hidden |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 * @param {string=} warningType | 2295 * @param {string=} warningType |
2311 */ | 2296 */ |
2312 appendWarningRow(event, warningType) { | 2297 appendWarningRow(event, warningType) { |
2313 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); | 2298 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); |
2314 if (warning) | 2299 if (warning) |
2315 this.appendElementRow(Common.UIString('Warning'), warning, true); | 2300 this.appendElementRow(Common.UIString('Warning'), warning, true); |
2316 } | 2301 } |
2317 }; | 2302 }; |
2318 | 2303 |
2319 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo
wnCache'); | 2304 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo
wnCache'); |
OLD | NEW |