OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 23 matching lines...) Expand all Loading... |
34 #include "platform/inspector_protocol/Collections.h" | 34 #include "platform/inspector_protocol/Collections.h" |
35 #include "platform/inspector_protocol/Maybe.h" | 35 #include "platform/inspector_protocol/Maybe.h" |
36 #include "platform/inspector_protocol/Platform.h" | 36 #include "platform/inspector_protocol/Platform.h" |
37 #include "platform/v8_inspector/JavaScriptCallFrame.h" | 37 #include "platform/v8_inspector/JavaScriptCallFrame.h" |
38 #include "platform/v8_inspector/V8DebuggerScript.h" | 38 #include "platform/v8_inspector/V8DebuggerScript.h" |
39 #include "platform/v8_inspector/protocol/Debugger.h" | 39 #include "platform/v8_inspector/protocol/Debugger.h" |
40 #include "platform/v8_inspector/public/V8Debugger.h" | 40 #include "platform/v8_inspector/public/V8Debugger.h" |
41 | 41 |
42 #include <v8-debug.h> | 42 #include <v8-debug.h> |
43 #include <v8.h> | 43 #include <v8.h> |
| 44 #include <vector> |
44 | 45 |
45 #include <vector> | 46 #include <vector> |
46 | 47 |
47 namespace blink { | 48 namespace blink { |
48 | 49 |
49 using protocol::Maybe; | 50 using protocol::Maybe; |
50 | 51 |
51 struct ScriptBreakpoint; | 52 struct ScriptBreakpoint; |
52 class InspectedContext; | 53 class InspectedContext; |
53 class V8DebuggerAgentImpl; | 54 class V8DebuggerAgentImpl; |
(...skipping 23 matching lines...) Expand all Loading... |
77 void setPauseOnExceptionsState(PauseOnExceptionsState); | 78 void setPauseOnExceptionsState(PauseOnExceptionsState); |
78 void setPauseOnNextStatement(bool); | 79 void setPauseOnNextStatement(bool); |
79 bool canBreakProgram(); | 80 bool canBreakProgram(); |
80 void breakProgram(); | 81 void breakProgram(); |
81 void continueProgram(); | 82 void continueProgram(); |
82 void stepIntoStatement(); | 83 void stepIntoStatement(); |
83 void stepOverStatement(); | 84 void stepOverStatement(); |
84 void stepOutOfFunction(); | 85 void stepOutOfFunction(); |
85 void clearStepping(); | 86 void clearStepping(); |
86 | 87 |
87 bool setScriptSource(const String16& sourceID, const String16& newContent, b
ool preview, ErrorString*, Maybe<protocol::Debugger::SetScriptSourceError>*, Jav
aScriptCallFrames* newCallFrames, Maybe<bool>* stackChanged); | 88 bool setScriptSource(const String16& sourceID, v8::Local<v8::String> newSour
ce, bool preview, ErrorString*, Maybe<protocol::Debugger::SetScriptSourceError>*
, JavaScriptCallFrames* newCallFrames, Maybe<bool>* stackChanged); |
88 JavaScriptCallFrames currentCallFrames(int limit = 0); | 89 JavaScriptCallFrames currentCallFrames(int limit = 0); |
89 | 90 |
90 // Each script inherits debug data from v8::Context where it has been compil
ed. | 91 // Each script inherits debug data from v8::Context where it has been compil
ed. |
91 // Only scripts whose debug data matches |contextGroupId| will be reported. | 92 // Only scripts whose debug data matches |contextGroupId| will be reported. |
92 // Passing 0 will result in reporting all scripts. | 93 // Passing 0 will result in reporting all scripts. |
93 void getCompiledScripts(int contextGroupId, std::vector<V8DebuggerParsedScri
pt>&); | 94 void getCompiledScripts(int contextGroupId, std::vector<std::unique_ptr<V8De
buggerScript>>&); |
94 void debuggerAgentEnabled(); | 95 void debuggerAgentEnabled(); |
95 void debuggerAgentDisabled(); | 96 void debuggerAgentDisabled(); |
96 | 97 |
97 bool isPaused() override; | 98 bool isPaused() override; |
98 v8::Local<v8::Context> pausedContext() { return m_pausedContext; } | 99 v8::Local<v8::Context> pausedContext() { return m_pausedContext; } |
99 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; } | 100 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; } |
100 V8StackTraceImpl* currentAsyncCallChain(); | 101 V8StackTraceImpl* currentAsyncCallChain(); |
101 void setAsyncCallStackDepth(V8DebuggerAgentImpl*, int); | 102 void setAsyncCallStackDepth(V8DebuggerAgentImpl*, int); |
102 | 103 |
103 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Function>); | 104 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Function>); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 void enable(); | 141 void enable(); |
141 void disable(); | 142 void disable(); |
142 V8DebuggerAgentImpl* findEnabledDebuggerAgent(int contextGroupId); | 143 V8DebuggerAgentImpl* findEnabledDebuggerAgent(int contextGroupId); |
143 V8DebuggerAgentImpl* findEnabledDebuggerAgent(v8::Local<v8::Context>); | 144 V8DebuggerAgentImpl* findEnabledDebuggerAgent(v8::Local<v8::Context>); |
144 | 145 |
145 void compileDebuggerScript(); | 146 void compileDebuggerScript(); |
146 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a
rgc, v8::Local<v8::Value> argv[]); | 147 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a
rgc, v8::Local<v8::Value> argv[]); |
147 v8::Local<v8::Context> debuggerContext() const; | 148 v8::Local<v8::Context> debuggerContext() const; |
148 void clearBreakpoints(); | 149 void clearBreakpoints(); |
149 | 150 |
150 V8DebuggerParsedScript createParsedScript(v8::Local<v8::Object> sourceObject
, bool success); | |
151 | |
152 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; | 151 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; |
153 void handleProgramBreak(v8::Local<v8::Context> pausedContext, v8::Local<v8::
Object> executionState, v8::Local<v8::Value> exception, v8::Local<v8::Array> hit
Breakpoints, bool isPromiseRejection = false); | 152 void handleProgramBreak(v8::Local<v8::Context> pausedContext, v8::Local<v8::
Object> executionState, v8::Local<v8::Value> exception, v8::Local<v8::Array> hit
Breakpoints, bool isPromiseRejection = false); |
154 static void v8DebugEventCallback(const v8::Debug::EventDetails&); | 153 static void v8DebugEventCallback(const v8::Debug::EventDetails&); |
155 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const
char* functionName); | 154 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const
char* functionName); |
156 void handleV8DebugEvent(const v8::Debug::EventDetails&); | 155 void handleV8DebugEvent(const v8::Debug::EventDetails&); |
157 | 156 |
158 v8::Local<v8::String> v8InternalizedString(const char*) const; | 157 v8::Local<v8::String> v8InternalizedString(const char*) const; |
159 | 158 |
160 void handleV8AsyncTaskEvent(v8::Local<v8::Context>, v8::Local<v8::Object> ex
ecutionState, v8::Local<v8::Object> eventData); | 159 void handleV8AsyncTaskEvent(v8::Local<v8::Context>, v8::Local<v8::Object> ex
ecutionState, v8::Local<v8::Object> eventData); |
161 InspectedContext* getContext(int groupId, int contextId) const; | 160 InspectedContext* getContext(int groupId, int contextId) const; |
(...skipping 22 matching lines...) Expand all Loading... |
184 int m_maxAsyncCallStackDepth; | 183 int m_maxAsyncCallStackDepth; |
185 std::vector<void*> m_currentTasks; | 184 std::vector<void*> m_currentTasks; |
186 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; | 185 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; |
187 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; | 186 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; |
188 }; | 187 }; |
189 | 188 |
190 } // namespace blink | 189 } // namespace blink |
191 | 190 |
192 | 191 |
193 #endif // V8DebuggerImpl_h | 192 #endif // V8DebuggerImpl_h |
OLD | NEW |