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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
index 41688edbbefad50b5304eae34b1f06c755c811dc..98aafc0fc1ebd6c1af90b1152c7e96f5c7f9ad80 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
@@ -34,20 +34,21 @@
SDK.CSSModel = class extends SDK.SDKModel {
/**
* @param {!SDK.Target} target
+ * @param {!Protocol.Dispatcher} dispatcher
*/
- constructor(target) {
- super(target);
+ constructor(target, dispatcher) {
+ super(target, dispatcher);
this._domModel = /** @type {!SDK.DOMModel} */ (target.model(SDK.DOMModel));
/** @type {!SDK.SourceMapManager<!SDK.CSSStyleSheetHeader>} */
this._sourceMapManager = new SDK.SourceMapManager(target);
- this._agent = target.cssAgent();
+ this._agent = dispatcher.cssAgent();
this._styleLoader = new SDK.CSSModel.ComputedStyleLoader(this);
this._resourceTreeModel = target.model(SDK.ResourceTreeModel);
if (this._resourceTreeModel) {
this._resourceTreeModel.addEventListener(
SDK.ResourceTreeModel.Events.MainFrameNavigated, this._resetStyleSheets, this);
}
- target.registerCSSDispatcher(new SDK.CSSDispatcher(this));
+ dispatcher.registerCSSDispatcher(new SDK.CSSDispatcher(this));
this._agent.enable().then(this._wasEnabled.bind(this));
/** @type {!Map.<string, !SDK.CSSStyleSheetHeader>} */
this._styleSheetIdToHeader = new Map();

Powered by Google App Engine
This is Rietveld 408576698