InspectorDOMDebuggerAgent.h [plain text]
#ifndef InspectorDOMDebuggerAgent_h
#define InspectorDOMDebuggerAgent_h
#include "InspectorWebAgentBase.h"
#include <inspector/InspectorBackendDispatchers.h>
#include <inspector/agents/InspectorDebuggerAgent.h>
#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace Inspector {
class InspectorObject;
}
namespace WebCore {
class Element;
class InspectorDOMAgent;
class InstrumentingAgents;
class Node;
typedef String ErrorString;
class InspectorDOMDebuggerAgent final : public InspectorAgentBase, public Inspector::InspectorDebuggerAgent::Listener, public Inspector::DOMDebuggerBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
WTF_MAKE_FAST_ALLOCATED;
public:
InspectorDOMDebuggerAgent(InstrumentingAgents*, InspectorDOMAgent*, Inspector::InspectorDebuggerAgent*);
virtual ~InspectorDOMDebuggerAgent();
virtual void setXHRBreakpoint(ErrorString&, const String& url) override;
virtual void removeXHRBreakpoint(ErrorString&, const String& url) override;
virtual void setEventListenerBreakpoint(ErrorString&, const String& eventName) override;
virtual void removeEventListenerBreakpoint(ErrorString&, const String& eventName) override;
virtual void setInstrumentationBreakpoint(ErrorString&, const String& eventName) override;
virtual void removeInstrumentationBreakpoint(ErrorString&, const String& eventName) override;
virtual void setDOMBreakpoint(ErrorString&, int nodeId, const String& type) override;
virtual void removeDOMBreakpoint(ErrorString&, int nodeId, const String& type) override;
void willInsertDOMNode(Node& parent);
void didInvalidateStyleAttr(Node&);
void didInsertDOMNode(Node&);
void willRemoveDOMNode(Node&);
void didRemoveDOMNode(Node&);
void willModifyDOMAttr(Element&);
void willSendXMLHttpRequest(const String& url);
void pauseOnNativeEventIfNeeded(bool isDOMEvent, const String& eventName, bool synchronous);
virtual void didCreateFrontendAndBackend(Inspector::FrontendChannel*, Inspector::BackendDispatcher*) override;
virtual void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
virtual void discardAgent() override;
private:
virtual void debuggerWasEnabled() override;
virtual void debuggerWasDisabled() override;
virtual void stepInto() override;
virtual void didPause() override;
void disable();
void descriptionForDOMEvent(Node& target, int breakpointType, bool insertion, Inspector::InspectorObject& description);
void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set);
bool hasBreakpoint(Node*, int type);
void discardBindings();
void setBreakpoint(ErrorString&, const String& eventName);
void removeBreakpoint(ErrorString&, const String& eventName);
void clear();
InspectorDOMAgent* m_domAgent;
Inspector::InspectorDebuggerAgent* m_debuggerAgent;
RefPtr<Inspector::DOMDebuggerBackendDispatcher> m_backendDispatcher;
HashMap<Node*, uint32_t> m_domBreakpoints;
HashSet<String> m_eventListenerBreakpoints;
HashSet<String> m_xhrBreakpoints;
bool m_pauseInNextEventListener;
bool m_pauseOnAllXHRsEnabled;
};
}
#endif // !defined(InspectorDOMDebuggerAgent_h)