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..bd53a5f832c0ed3241bf1d0f541dccb03b9bbf0c 100644 |
--- a/Source/devtools/front_end/sdk/RuntimeModel.js |
+++ b/Source/devtools/front_end/sdk/RuntimeModel.js |
@@ -493,20 +493,36 @@ WebInspector.ExecutionContext.prototype = { |
/** |
* @constructor |
* @extends {WebInspector.SDKObject} |
+ * @param {!WebInspector.Target} target |
+ * @param {string} type |
+ * @param {boolean} useCapture |
+ * @param {!WebInspector.DebuggerModel.Location} location |
+ * @param {?WebInspector.RemoteObject} handler |
+ * @param {string} sourceName |
+ */ |
+WebInspector.EventListener = function(target, type, useCapture, location, handler, sourceName) |
+{ |
+ WebInspector.SDKObject.call(this, target); |
+ this._type = type; |
+ this._useCapture = useCapture; |
+ this._location = location; |
+ this._handler = handler; |
+ this._sourceName = sourceName; |
+} |
+ |
+/** |
* @param {!WebInspector.DebuggerModel} debuggerModel |
* @param {!DOMDebuggerAgent.EventListener} payload |
- * @param {!RuntimeAgent.RemoteObjectId} objectId |
+ * @return {!WebInspector.EventListener} |
*/ |
-WebInspector.EventListener = function(debuggerModel, payload, objectId) |
+WebInspector.EventListener.fromPayload = function(debuggerModel, payload) |
{ |
- 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 target = debuggerModel.target(); |
+ var location = WebInspector.DebuggerModel.Location.fromPayload(debuggerModel, payload.location); |
+ var handler = payload.handler ? target.runtimeModel.createRemoteObject(payload.handler) : null; |
var script = debuggerModel.scriptForId(payload.location.scriptId); |
- this._sourceName = script ? script.contentURL() : ""; |
- this._objectId = objectId; |
+ var sourceName = script ? script.contentURL() : ""; |
+ return new WebInspector.EventListener(target, payload.type, payload.useCapture, location, handler, sourceName); |
} |
WebInspector.EventListener.prototype = { |
@@ -550,13 +566,5 @@ WebInspector.EventListener.prototype = { |
return this._sourceName; |
}, |
- /** |
- * @return {!RuntimeAgent.RemoteObjectId} |
- */ |
- objectId: function() |
- { |
- return this._objectId; |
- }, |
- |
__proto__: WebInspector.SDKObject.prototype |
} |