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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The Chromium Authors. All rights reserved. 2 * Copyright 2015 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * @constructor 8 * @constructor
9 * @param {!WebInspector.TracingModel} tracingModel 9 * @param {!WebInspector.TracingModel} tracingModel
10 * @param {number=} zeroTime 10 * @param {number=} zeroTime
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 { 64 {
65 return this._zeroTime; 65 return this._zeroTime;
66 }, 66 },
67 67
68 /** 68 /**
69 * @param {number} timestamp 69 * @param {number} timestamp
70 * @return {?WebInspector.FilmStripModel.Frame} 70 * @return {?WebInspector.FilmStripModel.Frame}
71 */ 71 */
72 frameByTimestamp: function(timestamp) 72 frameByTimestamp: function(timestamp)
73 { 73 {
74 /** 74 var index = this._frames.upperBound(timestamp, (timestamp, frame) => tim estamp - frame.timestamp) - 1;
75 * @param {number} timestamp 75 return index >= 0 ? this._frames[index] : null;
76 * @param {!WebInspector.FilmStripModel.Frame} frame
77 * @return {number}
78 */
79 function comparator(timestamp, frame)
80 {
81 return timestamp - frame.timestamp;
82 }
83 var index = this._frames.lowerBound(timestamp, comparator);
84 return index < this._frames.length ? this._frames[index] : null;
85 } 76 }
86 } 77 }
87 78
88 /** 79 /**
89 * @constructor 80 * @constructor
90 * @param {!WebInspector.FilmStripModel} model 81 * @param {!WebInspector.FilmStripModel} model
91 * @param {number} timestamp 82 * @param {number} timestamp
92 * @param {number} index 83 * @param {number} index
93 */ 84 */
94 WebInspector.FilmStripModel.Frame = function(model, timestamp, index) 85 WebInspector.FilmStripModel.Frame = function(model, timestamp, index)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 * @return {!Promise<?string>} 132 * @return {!Promise<?string>}
142 */ 133 */
143 imageDataPromise: function() 134 imageDataPromise: function()
144 { 135 {
145 if (this._imageData || !this._snapshot) 136 if (this._imageData || !this._snapshot)
146 return Promise.resolve(this._imageData); 137 return Promise.resolve(this._imageData);
147 138
148 return /** @type {!Promise<?string>} */ (this._snapshot.objectPromise()) ; 139 return /** @type {!Promise<?string>} */ (this._snapshot.objectPromise()) ;
149 } 140 }
150 } 141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698