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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 v8::Local<v8::Object> details = currentCallFrame->details(); | 927 v8::Local<v8::Object> details = currentCallFrame->details(); |
928 if (hasInternalError(errorString, details.IsEmpty())) | 928 if (hasInternalError(errorString, details.IsEmpty())) |
929 return Array<CallFrame>::create(); | 929 return Array<CallFrame>::create(); |
930 | 930 |
931 int contextId = currentCallFrame->contextId(); | 931 int contextId = currentCallFrame->contextId(); |
932 InjectedScript* injectedScript = | 932 InjectedScript* injectedScript = |
933 contextId ? m_session->findInjectedScript(&ignored, contextId) | 933 contextId ? m_session->findInjectedScript(&ignored, contextId) |
934 : nullptr; | 934 : nullptr; |
935 | 935 |
936 String16 callFrameId = | 936 String16 callFrameId = |
937 RemoteCallFrameId::serialize(contextId, frameOrdinal); | 937 RemoteCallFrameId::serialize(contextId, static_cast<int>(frameOrdinal)); |
938 if (hasInternalError( | 938 if (hasInternalError( |
939 errorString, | 939 errorString, |
940 !details | 940 !details |
941 ->Set(debuggerContext, | 941 ->Set(debuggerContext, |
942 toV8StringInternalized(m_isolate, "callFrameId"), | 942 toV8StringInternalized(m_isolate, "callFrameId"), |
943 toV8String(m_isolate, callFrameId)) | 943 toV8String(m_isolate, callFrameId)) |
944 .FromMaybe(false))) | 944 .FromMaybe(false))) |
945 return Array<CallFrame>::create(); | 945 return Array<CallFrame>::create(); |
946 | 946 |
947 if (injectedScript) { | 947 if (injectedScript) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 return Array<CallFrame>::create(); | 999 return Array<CallFrame>::create(); |
1000 if (hasInternalError( | 1000 if (hasInternalError( |
1001 errorString, | 1001 errorString, |
1002 !details | 1002 !details |
1003 ->Delete(debuggerContext, | 1003 ->Delete(debuggerContext, |
1004 toV8StringInternalized(m_isolate, "returnValue")) | 1004 toV8StringInternalized(m_isolate, "returnValue")) |
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( |
1010 !objects->Set(debuggerContext, frameOrdinal, details) | 1010 errorString, |
1011 .FromMaybe(false))) | 1011 !objects |
| 1012 ->Set(debuggerContext, static_cast<int>(frameOrdinal), details) |
| 1013 .FromMaybe(false))) |
1012 return Array<CallFrame>::create(); | 1014 return Array<CallFrame>::create(); |
1013 } | 1015 } |
1014 | 1016 |
1015 protocol::ErrorSupport errorSupport; | 1017 protocol::ErrorSupport errorSupport; |
1016 std::unique_ptr<Array<CallFrame>> callFrames = Array<CallFrame>::parse( | 1018 std::unique_ptr<Array<CallFrame>> callFrames = Array<CallFrame>::parse( |
1017 toProtocolValue(debuggerContext, objects).get(), &errorSupport); | 1019 toProtocolValue(debuggerContext, objects).get(), &errorSupport); |
1018 if (hasInternalError(errorString, !callFrames)) | 1020 if (hasInternalError(errorString, !callFrames)) |
1019 return Array<CallFrame>::create(); | 1021 return Array<CallFrame>::create(); |
1020 return callFrames; | 1022 return callFrames; |
1021 } | 1023 } |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 | 1243 |
1242 void V8DebuggerAgentImpl::reset() { | 1244 void V8DebuggerAgentImpl::reset() { |
1243 if (!enabled()) return; | 1245 if (!enabled()) return; |
1244 m_scheduledDebuggerStep = NoStep; | 1246 m_scheduledDebuggerStep = NoStep; |
1245 m_scripts.clear(); | 1247 m_scripts.clear(); |
1246 m_blackboxedPositions.clear(); | 1248 m_blackboxedPositions.clear(); |
1247 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1249 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1248 } | 1250 } |
1249 | 1251 |
1250 } // namespace v8_inspector | 1252 } // namespace v8_inspector |
OLD | NEW |