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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 1879293002: Modify devtools to show passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
index ee26d3735b37fbe723500f1b0bbccf12585fa259..88b82108f2d2c65e9f760baa3eca96ea232b8056 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
@@ -1393,10 +1393,34 @@ CommandLineAPIImpl.prototype = {
var result = nullifyObjectProto(InjectedScriptHost.getEventListeners(node));
if (!result)
return;
- /** @this {{type: string, listener: function(), useCapture: boolean}} */
+
+ // TODO(dtapuska): Remove this one closure compiler is updated
+ // to handle EventListenerOptions and passive event listeners
+ // has shipped. Don't JSDoc these otherwise it will fail.
+ // @param {boolean} capture
+ // @param {boolean} passive
+ // @return {boolean|undefined|{capture: (boolean|undefined), passive: boolean}}
+ function eventListenerOptions(capture, passive)
+ {
+ return {"capture": capture, "passive": passive};
+ }
+
+ /**
+ * @param {!Node} node
+ * @param {string} type
+ * @param {function()} listener
+ * @param {boolean} capture
+ * @param {boolean} passive
+ */
+ function removeEventListenerWrapper(node, type, listener, capture, passive)
+ {
+ node.removeEventListener(type, listener, eventListenerOptions(capture, passive));
+ }
+
+ /** @this {{type: string, listener: function(), useCapture: boolean, passive: boolean}} */
var removeFunc = function()
{
- node.removeEventListener(this.type, this.listener, this.useCapture);
+ removeEventListenerWrapper(node, this.type, this.listener, this.useCapture, this.passive);
}
for (var type in result) {
var listeners = result[type];

Powered by Google App Engine
This is Rietveld 408576698