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

Side by Side Diff: Source/core/inspector/InspectorDOMDebuggerAgent.h

Issue 305753005: DevTools: disable DOMDebuggerAgent when DOMAgent or DebuggerAgent were disabled. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bugfix Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef InspectorDOMDebuggerAgent_h 31 #ifndef InspectorDOMDebuggerAgent_h
32 #define InspectorDOMDebuggerAgent_h 32 #define InspectorDOMDebuggerAgent_h
33 33
34 34
35 #include "core/inspector/InspectorBaseAgent.h" 35 #include "core/inspector/InspectorBaseAgent.h"
36 #include "core/inspector/InspectorDOMAgent.h"
36 #include "core/inspector/InspectorDebuggerAgent.h" 37 #include "core/inspector/InspectorDebuggerAgent.h"
37 #include "wtf/HashMap.h" 38 #include "wtf/HashMap.h"
38 #include "wtf/PassOwnPtr.h" 39 #include "wtf/PassOwnPtr.h"
39 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
40 41
41 namespace WebCore { 42 namespace WebCore {
42 43
43 class Document; 44 class Document;
44 class Element; 45 class Element;
45 class EventListener; 46 class EventListener;
46 class EventTarget; 47 class EventTarget;
47 class InspectorDOMAgent; 48 class InspectorDOMAgent;
48 class InspectorDebuggerAgent; 49 class InspectorDebuggerAgent;
49 class InspectorFrontend; 50 class InspectorFrontend;
50 class InstrumentingAgents; 51 class InstrumentingAgents;
51 class JSONObject; 52 class JSONObject;
52 class Node; 53 class Node;
53 54
54 typedef String ErrorString; 55 typedef String ErrorString;
55 56
56 class InspectorDOMDebuggerAgent FINAL : public InspectorBaseAgent<InspectorDOMDe buggerAgent>, public InspectorDebuggerAgent::Listener, public InspectorBackendDi spatcher::DOMDebuggerCommandHandler { 57 class InspectorDOMDebuggerAgent FINAL :
58 public InspectorBaseAgent<InspectorDOMDebuggerAgent>,
59 public InspectorDebuggerAgent::Listener,
60 public InspectorDOMAgent::Listener,
61 public InspectorBackendDispatcher::DOMDebuggerCommandHandler {
57 WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent); 62 WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
58 public: 63 public:
59 static PassOwnPtr<InspectorDOMDebuggerAgent> create(InspectorDOMAgent*, Insp ectorDebuggerAgent*); 64 static PassOwnPtr<InspectorDOMDebuggerAgent> create(InspectorDOMAgent*, Insp ectorDebuggerAgent*);
60 65
61 virtual ~InspectorDOMDebuggerAgent(); 66 virtual ~InspectorDOMDebuggerAgent();
62 67
63 // DOMDebugger API for InspectorFrontend 68 // DOMDebugger API for InspectorFrontend
64 virtual void setXHRBreakpoint(ErrorString*, const String& url) OVERRIDE; 69 virtual void setXHRBreakpoint(ErrorString*, const String& url) OVERRIDE;
65 virtual void removeXHRBreakpoint(ErrorString*, const String& url) OVERRIDE; 70 virtual void removeXHRBreakpoint(ErrorString*, const String& url) OVERRIDE;
66 virtual void setEventListenerBreakpoint(ErrorString*, const String& eventNam e) OVERRIDE; 71 virtual void setEventListenerBreakpoint(ErrorString*, const String& eventNam e) OVERRIDE;
(...skipping 27 matching lines...) Expand all
94 99
95 virtual void clearFrontend() OVERRIDE; 100 virtual void clearFrontend() OVERRIDE;
96 virtual void discardAgent() OVERRIDE; 101 virtual void discardAgent() OVERRIDE;
97 102
98 private: 103 private:
99 InspectorDOMDebuggerAgent(InspectorDOMAgent*, InspectorDebuggerAgent*); 104 InspectorDOMDebuggerAgent(InspectorDOMAgent*, InspectorDebuggerAgent*);
100 105
101 void pauseOnNativeEventIfNeeded(PassRefPtr<JSONObject> eventData, bool synch ronous); 106 void pauseOnNativeEventIfNeeded(PassRefPtr<JSONObject> eventData, bool synch ronous);
102 PassRefPtr<JSONObject> preparePauseOnNativeEventData(bool isDOMEvent, const String& eventName); 107 PassRefPtr<JSONObject> preparePauseOnNativeEventData(bool isDOMEvent, const String& eventName);
103 108
109 // InspectorDOMAgent::Listener implementation.
110 virtual void domAgentWasEnabled() OVERRIDE;
111 virtual void domAgentWasDisabled() OVERRIDE;
112
104 // InspectorDebuggerAgent::Listener implementation. 113 // InspectorDebuggerAgent::Listener implementation.
105 virtual void debuggerWasEnabled() OVERRIDE; 114 virtual void debuggerWasEnabled() OVERRIDE;
106 virtual void debuggerWasDisabled() OVERRIDE; 115 virtual void debuggerWasDisabled() OVERRIDE;
107 virtual void stepInto() OVERRIDE; 116 virtual void stepInto() OVERRIDE;
108 virtual void didPause() OVERRIDE; 117 virtual void didPause() OVERRIDE;
109 void disable(); 118 void disable();
110 119
111 void descriptionForDOMEvent(Node* target, int breakpointType, bool insertion , JSONObject* description); 120 void descriptionForDOMEvent(Node* target, int breakpointType, bool insertion , JSONObject* description);
112 void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set); 121 void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set);
113 bool hasBreakpoint(Node*, int type); 122 bool hasBreakpoint(Node*, int type);
114 void setBreakpoint(ErrorString*, const String& eventName); 123 void setBreakpoint(ErrorString*, const String& eventName);
115 void removeBreakpoint(ErrorString*, const String& eventName); 124 void removeBreakpoint(ErrorString*, const String& eventName);
116 125
117 void clear(); 126 void clear();
118 127
119 InspectorDOMAgent* m_domAgent; 128 InspectorDOMAgent* m_domAgent;
120 InspectorDebuggerAgent* m_debuggerAgent; 129 InspectorDebuggerAgent* m_debuggerAgent;
121 HashMap<Node*, uint32_t> m_domBreakpoints; 130 HashMap<Node*, uint32_t> m_domBreakpoints;
122 bool m_pauseInNextEventListener; 131 bool m_pauseInNextEventListener;
123 }; 132 };
124 133
125 } // namespace WebCore 134 } // namespace WebCore
126 135
127 136
128 #endif // !defined(InspectorDOMDebuggerAgent_h) 137 #endif // !defined(InspectorDOMDebuggerAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/core/inspector/InspectorDOMDebuggerAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698