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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js

Issue 1863883002: DevTools: Fix first paint screenshot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/components_lazy/FilmStripModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js
index 362b0c710146da0fb1f214de64d41eb1d4115735..c335527d8700d535a4f28edef2032a211a75d772 100644
--- a/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js
@@ -71,17 +71,8 @@ WebInspector.FilmStripModel.prototype = {
*/
frameByTimestamp: function(timestamp)
{
- /**
- * @param {number} timestamp
- * @param {!WebInspector.FilmStripModel.Frame} frame
- * @return {number}
- */
- function comparator(timestamp, frame)
- {
- return timestamp - frame.timestamp;
- }
- var index = this._frames.lowerBound(timestamp, comparator);
- return index < this._frames.length ? this._frames[index] : null;
+ var index = this._frames.upperBound(timestamp, (timestamp, frame) => timestamp - frame.timestamp) - 1;
+ return index >= 0 ? this._frames[index] : null;
}
}

Powered by Google App Engine
This is Rietveld 408576698