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 4d4dcca0215b04030f4e0149b120f78ce3fab1ee..1f25a41642563b1539a84edf65ed056f5ba37b2a 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js |
| @@ -20,7 +20,9 @@ WebInspector.AnimationModel = function(target) |
| /** @type {!Array.<string>} */ |
| this._pendingAnimations = []; |
| this._playbackRate = 1; |
| - target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._reset, this); |
| + var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); |
| + if (resourceTreeModel) |
|
pfeldman
2016/07/07 17:44:13
No need in this check - we should either have both
eostroukhov-old
2016/07/13 23:30:58
To signify the dependency, I turned resourceTreeMo
|
| + resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._reset, this); |
| this._screenshotCapture = new WebInspector.AnimationModel.ScreenshotCapture(target, this); |
| } |
| @@ -883,7 +885,9 @@ WebInspector.AnimationModel.ScreenshotCapture = function(target, model) |
| this._target = target; |
| /** @type {!Array<!WebInspector.AnimationModel.ScreenshotCapture.Request>} */ |
| this._requests = []; |
| - this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame, this._screencastFrame, this); |
| + var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this._target); |
| + if (resourceTreeModel) |
|
pfeldman
2016/07/07 17:44:13
ditto
eostroukhov-old
2016/07/13 23:30:58
Done.
|
| + resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame, this._screencastFrame, this); |
| this._model = model; |
| this._model.addEventListener(WebInspector.AnimationModel.Events.ModelReset, this._stopScreencast, this); |
| } |