OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 V8Debugger_h | 5 #ifndef V8Debugger_h |
6 #define V8Debugger_h | 6 #define V8Debugger_h |
7 | 7 |
8 #include "platform/inspector_protocol/InspectorProtocol.h" | 8 #include "platform/inspector_protocol/InspectorProtocol.h" |
9 #include "platform/v8_inspector/JavaScriptCallFrame.h" | 9 #include "platform/v8_inspector/JavaScriptCallFrame.h" |
10 #include "platform/v8_inspector/V8DebuggerScript.h" | 10 #include "platform/v8_inspector/V8DebuggerScript.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 bool isPaused(); | 70 bool isPaused(); |
71 v8::Local<v8::Context> pausedContext() { return m_pausedContext; } | 71 v8::Local<v8::Context> pausedContext() { return m_pausedContext; } |
72 | 72 |
73 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; } | 73 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; } |
74 V8StackTraceImpl* currentAsyncCallChain(); | 74 V8StackTraceImpl* currentAsyncCallChain(); |
75 void setAsyncCallStackDepth(V8DebuggerAgentImpl*, int); | 75 void setAsyncCallStackDepth(V8DebuggerAgentImpl*, int); |
76 std::unique_ptr<V8StackTraceImpl> createStackTrace(v8::Local<v8::StackTrace>
); | 76 std::unique_ptr<V8StackTraceImpl> createStackTrace(v8::Local<v8::StackTrace>
); |
77 std::unique_ptr<V8StackTraceImpl> captureStackTrace(bool fullStack); | 77 std::unique_ptr<V8StackTraceImpl> captureStackTrace(bool fullStack); |
78 | 78 |
79 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Function>); | |
80 v8::MaybeLocal<v8::Array> internalProperties(v8::Local<v8::Context>, v8::Loc
al<v8::Value>); | 79 v8::MaybeLocal<v8::Array> internalProperties(v8::Local<v8::Context>, v8::Loc
al<v8::Value>); |
81 | 80 |
82 void asyncTaskScheduled(const String16& taskName, void* task, bool recurring
); | 81 void asyncTaskScheduled(const String16& taskName, void* task, bool recurring
); |
83 void asyncTaskCanceled(void* task); | 82 void asyncTaskCanceled(void* task); |
84 void asyncTaskStarted(void* task); | 83 void asyncTaskStarted(void* task); |
85 void asyncTaskFinished(void* task); | 84 void asyncTaskFinished(void* task); |
86 void allAsyncTasksCanceled(); | 85 void allAsyncTasksCanceled(); |
87 | 86 |
88 void muteScriptParsedEvents(); | 87 void muteScriptParsedEvents(); |
89 void unmuteScriptParsedEvents(); | 88 void unmuteScriptParsedEvents(); |
90 | 89 |
91 private: | 90 private: |
92 void compileDebuggerScript(); | 91 void compileDebuggerScript(); |
93 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a
rgc, v8::Local<v8::Value> argv[]); | 92 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a
rgc, v8::Local<v8::Value> argv[]); |
94 v8::Local<v8::Context> debuggerContext() const; | 93 v8::Local<v8::Context> debuggerContext() const; |
95 void clearBreakpoints(); | 94 void clearBreakpoints(); |
96 | 95 |
97 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; | 96 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; |
98 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); | 97 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); |
99 static void v8DebugEventCallback(const v8::Debug::EventDetails&); | 98 static void v8DebugEventCallback(const v8::Debug::EventDetails&); |
100 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const
char* functionName); | 99 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const
char* functionName); |
101 void handleV8DebugEvent(const v8::Debug::EventDetails&); | 100 void handleV8DebugEvent(const v8::Debug::EventDetails&); |
102 void handleV8AsyncTaskEvent(v8::Local<v8::Context>, v8::Local<v8::Object> ex
ecutionState, v8::Local<v8::Object> eventData); | 101 void handleV8AsyncTaskEvent(v8::Local<v8::Context>, v8::Local<v8::Object> ex
ecutionState, v8::Local<v8::Object> eventData); |
103 | 102 |
104 v8::Local<v8::Value> collectionEntries(v8::Local<v8::Context>, v8::Local<v8:
:Object>); | 103 v8::Local<v8::Value> collectionEntries(v8::Local<v8::Context>, v8::Local<v8:
:Object>); |
105 v8::Local<v8::Value> generatorObjectLocation(v8::Local<v8::Object>); | 104 v8::Local<v8::Value> generatorObjectLocation(v8::Local<v8::Context>, v8::Loc
al<v8::Object>); |
106 v8::Local<v8::Value> functionLocation(v8::Local<v8::Context>, v8::Local<v8::
Function>); | 105 v8::Local<v8::Value> functionLocation(v8::Local<v8::Context>, v8::Local<v8::
Function>); |
| 106 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Context>, v8::Local<v
8::Function>); |
107 | 107 |
108 v8::Isolate* m_isolate; | 108 v8::Isolate* m_isolate; |
109 V8InspectorImpl* m_inspector; | 109 V8InspectorImpl* m_inspector; |
110 int m_lastContextId; | 110 int m_lastContextId; |
111 int m_enableCount; | 111 int m_enableCount; |
112 bool m_breakpointsActivated; | 112 bool m_breakpointsActivated; |
113 v8::Global<v8::Object> m_debuggerScript; | 113 v8::Global<v8::Object> m_debuggerScript; |
114 v8::Global<v8::Context> m_debuggerContext; | 114 v8::Global<v8::Context> m_debuggerContext; |
115 v8::Local<v8::Object> m_executionState; | 115 v8::Local<v8::Object> m_executionState; |
116 v8::Local<v8::Context> m_pausedContext; | 116 v8::Local<v8::Context> m_pausedContext; |
117 bool m_runningNestedMessageLoop; | 117 bool m_runningNestedMessageLoop; |
118 int m_ignoreScriptParsedEventsCounter; | 118 int m_ignoreScriptParsedEventsCounter; |
119 | 119 |
120 using AsyncTaskToStackTrace = protocol::HashMap<void*, std::unique_ptr<V8Sta
ckTraceImpl>>; | 120 using AsyncTaskToStackTrace = protocol::HashMap<void*, std::unique_ptr<V8Sta
ckTraceImpl>>; |
121 AsyncTaskToStackTrace m_asyncTaskStacks; | 121 AsyncTaskToStackTrace m_asyncTaskStacks; |
122 protocol::HashSet<void*> m_recurringTasks; | 122 protocol::HashSet<void*> m_recurringTasks; |
123 int m_maxAsyncCallStackDepth; | 123 int m_maxAsyncCallStackDepth; |
124 std::vector<void*> m_currentTasks; | 124 std::vector<void*> m_currentTasks; |
125 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; | 125 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; |
126 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; | 126 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; |
127 }; | 127 }; |
128 | 128 |
129 } // namespace v8_inspector | 129 } // namespace v8_inspector |
130 | 130 |
131 #endif // V8Debugger_h | 131 #endif // V8Debugger_h |
OLD | NEW |