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

Unified Diff: Source/devtools/front_end/RuntimeModel.js

Issue 185463010: DevTools: Introduce Target class which holds connection & models (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@gr-RuntimeAgent
Patch Set: Address aandrey's comments Created 6 years, 10 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: Source/devtools/front_end/RuntimeModel.js
diff --git a/Source/devtools/front_end/RuntimeModel.js b/Source/devtools/front_end/RuntimeModel.js
index 9c0a61f55719b33a442a5b41a3cc6198619fccf2..4bdacec26319aeb0523bf5f1767b815b64a6685f 100644
--- a/Source/devtools/front_end/RuntimeModel.js
+++ b/Source/devtools/front_end/RuntimeModel.js
@@ -31,17 +31,18 @@
/**
* @constructor
* @extends {WebInspector.Object}
- * @param {!WebInspector.ResourceTreeModel} resourceTreeModel
+ * @param {!WebInspector.Target} target
*/
-WebInspector.RuntimeModel = function(resourceTreeModel)
+WebInspector.RuntimeModel = function(target)
{
- this._agent = RuntimeAgent;
- this._debuggerModel = WebInspector.debuggerModel;
- resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameAdded, this._frameAdded, this);
- resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._frameNavigated, this);
- resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameDetached, this._frameDetached, this);
- resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._didLoadCachedResources, this);
+ this._agent = target.agent("Runtime");
+ this._debuggerModel = target.debuggerModel;
+ target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameAdded, this._frameAdded, this);
+ target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._frameNavigated, this);
+ target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameDetached, this._frameDetached, this);
+ target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._didLoadCachedResources, this);
this._frameIdToContextList = {};
+ target.registerDispatcher("Runtime", new WebInspector.RuntimeDispatcher(this));
}
WebInspector.RuntimeModel.Events = {
@@ -120,7 +121,6 @@ WebInspector.RuntimeModel.prototype = {
_didLoadCachedResources: function()
{
- InspectorBackend.registerRuntimeDispatcher(new WebInspector.RuntimeDispatcher(this));
this._agent.enable();
},

Powered by Google App Engine
This is Rietveld 408576698