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

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

Issue 2782773002: [DevTools] Remove SDKModels' fromTarget methods (Closed)
Patch Set: addressed review comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Animation.AnimationModel = class extends SDK.SDKModel { 8 Animation.AnimationModel = class extends SDK.SDKModel {
9 /** 9 /**
10 * @param {!SDK.Target} target 10 * @param {!SDK.Target} target
11 */ 11 */
12 constructor(target) { 12 constructor(target) {
13 super(target); 13 super(target);
14 this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.Runt imeModel)); 14 this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.Runt imeModel));
15 this._agent = target.animationAgent(); 15 this._agent = target.animationAgent();
16 target.registerAnimationDispatcher(new Animation.AnimationDispatcher(this)); 16 target.registerAnimationDispatcher(new Animation.AnimationDispatcher(this));
17 /** @type {!Map.<string, !Animation.AnimationModel.Animation>} */ 17 /** @type {!Map.<string, !Animation.AnimationModel.Animation>} */
18 this._animationsById = new Map(); 18 this._animationsById = new Map();
19 /** @type {!Map.<string, !Animation.AnimationModel.AnimationGroup>} */ 19 /** @type {!Map.<string, !Animation.AnimationModel.AnimationGroup>} */
20 this._animationGroups = new Map(); 20 this._animationGroups = new Map();
21 /** @type {!Array.<string>} */ 21 /** @type {!Array.<string>} */
22 this._pendingAnimations = []; 22 this._pendingAnimations = [];
23 this._playbackRate = 1; 23 this._playbackRate = 1;
24 var resourceTreeModel = 24 var resourceTreeModel = /** @type {!SDK.ResourceTreeModel} */ (target.model( SDK.ResourceTreeModel));
25 /** @type {!SDK.ResourceTreeModel} */ (SDK.ResourceTreeModel.fromTarget( target));
26 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.MainFrameNav igated, this._reset, this); 25 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.MainFrameNav igated, this._reset, this);
27 var screenCaptureModel = target.model(SDK.ScreenCaptureModel); 26 var screenCaptureModel = target.model(SDK.ScreenCaptureModel);
28 if (screenCaptureModel) 27 if (screenCaptureModel)
29 this._screenshotCapture = new Animation.AnimationModel.ScreenshotCapture(t his, screenCaptureModel); 28 this._screenshotCapture = new Animation.AnimationModel.ScreenshotCapture(t his, screenCaptureModel);
30 } 29 }
31 30
32 _reset() { 31 _reset() {
33 this._animationsById.clear(); 32 this._animationsById.clear();
34 this._animationGroups.clear(); 33 this._animationGroups.clear();
35 this._pendingAnimations = []; 34 this._pendingAnimations = [];
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 delete this._stopTimer; 835 delete this._stopTimer;
837 delete this._endTime; 836 delete this._endTime;
838 this._requests = []; 837 this._requests = [];
839 this._capturing = false; 838 this._capturing = false;
840 this._screenCaptureModel.stopScreencast(); 839 this._screenCaptureModel.stopScreencast();
841 } 840 }
842 }; 841 };
843 842
844 /** @typedef {{ endTime: number, screenshots: !Array.<string>}} */ 843 /** @typedef {{ endTime: number, screenshots: !Array.<string>}} */
845 Animation.AnimationModel.ScreenshotCapture.Request; 844 Animation.AnimationModel.ScreenshotCapture.Request;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698