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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 2852173002: DevTools: Show screenshots on the main flamechart (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
index 5da484d758321d4e8c14c68c93c39c0a4da17fac..1567c91bce59ad51aedef49893d184e50980c924 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
@@ -1820,6 +1820,21 @@ Timeline.TimelineUIUtils = class {
trimAt = 30;
return url.startsWith('about:') ? `"${frame.name.trimMiddle(trimAt)}"` : frame.url.trimEnd(trimAt);
}
+
+ /**
+ * @param {!SDK.FilmStripModel} filmStripModel
+ * @param {!TimelineModel.TimelineFrame} frame
+ * @return {?SDK.FilmStripModel.Frame}
+ */
+ 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.
+ var screenshotTime = frame.idle ?
+ frame.startTime :
+ frame.endTime; // For idle frames, look at the state at the beginning of the frame.
+ var filmStripFrame = filmStripModel.frameByTimestamp(screenshotTime);
+ if (filmStripFrame && filmStripFrame.timestamp - frame.endTime > 10)
+ filmStripFrame = null;
caseq 2017/05/01 22:13:35 nit: return null instead.
alph 2017/05/02 18:31:13 Done.
+ return filmStripFrame;
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698