OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project 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 #include "src/inspector/V8DebuggerAgentImpl.h" | 5 #include "src/inspector/V8DebuggerAgentImpl.h" |
6 | 6 |
7 #include "src/inspector/InjectedScript.h" | 7 #include "src/inspector/InjectedScript.h" |
8 #include "src/inspector/InspectedContext.h" | 8 #include "src/inspector/InspectedContext.h" |
9 #include "src/inspector/JavaScriptCallFrame.h" | 9 #include "src/inspector/JavaScriptCallFrame.h" |
10 #include "src/inspector/RemoteObjectId.h" | 10 #include "src/inspector/RemoteObjectId.h" |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 .FromMaybe(false))) | 1005 .FromMaybe(false))) |
1006 return Array<CallFrame>::create(); | 1006 return Array<CallFrame>::create(); |
1007 } | 1007 } |
1008 | 1008 |
1009 if (hasInternalError(errorString, | 1009 if (hasInternalError(errorString, |
1010 !objects->Set(debuggerContext, frameOrdinal, details) | 1010 !objects->Set(debuggerContext, frameOrdinal, details) |
1011 .FromMaybe(false))) | 1011 .FromMaybe(false))) |
1012 return Array<CallFrame>::create(); | 1012 return Array<CallFrame>::create(); |
1013 } | 1013 } |
1014 | 1014 |
| 1015 std::unique_ptr<protocol::Value> protocolValue = |
| 1016 toProtocolValue(errorString, debuggerContext, objects); |
| 1017 if (!protocolValue) return Array<CallFrame>::create(); |
1015 protocol::ErrorSupport errorSupport; | 1018 protocol::ErrorSupport errorSupport; |
1016 std::unique_ptr<Array<CallFrame>> callFrames = Array<CallFrame>::parse( | 1019 std::unique_ptr<Array<CallFrame>> callFrames = |
1017 toProtocolValue(debuggerContext, objects).get(), &errorSupport); | 1020 Array<CallFrame>::parse(protocolValue.get(), &errorSupport); |
1018 if (hasInternalError(errorString, !callFrames)) | 1021 if (hasInternalError(errorString, !callFrames)) |
1019 return Array<CallFrame>::create(); | 1022 return Array<CallFrame>::create(); |
1020 return callFrames; | 1023 return callFrames; |
1021 } | 1024 } |
1022 | 1025 |
1023 std::unique_ptr<StackTrace> V8DebuggerAgentImpl::currentAsyncStackTrace() { | 1026 std::unique_ptr<StackTrace> V8DebuggerAgentImpl::currentAsyncStackTrace() { |
1024 if (m_pausedContext.IsEmpty()) return nullptr; | 1027 if (m_pausedContext.IsEmpty()) return nullptr; |
1025 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); | 1028 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); |
1026 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) | 1029 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) |
1027 : nullptr; | 1030 : nullptr; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 | 1244 |
1242 void V8DebuggerAgentImpl::reset() { | 1245 void V8DebuggerAgentImpl::reset() { |
1243 if (!enabled()) return; | 1246 if (!enabled()) return; |
1244 m_scheduledDebuggerStep = NoStep; | 1247 m_scheduledDebuggerStep = NoStep; |
1245 m_scripts.clear(); | 1248 m_scripts.clear(); |
1246 m_blackboxedPositions.clear(); | 1249 m_blackboxedPositions.clear(); |
1247 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1250 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1248 } | 1251 } |
1249 | 1252 |
1250 } // namespace v8_inspector | 1253 } // namespace v8_inspector |
OLD | NEW |