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

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

Issue 1999843002: [DevTools] Move CommandLineAPI.getEventListeners to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-monitor-events-to-native
Patch Set: Created 4 years, 7 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 326dbd4d3e2e66cbdc098c135c41f611cc4635af..4049efee566ef8908d7e3e01b8a68d57c51f5810 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
@@ -521,17 +521,6 @@ InjectedScript.prototype = {
},
/**
- * @param {!Object} nativeCommandLineAPI
- * @return {!Object}
- */
- installCommandLineAPI: function(nativeCommandLineAPI)
- {
- // NOTE: This list contains only not native Command Line API methods. For full list: V8Console.
- nativeCommandLineAPI["getEventListeners"] = CommandLineAPIImpl["getEventListeners"];
- return nativeCommandLineAPI;
- },
-
- /**
* @param {*} object
* @return {boolean}
*/
@@ -1017,57 +1006,5 @@ InjectedScript.RemoteObject.prototype = {
__proto__: null
}
-var CommandLineAPIImpl = { __proto__: null }
-
-/**
- * @param {!Node} node
- * @return {!Object|undefined}
- */
-CommandLineAPIImpl.getEventListeners = function(node)
-{
- var result = nullifyObjectProto(InjectedScriptHost.getEventListeners(node));
- if (!result)
- return;
-
- // 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()
- {
- removeEventListenerWrapper(node, this.type, this.listener, this.useCapture, this.passive);
- }
- for (var type in result) {
- var listeners = result[type];
- for (var i = 0, listener; listener = listeners[i]; ++i) {
- listener["type"] = type;
- listener["remove"] = removeFunc;
- }
- }
- return result;
-}
-
-CommandLineAPIImpl.getEventListeners.toString = (() => "function getEventListeners(node) { [Command Line API] }");
-
return injectedScript;
})

Powered by Google App Engine
This is Rietveld 408576698