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

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

Issue 1286343003: DevTools: make InspectorDebuggerAgent aggregate V8DebuggerAgent instead of inheriting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed presubmit errors Created 5 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8DebuggerAgent_h 5 #ifndef V8DebuggerAgent_h
6 #define V8DebuggerAgent_h 6 #define V8DebuggerAgent_h
7 7
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/ScriptValue.h" 9 #include "bindings/core/v8/ScriptValue.h"
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
(...skipping 21 matching lines...) Expand all
32 class JSONObject; 32 class JSONObject;
33 class RemoteCallFrameId; 33 class RemoteCallFrameId;
34 class ScriptAsyncCallStack; 34 class ScriptAsyncCallStack;
35 class ScriptRegexp; 35 class ScriptRegexp;
36 class V8AsyncCallTracker; 36 class V8AsyncCallTracker;
37 class V8Debugger; 37 class V8Debugger;
38 38
39 typedef String ErrorString; 39 typedef String ErrorString;
40 40
41 class CORE_EXPORT V8DebuggerAgent 41 class CORE_EXPORT V8DebuggerAgent
42 : public InspectorBaseAgent<V8DebuggerAgent, InspectorFrontend::Debugger> 42 : public V8DebuggerListener
43 , public V8DebuggerListener
44 , public InspectorBackendDispatcher::DebuggerCommandHandler 43 , public InspectorBackendDispatcher::DebuggerCommandHandler
45 , public PromiseTracker::Listener { 44 , public PromiseTracker::Listener {
46 WTF_MAKE_NONCOPYABLE(V8DebuggerAgent); 45 WTF_MAKE_NONCOPYABLE(V8DebuggerAgent);
47 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8DebuggerAgent); 46 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8DebuggerAgent);
48 public: 47 public:
49 enum BreakpointSource { 48 enum BreakpointSource {
50 UserBreakpointSource, 49 UserBreakpointSource,
51 DebugCommandBreakpointSource, 50 DebugCommandBreakpointSource,
52 MonitorCommandBreakpointSource 51 MonitorCommandBreakpointSource
53 }; 52 };
54 53
55 static const char backtraceObjectGroup[]; 54 static const char backtraceObjectGroup[];
56 55
57 class CORE_EXPORT Client { 56 class CORE_EXPORT Client {
58 public: 57 public:
59 virtual ~Client() { } 58 virtual ~Client() { }
60 virtual void debuggerAgentEnabled() = 0; 59 virtual void debuggerAgentEnabled() = 0;
61 virtual void debuggerAgentDisabled() = 0; 60 virtual void debuggerAgentDisabled() = 0;
62 virtual void muteConsole() = 0; 61 virtual void muteConsole() = 0;
63 virtual void unmuteConsole() = 0; 62 virtual void unmuteConsole() = 0;
64 virtual InjectedScript defaultInjectedScript() = 0; 63 virtual InjectedScript defaultInjectedScript() = 0;
65 }; 64 };
66 65
67 V8DebuggerAgent(InjectedScriptManager*, V8Debugger*, Client*, int contextGro upId); 66 V8DebuggerAgent(InjectedScriptManager*, V8Debugger*, Client*, int contextGro upId);
68 ~V8DebuggerAgent() override; 67 ~V8DebuggerAgent() override;
69 DECLARE_VIRTUAL_TRACE();
70 68
71 void restore() override; 69 void setInspectorState(InspectorState* state) { m_state = state; }
70 void setFrontend(InspectorFrontend::Debugger* frontend) { m_frontend = front end; }
71 void clearFrontend();
72 void restore();
72 void disable(ErrorString*) final; 73 void disable(ErrorString*) final;
73 74
74 bool isPaused(); 75 bool isPaused();
75 76
76 // Part of the protocol. 77 // Part of the protocol.
77 void enable(ErrorString*) override; 78 void enable(ErrorString*) override;
78 void setBreakpointsActive(ErrorString*, bool active) final; 79 void setBreakpointsActive(ErrorString*, bool active) final;
79 void setSkipAllPauses(ErrorString*, bool skipped) final; 80 void setSkipAllPauses(ErrorString*, bool skipped) final;
80 81
81 void setBreakpointByUrl(ErrorString*, int lineNumber, const String* optional URL, const String* optionalURLRegex, const int* optionalColumnNumber, const Stri ng* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<TypeBuilder: :Array<TypeBuilder::Debugger::Location>>& locations) final; 82 void setBreakpointByUrl(ErrorString*, int lineNumber, const String* optional URL, const String* optionalURLRegex, const int* optionalColumnNumber, const Stri ng* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<TypeBuilder: :Array<TypeBuilder::Debugger::Location>>& locations) final;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void skipStackFrames(ErrorString*, const String* pattern, const bool* skipCo ntentScripts) final; 117 void skipStackFrames(ErrorString*, const String* pattern, const bool* skipCo ntentScripts) final;
117 void setAsyncCallStackDepth(ErrorString*, int depth) final; 118 void setAsyncCallStackDepth(ErrorString*, int depth) final;
118 void enablePromiseTracker(ErrorString*, const bool* captureStacks) final; 119 void enablePromiseTracker(ErrorString*, const bool* captureStacks) final;
119 void disablePromiseTracker(ErrorString*) final; 120 void disablePromiseTracker(ErrorString*) final;
120 void getPromiseById(ErrorString*, int promiseId, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& promise) final; 121 void getPromiseById(ErrorString*, int promiseId, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& promise) final;
121 void flushAsyncOperationEvents(ErrorString*) final; 122 void flushAsyncOperationEvents(ErrorString*) final;
122 void setAsyncOperationBreakpoint(ErrorString*, int operationId) final; 123 void setAsyncOperationBreakpoint(ErrorString*, int operationId) final;
123 void removeAsyncOperationBreakpoint(ErrorString*, int operationId) final; 124 void removeAsyncOperationBreakpoint(ErrorString*, int operationId) final;
124 125
125 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data); 126 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data);
126 void didFireTimer(); 127 void cancelPauseOnNextStatement();
127 void didHandleEvent();
128 bool canBreakProgram(); 128 bool canBreakProgram();
129 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas sRefPtr<JSONObject> data); 129 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas sRefPtr<JSONObject> data);
130 void scriptExecutionBlockedByCSP(const String& directiveText); 130 void willCallFunction(int scriptId);
131 void willCallFunction(ExecutionContext*, const DevToolsFunctionInfo&);
132 void didCallFunction(); 131 void didCallFunction();
133 void willEvaluateScript(const String& url, int lineNumber); 132 void willEvaluateScript();
134 void didEvaluateScript(); 133 void didEvaluateScript();
135 bool getEditedScript(const String& url, String* content); 134 bool getEditedScript(const String& url, String* content);
136 135
137 bool enabled(); 136 bool enabled();
138 V8Debugger& debugger() { return *m_debugger; } 137 V8Debugger& debugger() { return *m_debugger; }
139 138
140 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber, BreakpointSource, const String& condition = String()); 139 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber, BreakpointSource, const String& condition = String());
141 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb er, BreakpointSource); 140 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb er, BreakpointSource);
142 141
143 // Async call stacks implementation 142 // Async call stacks implementation
(...skipping 28 matching lines...) Expand all
172 void enable(); 171 void enable();
173 void disable(); 172 void disable();
174 173
175 SkipPauseRequest didPause(v8::Local<v8::Context>, v8::Local<v8::Object> call Frames, v8::Local<v8::Value> exception, const Vector<String>& hitBreakpoints, bo ol isPromiseRejection) final; 174 SkipPauseRequest didPause(v8::Local<v8::Context>, v8::Local<v8::Object> call Frames, v8::Local<v8::Value> exception, const Vector<String>& hitBreakpoints, bo ol isPromiseRejection) final;
176 void didContinue() final; 175 void didContinue() final;
177 176
178 SkipPauseRequest shouldSkipExceptionPause(); 177 SkipPauseRequest shouldSkipExceptionPause();
179 SkipPauseRequest shouldSkipStepPause(); 178 SkipPauseRequest shouldSkipStepPause();
180 179
181 void schedulePauseOnNextStatementIfSteppingInto(); 180 void schedulePauseOnNextStatementIfSteppingInto();
182 void cancelPauseOnNextStatement();
183 181
184 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>> currentCall Frames(); 182 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>> currentCall Frames();
185 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); 183 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace();
186 bool callStackForId(ErrorString*, const RemoteCallFrameId&, v8::Local<v8::Ob ject>* callStack, bool* isAsync); 184 bool callStackForId(ErrorString*, const RemoteCallFrameId&, v8::Local<v8::Ob ject>* callStack, bool* isAsync);
187 185
188 void clearCurrentAsyncOperation(); 186 void clearCurrentAsyncOperation();
189 void resetAsyncCallTracker(); 187 void resetAsyncCallTracker();
190 188
191 void changeJavaScriptRecursionLevel(int step); 189 void changeJavaScriptRecursionLevel(int step);
192 190
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 NoStep = 0, 222 NoStep = 0,
225 StepInto, 223 StepInto,
226 StepOver, 224 StepOver,
227 StepOut 225 StepOut
228 }; 226 };
229 227
230 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; 228 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
231 V8Debugger* m_debugger; 229 V8Debugger* m_debugger;
232 Client* m_client; 230 Client* m_client;
233 int m_contextGroupId; 231 int m_contextGroupId;
232 InspectorState* m_state;
233 InspectorFrontend::Debugger* m_frontend;
234 v8::Isolate* m_isolate; 234 v8::Isolate* m_isolate;
235 RefPtr<ScriptState> m_pausedScriptState; 235 RefPtr<ScriptState> m_pausedScriptState;
236 v8::Global<v8::Object> m_currentCallStack; 236 v8::Global<v8::Object> m_currentCallStack;
237 ScriptsMap m_scripts; 237 ScriptsMap m_scripts;
238 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds ; 238 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds ;
239 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; 239 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints;
240 String m_continueToLocationBreakpointId; 240 String m_continueToLocationBreakpointId;
241 InspectorFrontend::Debugger::Reason::Enum m_breakReason; 241 InspectorFrontend::Debugger::Reason::Enum m_breakReason;
242 RefPtr<JSONObject> m_breakAuxData; 242 RefPtr<JSONObject> m_breakAuxData;
243 DebuggerStep m_scheduledDebuggerStep; 243 DebuggerStep m_scheduledDebuggerStep;
(...skipping 28 matching lines...) Expand all
272 int m_currentAsyncOperationId; 272 int m_currentAsyncOperationId;
273 bool m_pendingTraceAsyncOperationCompleted; 273 bool m_pendingTraceAsyncOperationCompleted;
274 bool m_startingStepIntoAsync; 274 bool m_startingStepIntoAsync;
275 V8GlobalValueMap<String, v8::Script, v8::kNotWeak> m_compiledScripts; 275 V8GlobalValueMap<String, v8::Script, v8::kNotWeak> m_compiledScripts;
276 }; 276 };
277 277
278 } // namespace blink 278 } // namespace blink
279 279
280 280
281 #endif // V8DebuggerAgent_h 281 #endif // V8DebuggerAgent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698