Chromium Code Reviews| 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/Allocator.h" | 8 #include "platform/inspector_protocol/Allocator.h" |
| 9 #include "platform/inspector_protocol/Maybe.h" | 9 #include "platform/inspector_protocol/Maybe.h" |
| 10 #include "platform/inspector_protocol/Platform.h" | 10 #include "platform/inspector_protocol/Platform.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 | 78 |
| 79 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Function>); | 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>); | 80 v8::MaybeLocal<v8::Array> internalProperties(v8::Local<v8::Context>, v8::Loc al<v8::Value>); |
| 81 | 81 |
| 82 void asyncTaskScheduled(const String16& taskName, void* task, bool recurring ); | 82 void asyncTaskScheduled(const String16& taskName, void* task, bool recurring ); |
| 83 void asyncTaskCanceled(void* task); | 83 void asyncTaskCanceled(void* task); |
| 84 void asyncTaskStarted(void* task); | 84 void asyncTaskStarted(void* task); |
| 85 void asyncTaskFinished(void* task); | 85 void asyncTaskFinished(void* task); |
| 86 void allAsyncTasksCanceled(); | 86 void allAsyncTasksCanceled(); |
| 87 | 87 |
| 88 void setIgnoreScriptParsedEvents(bool); | |
| 89 | |
| 88 private: | 90 private: |
| 89 void compileDebuggerScript(); | 91 void compileDebuggerScript(); |
| 90 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[]); |
| 91 v8::Local<v8::Context> debuggerContext() const; | 93 v8::Local<v8::Context> debuggerContext() const; |
| 92 void clearBreakpoints(); | 94 void clearBreakpoints(); |
| 93 | 95 |
| 94 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; | 96 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; |
| 95 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); |
| 96 static void v8DebugEventCallback(const v8::Debug::EventDetails&); | 98 static void v8DebugEventCallback(const v8::Debug::EventDetails&); |
| 97 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); |
| 98 void handleV8DebugEvent(const v8::Debug::EventDetails&); | 100 void handleV8DebugEvent(const v8::Debug::EventDetails&); |
| 99 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); |
| 100 | 102 |
| 101 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>); |
| 102 v8::Local<v8::Value> generatorObjectLocation(v8::Local<v8::Object>); | 104 v8::Local<v8::Value> generatorObjectLocation(v8::Local<v8::Object>); |
| 103 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>); |
| 104 | 106 |
| 105 v8::Isolate* m_isolate; | 107 v8::Isolate* m_isolate; |
| 106 V8InspectorImpl* m_inspector; | 108 V8InspectorImpl* m_inspector; |
| 107 int m_lastContextId; | 109 int m_lastContextId; |
| 108 int m_enableCount; | 110 int m_enableCount; |
| 109 bool m_breakpointsActivated; | 111 bool m_breakpointsActivated; |
| 110 v8::Global<v8::Object> m_debuggerScript; | 112 v8::Global<v8::Object> m_debuggerScript; |
| 111 v8::Global<v8::Context> m_debuggerContext; | 113 v8::Global<v8::Context> m_debuggerContext; |
| 112 v8::Local<v8::Object> m_executionState; | 114 v8::Local<v8::Object> m_executionState; |
| 113 v8::Local<v8::Context> m_pausedContext; | 115 v8::Local<v8::Context> m_pausedContext; |
| 114 bool m_runningNestedMessageLoop; | 116 bool m_runningNestedMessageLoop; |
| 117 bool m_ignoreScriptParsedEvents; | |
|
dgozman
2016/08/09 20:43:08
Let's do the counter to accommodate for nested loo
lushnikov
2016/08/09 22:24:29
Done.
| |
| 115 | 118 |
| 116 using AsyncTaskToStackTrace = protocol::HashMap<void*, std::unique_ptr<V8Sta ckTraceImpl>>; | 119 using AsyncTaskToStackTrace = protocol::HashMap<void*, std::unique_ptr<V8Sta ckTraceImpl>>; |
| 117 AsyncTaskToStackTrace m_asyncTaskStacks; | 120 AsyncTaskToStackTrace m_asyncTaskStacks; |
| 118 protocol::HashSet<void*> m_recurringTasks; | 121 protocol::HashSet<void*> m_recurringTasks; |
| 119 int m_maxAsyncCallStackDepth; | 122 int m_maxAsyncCallStackDepth; |
| 120 std::vector<void*> m_currentTasks; | 123 std::vector<void*> m_currentTasks; |
| 121 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; | 124 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; |
| 122 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; | 125 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; |
| 123 }; | 126 }; |
| 124 | 127 |
| 125 } // namespace blink | 128 } // namespace blink |
| 126 | 129 |
| 127 #endif // V8Debugger_h | 130 #endif // V8Debugger_h |
| OLD | NEW |