| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 #include "platform/v8_inspector/InjectedScript.h" | 9 #include "platform/v8_inspector/InjectedScript.h" |
| 10 #include "platform/v8_inspector/InspectedContext.h" | 10 #include "platform/v8_inspector/InspectedContext.h" |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 m_skipNextDebuggerStepOut = true; | 1032 m_skipNextDebuggerStepOut = true; |
| 1033 } | 1033 } |
| 1034 } | 1034 } |
| 1035 } | 1035 } |
| 1036 | 1036 |
| 1037 std::unique_ptr<Array<CallFrame>> V8DebuggerAgentImpl::currentCallFrames(ErrorSt
ring* errorString) | 1037 std::unique_ptr<Array<CallFrame>> V8DebuggerAgentImpl::currentCallFrames(ErrorSt
ring* errorString) |
| 1038 { | 1038 { |
| 1039 if (m_pausedContext.IsEmpty() || !m_pausedCallFrames.size()) | 1039 if (m_pausedContext.IsEmpty() || !m_pausedCallFrames.size()) |
| 1040 return Array<CallFrame>::create(); | 1040 return Array<CallFrame>::create(); |
| 1041 ErrorString ignored; | 1041 ErrorString ignored; |
| 1042 InjectedScript* topFrameInjectedScript = m_session->findInjectedScript(&igno
red, V8Debugger::contextId(m_pausedContext.Get(m_isolate))); | 1042 InjectedScript* topFrameInjectedScript = m_session->findInjectedScript(&igno
red, V8DebuggerImpl::contextId(m_pausedContext.Get(m_isolate))); |
| 1043 if (!topFrameInjectedScript) { | 1043 if (!topFrameInjectedScript) { |
| 1044 // Context has been reported as removed while on pause. | 1044 // Context has been reported as removed while on pause. |
| 1045 return Array<CallFrame>::create(); | 1045 return Array<CallFrame>::create(); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 v8::HandleScope handles(m_isolate); | 1048 v8::HandleScope handles(m_isolate); |
| 1049 v8::Local<v8::Context> context = topFrameInjectedScript->context()->context(
); | 1049 v8::Local<v8::Context> context = topFrameInjectedScript->context()->context(
); |
| 1050 v8::Context::Scope contextScope(context); | 1050 v8::Context::Scope contextScope(context); |
| 1051 | 1051 |
| 1052 v8::Local<v8::Array> objects = v8::Array::New(m_isolate); | 1052 v8::Local<v8::Array> objects = v8::Array::New(m_isolate); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 return RequestContinue; | 1191 return RequestContinue; |
| 1192 | 1192 |
| 1193 DCHECK(m_pausedContext.IsEmpty()); | 1193 DCHECK(m_pausedContext.IsEmpty()); |
| 1194 JavaScriptCallFrames frames = debugger().currentCallFrames(); | 1194 JavaScriptCallFrames frames = debugger().currentCallFrames(); |
| 1195 m_pausedCallFrames.swap(frames); | 1195 m_pausedCallFrames.swap(frames); |
| 1196 m_pausedContext.Reset(m_isolate, context); | 1196 m_pausedContext.Reset(m_isolate, context); |
| 1197 v8::HandleScope handles(m_isolate); | 1197 v8::HandleScope handles(m_isolate); |
| 1198 | 1198 |
| 1199 if (!exception.IsEmpty()) { | 1199 if (!exception.IsEmpty()) { |
| 1200 ErrorString ignored; | 1200 ErrorString ignored; |
| 1201 InjectedScript* injectedScript = m_session->findInjectedScript(&ignored,
V8Debugger::contextId(context)); | 1201 InjectedScript* injectedScript = m_session->findInjectedScript(&ignored,
V8DebuggerImpl::contextId(context)); |
| 1202 if (injectedScript) { | 1202 if (injectedScript) { |
| 1203 m_breakReason = isPromiseRejection ? protocol::Debugger::Paused::Rea
sonEnum::PromiseRejection : protocol::Debugger::Paused::ReasonEnum::Exception; | 1203 m_breakReason = isPromiseRejection ? protocol::Debugger::Paused::Rea
sonEnum::PromiseRejection : protocol::Debugger::Paused::ReasonEnum::Exception; |
| 1204 ErrorString errorString; | 1204 ErrorString errorString; |
| 1205 auto obj = injectedScript->wrapObject(&errorString, exception, V8Ins
pectorSession::backtraceObjectGroup); | 1205 auto obj = injectedScript->wrapObject(&errorString, exception, V8Ins
pectorSession::backtraceObjectGroup); |
| 1206 m_breakAuxData = obj ? obj->serialize() : nullptr; | 1206 m_breakAuxData = obj ? obj->serialize() : nullptr; |
| 1207 // m_breakAuxData might be null after this. | 1207 // m_breakAuxData might be null after this. |
| 1208 } | 1208 } |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create(
); | 1211 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create(
); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 { | 1297 { |
| 1298 if (!enabled()) | 1298 if (!enabled()) |
| 1299 return; | 1299 return; |
| 1300 m_scheduledDebuggerStep = NoStep; | 1300 m_scheduledDebuggerStep = NoStep; |
| 1301 m_scripts.clear(); | 1301 m_scripts.clear(); |
| 1302 m_blackboxedPositions.clear(); | 1302 m_blackboxedPositions.clear(); |
| 1303 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1303 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 } // namespace blink | 1306 } // namespace blink |
| OLD | NEW |