| 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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 /** | 764 /** |
| 765 * @param {?Protocol.Error} error | 765 * @param {?Protocol.Error} error |
| 766 * @param {number} currentTime | 766 * @param {number} currentTime |
| 767 * @return {number} | 767 * @return {number} |
| 768 */ | 768 */ |
| 769 function callback(error, currentTime) | 769 function callback(error, currentTime) |
| 770 { | 770 { |
| 771 return !error ? currentTime : 0; | 771 return !error ? currentTime : 0; |
| 772 } | 772 } |
| 773 | 773 |
| 774 return this.target().animationAgent().getCurrentTime(this._animations[0]
.id(), callback).catchException(0); | 774 var longestAnim = null; |
| 775 for (var anim of this._animations) { |
| 776 if (!longestAnim || anim.endTime() > longestAnim.endTime()) |
| 777 longestAnim = anim; |
| 778 } |
| 779 return this.target().animationAgent().getCurrentTime(longestAnim.id(), c
allback).catchException(0); |
| 775 }, | 780 }, |
| 776 | 781 |
| 777 /** | 782 /** |
| 778 * @param {!WebInspector.AnimationModel.AnimationGroup} group | 783 * @param {!WebInspector.AnimationModel.AnimationGroup} group |
| 779 * @return {boolean} | 784 * @return {boolean} |
| 780 */ | 785 */ |
| 781 _matches: function(group) | 786 _matches: function(group) |
| 782 { | 787 { |
| 783 /** | 788 /** |
| 784 * @param {!WebInspector.AnimationModel.Animation} anim | 789 * @param {!WebInspector.AnimationModel.Animation} anim |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 if (!this._capturing) | 943 if (!this._capturing) |
| 939 return; | 944 return; |
| 940 | 945 |
| 941 delete this._stopTimer; | 946 delete this._stopTimer; |
| 942 delete this._endTime; | 947 delete this._endTime; |
| 943 this._requests = []; | 948 this._requests = []; |
| 944 this._capturing = false; | 949 this._capturing = false; |
| 945 this._target.pageAgent().stopScreencast(); | 950 this._target.pageAgent().stopScreencast(); |
| 946 } | 951 } |
| 947 } | 952 } |
| OLD | NEW |