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

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

Issue 1319613002: [DevTools] Refactor WebInspector.EventListener (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « Source/devtools/front_end/sdk/RemoteObject.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/RuntimeModel.js
diff --git a/Source/devtools/front_end/sdk/RuntimeModel.js b/Source/devtools/front_end/sdk/RuntimeModel.js
index 4bdbb8e3b33c24102ec0c978db5d9ed71ba0b85e..1a51bfa14bfc4cecc1c7665cca64c7252bf031b2 100644
--- a/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -493,20 +493,20 @@ WebInspector.ExecutionContext.prototype = {
/**
* @constructor
* @extends {WebInspector.SDKObject}
- * @param {!WebInspector.DebuggerModel} debuggerModel
- * @param {!DOMDebuggerAgent.EventListener} payload
- * @param {!RuntimeAgent.RemoteObjectId} objectId
+ * @param {!WebInspector.Target} target
+ * @param {string} type
+ * @param {boolean} useCapture
+ * @param {?WebInspector.RemoteObject} handler
+ * @param {!WebInspector.DebuggerModel.Location} location
*/
-WebInspector.EventListener = function(debuggerModel, payload, objectId)
+WebInspector.EventListener = function(target, type, useCapture, handler, location)
{
- WebInspector.SDKObject.call(this, debuggerModel.target());
- this._type = payload.type;
- this._useCapture = payload.useCapture;
- this._location = WebInspector.DebuggerModel.Location.fromPayload(debuggerModel, payload.location);
- this._handler = payload.handler ? this.target().runtimeModel.createRemoteObject(payload.handler) : null;
- var script = debuggerModel.scriptForId(payload.location.scriptId);
- this._sourceName = script ? script.contentURL() : "";
- this._objectId = objectId;
+ WebInspector.SDKObject.call(this, target);
+ this._type = type;
+ this._useCapture = useCapture;
+ this._handler = handler;
+ this._location = location;
+ this._sourceURL = location.script().contentURL();
}
WebInspector.EventListener.prototype = {
@@ -527,14 +527,6 @@ WebInspector.EventListener.prototype = {
},
/**
- * @return {!WebInspector.DebuggerModel.Location}
- */
- location: function()
- {
- return this._location;
- },
-
- /**
* @return {?WebInspector.RemoteObject}
*/
handler: function()
@@ -543,20 +535,20 @@ WebInspector.EventListener.prototype = {
},
/**
- * @return {string}
+ * @return {!WebInspector.DebuggerModel.Location}
*/
- sourceName: function()
+ location: function()
{
- return this._sourceName;
+ return this._location;
},
/**
- * @return {!RuntimeAgent.RemoteObjectId}
+ * @return {string}
*/
- objectId: function()
- {
- return this._objectId;
- },
+ sourceURL: function()
+ {
+ return this._sourceURL;
+ },
__proto__: WebInspector.SDKObject.prototype
}
« no previous file with comments | « Source/devtools/front_end/sdk/RemoteObject.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698