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

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

Issue 2830343004: DevTools: Show screenshots on the main flamechart (Closed)
Patch Set: added comment 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fdec03b3872bb1c767eec4d1f111309447403811..3a8ec1a4f2c8cf94eeb89dc612a7b1c78dcfe773 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
@@ -1819,6 +1819,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) {
+ 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;
+ return filmStripFrame;
+ }
};
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698