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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h

Issue 1950403002: Add the ability to return descedant event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits 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/core/inspector/InspectorDOMDebuggerAgent.h
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h
index fbab05da7efbcd1fd42ab9c2a017f147adce20a0..d7ebe1aaa0402eb9b7d4241f52472b546d78bba6 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h
@@ -52,12 +52,19 @@ namespace protocol {
class DictionaryValue;
}
+enum class EventListenerFilter : int {
+ ShowNothing = 0,
pfeldman 2016/05/27 21:54:01 We don't really need nothing as an option.
dtapuska 2016/05/27 22:10:53 It is mainly for comparison. Because this is an en
+ ShowDescendants = 1 << 0,
pfeldman 2016/05/27 21:54:01 These seem to be orthogonal to passive/blocking, w
dtapuska 2016/05/27 22:10:53 How do you indicate the default. Show me all passi
+ ShowPassive = 1 << 1,
+ ShowBlocking = 1 << 2,
+};
+
class CORE_EXPORT InspectorDOMDebuggerAgent final
: public InspectorBaseAgent<InspectorDOMDebuggerAgent, protocol::DOMDebugger::Frontend>
, public protocol::DOMDebugger::Backend {
WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
public:
- static void eventListenersInfoForTarget(v8::Isolate*, v8::Local<v8::Value>, V8EventListenerInfoList& listeners);
+ static void eventListenersInfoForTarget(v8::Isolate*, v8::Local<v8::Value>, EventListenerFilter filterMask, V8EventListenerInfoList& listeners);
InspectorDOMDebuggerAgent(v8::Isolate*, InspectorDOMAgent*, V8InspectorSession*);
~InspectorDOMDebuggerAgent() override;
@@ -72,7 +79,7 @@ public:
void removeInstrumentationBreakpoint(ErrorString*, const String& eventName) override;
void setXHRBreakpoint(ErrorString*, const String& url) override;
void removeXHRBreakpoint(ErrorString*, const String& url) override;
- void getEventListeners(ErrorString*, const String16& objectId, std::unique_ptr<protocol::Array<protocol::DOMDebugger::EventListener>>* listeners) override;
+ void getEventListeners(ErrorString*, const String16& objectId, const Maybe<bool>& inDescendants, std::unique_ptr<protocol::Array<protocol::DOMDebugger::EventListener>>* listeners) override;
// InspectorInstrumentation API
void willInsertDOMNode(Node* parent);
@@ -109,7 +116,7 @@ private:
void didRemoveBreakpoint();
void setEnabled(bool);
- void eventListeners(v8::Local<v8::Context>, v8::Local<v8::Value>, const String16& objectGroup, protocol::Array<protocol::DOMDebugger::EventListener>* listenersArray);
+ void eventListeners(v8::Local<v8::Context>, v8::Local<v8::Value>, const String16& objectGroup, EventListenerFilter filterMask, protocol::Array<protocol::DOMDebugger::EventListener>* listenersArray);
std::unique_ptr<protocol::DOMDebugger::EventListener> buildObjectForEventListener(v8::Local<v8::Context>, const V8EventListenerInfo&, const String16& objectGroupId);
v8::Isolate* m_isolate;
@@ -118,6 +125,32 @@ private:
HeapHashMap<Member<Node>, uint32_t> m_domBreakpoints;
};
+
+inline EventListenerFilter operator& (EventListenerFilter a, EventListenerFilter b)
+{
+ return static_cast<EventListenerFilter>(static_cast<int>(a) & static_cast<int>(b));
+}
+
+inline EventListenerFilter operator| (EventListenerFilter a, EventListenerFilter b)
+{
+ return static_cast<EventListenerFilter>(static_cast<int>(a) | static_cast<int>(b));
+}
+
+inline EventListenerFilter& operator|=(EventListenerFilter& a, EventListenerFilter b)
+{
+ return a = a | b;
+}
+
+inline EventListenerFilter& operator&=(EventListenerFilter& a, EventListenerFilter b)
+{
+ return a = a & b;
+}
+
+inline EventListenerFilter operator~(EventListenerFilter flags)
+{
+ return static_cast<EventListenerFilter>(~static_cast<int>(flags));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698