| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include <wtf/PassOwnPtr.h> | 38 #include <wtf/PassOwnPtr.h> |
| 39 #include <wtf/RefCounted.h> | 39 #include <wtf/RefCounted.h> |
| 40 #include <wtf/text/WTFString.h> | 40 #include <wtf/text/WTFString.h> |
| 41 | 41 |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 class Document; | 44 class Document; |
| 45 class Element; | 45 class Element; |
| 46 class Event; | 46 class Event; |
| 47 class InspectorDOMAgent; | 47 class InspectorDOMAgent; |
| 48 class InspectorDOMController; |
| 48 class InspectorDebuggerAgent; | 49 class InspectorDebuggerAgent; |
| 49 class InspectorFrontend; | 50 class InspectorFrontend; |
| 50 class InspectorObject; | 51 class InspectorObject; |
| 51 class InspectorState; | 52 class InspectorState; |
| 52 class InstrumentingAgents; | 53 class InstrumentingAgents; |
| 53 class Node; | 54 class Node; |
| 54 | 55 |
| 55 typedef String ErrorString; | 56 typedef String ErrorString; |
| 56 | 57 |
| 57 class InspectorDOMDebuggerAgent : public InspectorBaseAgent<InspectorDOMDebugger
Agent>, public InspectorDebuggerAgent::Listener, public InspectorBackendDispatch
er::DOMDebuggerCommandHandler { | 58 class InspectorDOMDebuggerAgent : public InspectorBaseAgent, public InspectorDeb
uggerAgent::Listener, public InspectorBackendDispatcher::DOMDebuggerCommandHandl
er { |
| 58 WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent); | 59 WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent); |
| 59 public: | 60 public: |
| 60 static PassOwnPtr<InspectorDOMDebuggerAgent> create(InstrumentingAgents*, In
spectorCompositeState*, InspectorDOMAgent*, InspectorDebuggerAgent*); | 61 static PassRefPtr<InspectorDOMDebuggerAgent> create(InstrumentingAgents*, In
spectorState*, PassRefPtr<InspectorDOMAgent>, PassRefPtr<InspectorDebuggerAgent>
); |
| 61 | 62 |
| 62 virtual ~InspectorDOMDebuggerAgent(); | 63 virtual ~InspectorDOMDebuggerAgent(); |
| 63 | 64 |
| 64 // DOMDebugger API for InspectorFrontend | 65 // DOMDebugger API for InspectorFrontend |
| 65 virtual void setXHRBreakpoint(ErrorString*, const String& url); | 66 virtual void setXHRBreakpoint(ErrorString*, const String& url); |
| 66 virtual void removeXHRBreakpoint(ErrorString*, const String& url); | 67 virtual void removeXHRBreakpoint(ErrorString*, const String& url); |
| 67 virtual void setEventListenerBreakpoint(ErrorString*, const String& eventNam
e); | 68 virtual void setEventListenerBreakpoint(ErrorString*, const String& eventNam
e); |
| 68 virtual void removeEventListenerBreakpoint(ErrorString*, const String& event
Name); | 69 virtual void removeEventListenerBreakpoint(ErrorString*, const String& event
Name); |
| 69 virtual void setInstrumentationBreakpoint(ErrorString*, const String& eventN
ame); | 70 virtual void setInstrumentationBreakpoint(ErrorString*, const String& eventN
ame); |
| 70 virtual void removeInstrumentationBreakpoint(ErrorString*, const String& eve
ntName); | 71 virtual void removeInstrumentationBreakpoint(ErrorString*, const String& eve
ntName); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 87 void willFireAnimationFrame(Document*, int callbackId); | 88 void willFireAnimationFrame(Document*, int callbackId); |
| 88 void willHandleEvent(Event*); | 89 void willHandleEvent(Event*); |
| 89 void didFireWebGLError(const String& errorName); | 90 void didFireWebGLError(const String& errorName); |
| 90 | 91 |
| 91 void didProcessTask(); | 92 void didProcessTask(); |
| 92 | 93 |
| 93 virtual void clearFrontend(); | 94 virtual void clearFrontend(); |
| 94 virtual void discardAgent(); | 95 virtual void discardAgent(); |
| 95 | 96 |
| 96 private: | 97 private: |
| 97 InspectorDOMDebuggerAgent(InstrumentingAgents*, InspectorCompositeState*, In
spectorDOMAgent*, InspectorDebuggerAgent*); | 98 InspectorDOMDebuggerAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<
InspectorDOMAgent>, PassRefPtr<InspectorDebuggerAgent>); |
| 98 | 99 |
| 99 void pauseOnNativeEventIfNeeded(PassRefPtr<InspectorObject> eventData, bool
synchronous); | 100 void pauseOnNativeEventIfNeeded(PassRefPtr<InspectorObject> eventData, bool
synchronous); |
| 100 PassRefPtr<InspectorObject> preparePauseOnNativeEventData(bool isDOMEvent, c
onst String& eventName); | 101 PassRefPtr<InspectorObject> preparePauseOnNativeEventData(bool isDOMEvent, c
onst String& eventName); |
| 101 | 102 |
| 102 // InspectorDebuggerAgent::Listener implementation. | 103 // InspectorDebuggerAgent::Listener implementation. |
| 103 virtual void debuggerWasEnabled(); | 104 virtual void debuggerWasEnabled(); |
| 104 virtual void debuggerWasDisabled(); | 105 virtual void debuggerWasDisabled(); |
| 105 virtual void stepInto(); | 106 virtual void stepInto(); |
| 106 virtual void didPause(); | 107 virtual void didPause(); |
| 107 void disable(); | 108 void disable(); |
| 108 | 109 |
| 109 void descriptionForDOMEvent(Node* target, int breakpointType, bool insertion
, InspectorObject* description); | 110 void descriptionForDOMEvent(Node* target, int breakpointType, bool insertion
, InspectorObject* description); |
| 110 void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set); | 111 void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set); |
| 111 bool hasBreakpoint(Node*, int type); | 112 bool hasBreakpoint(Node*, int type); |
| 112 void discardBindings(); | 113 void discardBindings(); |
| 113 void setBreakpoint(ErrorString*, const String& eventName); | 114 void setBreakpoint(ErrorString*, const String& eventName); |
| 114 void removeBreakpoint(ErrorString*, const String& eventName); | 115 void removeBreakpoint(ErrorString*, const String& eventName); |
| 115 | 116 |
| 116 void clear(); | 117 void clear(); |
| 117 | 118 |
| 118 InspectorDOMAgent* m_domAgent; | 119 RefPtr<InspectorDOMAgent> m_domAgent; |
| 119 InspectorDebuggerAgent* m_debuggerAgent; | 120 RefPtr<InspectorDebuggerAgent> m_debuggerAgent; |
| 120 HashMap<Node*, uint32_t> m_domBreakpoints; | 121 HashMap<Node*, uint32_t> m_domBreakpoints; |
| 121 bool m_pauseInNextEventListener; | 122 bool m_pauseInNextEventListener; |
| 122 }; | 123 }; |
| 123 | 124 |
| 125 class InspectorDOMDebuggerController: public InspectorBaseController<InspectorDO
MDebuggerController, InspectorDOMDebuggerAgent> { |
| 126 public: |
| 127 |
| 128 static PassOwnPtr<InspectorDOMDebuggerController> create(InstrumentingAgents
* instrumentingAgents, InspectorCompositeState* compositeState, InspectorDOMCont
roller* domController, InspectorDebuggerController * debuggerController) |
| 129 { |
| 130 return adoptPtr(new InspectorDOMDebuggerController(instrumentingAgents,
compositeState, domController, debuggerController)); |
| 131 } |
| 132 |
| 133 protected: |
| 134 InspectorDOMDebuggerController(InstrumentingAgents*, InspectorCompositeState
*, InspectorDOMController*, InspectorDebuggerController*); |
| 135 }; |
| 136 |
| 124 } // namespace WebCore | 137 } // namespace WebCore |
| 125 | 138 |
| 126 | 139 |
| 127 #endif // !defined(InspectorDOMDebuggerAgent_h) | 140 #endif // !defined(InspectorDOMDebuggerAgent_h) |
| OLD | NEW |