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

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: Comments Created 4 years, 4 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 5d6bbb1b70fb20bf59bf9b1fc65fc3781b42fd12..9ec9ac2d2691b092a24ff4b78399d4b9c3dc2411 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);
}
/** @enum {symbol} */
@@ -872,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);
}

Powered by Google App Engine
This is Rietveld 408576698