Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js |
| index 1c49a82014b32542c710a7a77956ac365a5d4d48..102060d05675613022957e79d7a691dc2f6f040b 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js |
| @@ -20,8 +20,9 @@ WebInspector.AnimationModel = function(target) |
| /** @type {!Array.<string>} */ |
| this._pendingAnimations = []; |
| this._playbackRate = 1; |
| - target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._reset, this); |
| - this._screenshotCapture = new WebInspector.AnimationModel.ScreenshotCapture(target, this); |
| + var resourceTreeModel = /** @type {!WebInspector.ResourceTreeModel} */ (WebInspector.ResourceTreeModel.fromTarget(target)); |
| + resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._reset, this); |
| + this._screenshotCapture = new WebInspector.AnimationModel.ScreenshotCapture(target, this, resourceTreeModel); |
| } |
| WebInspector.AnimationModel.Events = { |
| @@ -208,8 +209,9 @@ WebInspector.AnimationModel.fromTarget = function(target) |
| { |
| if (!target.hasDOMCapability()) |
| return null; |
| - if (!target[WebInspector.AnimationModel._symbol]) |
| + if (!target[WebInspector.AnimationModel._symbol]) { |
|
dgozman
2016/08/19 20:23:37
style: unnecessary {}
eostroukhov
2016/08/20 01:22:30
Done.
|
| target[WebInspector.AnimationModel._symbol] = new WebInspector.AnimationModel(target); |
| + } |
| return target[WebInspector.AnimationModel._symbol]; |
| } |
| @@ -871,13 +873,14 @@ WebInspector.AnimationDispatcher.prototype = { |
| * @constructor |
| * @param {!WebInspector.Target} target |
| * @param {!WebInspector.AnimationModel} model |
| + * @param {!WebInspector.ResourceTreeModel} resourceTreeModel |
| */ |
| -WebInspector.AnimationModel.ScreenshotCapture = function(target, model) |
| +WebInspector.AnimationModel.ScreenshotCapture = function(target, model, resourceTreeModel) |
| { |
| this._target = target; |
| /** @type {!Array<!WebInspector.AnimationModel.ScreenshotCapture.Request>} */ |
| this._requests = []; |
| - this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame, this._screencastFrame, this); |
| + resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame, this._screencastFrame, this); |
| this._model = model; |
| this._model.addEventListener(WebInspector.AnimationModel.Events.ModelReset, this._stopScreencast, this); |
| } |