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

Unified Diff: third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698