Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @extends {WebInspector.SDKModel} | 8 * @extends {WebInspector.SDKModel} |
| 9 * @param {!WebInspector.Target} target | 9 * @param {!WebInspector.Target} target |
| 10 */ | 10 */ |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 888 | 888 |
| 889 WebInspector.AnimationModel.ScreenshotCapture.prototype = { | 889 WebInspector.AnimationModel.ScreenshotCapture.prototype = { |
| 890 /** | 890 /** |
| 891 * @param {number} duration | 891 * @param {number} duration |
| 892 * @param {!Array<string>} screenshots | 892 * @param {!Array<string>} screenshots |
| 893 */ | 893 */ |
| 894 captureScreenshots: function(duration, screenshots) | 894 captureScreenshots: function(duration, screenshots) |
| 895 { | 895 { |
| 896 var screencastDuration = Math.min(duration / this._model._playbackRate, 3000); | 896 var screencastDuration = Math.min(duration / this._model._playbackRate, 3000); |
| 897 var endTime = screencastDuration + window.performance.now(); | 897 var endTime = screencastDuration + window.performance.now(); |
| 898 this._requests.push({ endTime: endTime, screenshots: screenshots }); | 898 this._requests.push({ time: endTime, screenshots: screenshots }); |
|
lushnikov
2016/03/04 05:06:58
it should be endTime; the typedef is wrong.
kozy
2016/03/04 06:13:29
Done.
| |
| 899 | 899 |
| 900 if (!this._endTime || endTime > this._endTime) { | 900 if (!this._endTime || endTime > this._endTime) { |
| 901 clearTimeout(this._stopTimer); | 901 clearTimeout(this._stopTimer); |
| 902 this._stopTimer = setTimeout(this._stopScreencast.bind(this), screen castDuration); | 902 this._stopTimer = setTimeout(this._stopScreencast.bind(this), screen castDuration); |
| 903 this._endTime = endTime; | 903 this._endTime = endTime; |
| 904 } | 904 } |
| 905 | 905 |
| 906 if (this._capturing) | 906 if (this._capturing) |
| 907 return; | 907 return; |
| 908 this._capturing = true; | 908 this._capturing = true; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 938 if (!this._capturing) | 938 if (!this._capturing) |
| 939 return; | 939 return; |
| 940 | 940 |
| 941 delete this._stopTimer; | 941 delete this._stopTimer; |
| 942 delete this._endTime; | 942 delete this._endTime; |
| 943 this._requests = []; | 943 this._requests = []; |
| 944 this._capturing = false; | 944 this._capturing = false; |
| 945 this._target.pageAgent().stopScreencast(); | 945 this._target.pageAgent().stopScreencast(); |
| 946 } | 946 } |
| 947 } | 947 } |
| OLD | NEW |