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

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

Issue 1268353005: [DevTools] Support JQuery event listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implemented in frontend code 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
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
}

Powered by Google App Engine
This is Rietveld 408576698