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

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

Issue 1042853004: [DevTools] Event Listeners Sidebar shows window listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed test Created 5 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: 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 d5bad7396aea8b3de55a72428f5ec9e37576a8e6..ffd6b0ad01b0aad56b48df7d326ddc3f982c6521 100644
--- a/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -488,3 +488,64 @@ WebInspector.ExecutionContext.prototype = {
__proto__: WebInspector.SDKObject.prototype
}
+
+/**
+ * @constructor
+ * @extends {WebInspector.SDKObject}
+ * @param {!WebInspector.Target} target
+ * @param {!RuntimeAgent.EventListener} payload
+ * @param {string} description
+ */
+WebInspector.RuntimeModel.EventListener = function(target, payload, description)
+{
+ WebInspector.SDKObject.call(this, target);
+ this._payload = payload;
+ var script = target.debuggerModel.scriptForId(payload.location.scriptId);
+ var sourceName = script ? script.contentURL() : "";
+ this._sourceName = sourceName;
+ this._description = description;
+}
+
+WebInspector.RuntimeModel.EventListener.prototype = {
+ /**
+ * @return {!RuntimeAgent.EventListener}
+ */
+ payload: function()
+ {
+ return this._payload;
+ },
+
+ /**
+ * @return {!WebInspector.DebuggerModel.Location}
+ */
+ location: function()
+ {
+ return WebInspector.DebuggerModel.Location.fromPayload(this.target(), this._payload.location);
+ },
+
+ /**
+ * @return {?WebInspector.RemoteObject}
+ */
+ handler: function()
+ {
+ return this._payload.handler ? this.target().runtimeModel.createRemoteObject(this._payload.handler) : null;
+ },
+
+ /**
+ * @return {string}
+ */
+ sourceName: function()
+ {
+ return this._sourceName;
+ },
+
+ /**
+ * @return {string}
+ */
+ description: function()
+ {
+ return this._description;
+ },
+
+ __proto__: WebInspector.SDKObject.prototype
+}

Powered by Google App Engine
This is Rietveld 408576698