| 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 #include "platform/v8_inspector/V8Debugger.h" | 5 #include "platform/v8_inspector/V8Debugger.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/DebuggerScript.h" | 7 #include "platform/v8_inspector/DebuggerScript.h" |
| 8 #include "platform/v8_inspector/ScriptBreakpoint.h" | 8 #include "platform/v8_inspector/ScriptBreakpoint.h" |
| 9 #include "platform/v8_inspector/V8Compat.h" | 9 #include "platform/v8_inspector/V8Compat.h" |
| 10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 return; | 501 return; |
| 502 } | 502 } |
| 503 | 503 |
| 504 V8DebuggerAgentImpl* agent = m_inspector->enabledDebuggerAgentForGroup(getGr
oupId(eventContext)); | 504 V8DebuggerAgentImpl* agent = m_inspector->enabledDebuggerAgentForGroup(getGr
oupId(eventContext)); |
| 505 if (agent) { | 505 if (agent) { |
| 506 v8::HandleScope scope(m_isolate); | 506 v8::HandleScope scope(m_isolate); |
| 507 if (m_ignoreScriptParsedEventsCounter == 0 && (event == v8::AfterCompile
|| event == v8::CompileError)) { | 507 if (m_ignoreScriptParsedEventsCounter == 0 && (event == v8::AfterCompile
|| event == v8::CompileError)) { |
| 508 v8::Context::Scope contextScope(debuggerContext()); | 508 v8::Context::Scope contextScope(debuggerContext()); |
| 509 v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() }; | 509 v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() }; |
| 510 v8::Local<v8::Value> value = callDebuggerMethod("getAfterCompileScri
pt", 1, argv).ToLocalChecked(); | 510 v8::Local<v8::Value> value = callDebuggerMethod("getAfterCompileScri
pt", 1, argv).ToLocalChecked(); |
| 511 if (value->IsNull()) |
| 512 return; |
| 511 DCHECK(value->IsObject()); | 513 DCHECK(value->IsObject()); |
| 512 v8::Local<v8::Object> scriptObject = v8::Local<v8::Object>::Cast(val
ue); | 514 v8::Local<v8::Object> scriptObject = v8::Local<v8::Object>::Cast(val
ue); |
| 513 agent->didParseSource(wrapUnique(new V8DebuggerScript(m_isolate, scr
iptObject, inLiveEditScope)), event == v8::AfterCompile); | 515 agent->didParseSource(wrapUnique(new V8DebuggerScript(m_isolate, scr
iptObject, inLiveEditScope)), event == v8::AfterCompile); |
| 514 } else if (event == v8::Exception) { | 516 } else if (event == v8::Exception) { |
| 515 v8::Local<v8::Object> eventData = eventDetails.GetEventData(); | 517 v8::Local<v8::Object> eventData = eventDetails.GetEventData(); |
| 516 v8::Local<v8::Value> exception = callInternalGetterFunction(eventDat
a, "exception"); | 518 v8::Local<v8::Value> exception = callInternalGetterFunction(eventDat
a, "exception"); |
| 517 v8::Local<v8::Value> promise = callInternalGetterFunction(eventData,
"promise"); | 519 v8::Local<v8::Value> promise = callInternalGetterFunction(eventData,
"promise"); |
| 518 bool isPromiseRejection = !promise.IsEmpty() && promise->IsObject(); | 520 bool isPromiseRejection = !promise.IsEmpty() && promise->IsObject(); |
| 519 handleProgramBreak(eventContext, eventDetails.GetExecutionState(), e
xception, v8::Local<v8::Array>(), isPromiseRejection); | 521 handleProgramBreak(eventContext, eventDetails.GetExecutionState(), e
xception, v8::Local<v8::Array>(), isPromiseRejection); |
| 520 } else if (event == v8::Break) { | 522 } else if (event == v8::Break) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 return nullptr; | 830 return nullptr; |
| 829 | 831 |
| 830 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture :
1; | 832 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture :
1; |
| 831 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) | 833 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) |
| 832 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; | 834 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; |
| 833 | 835 |
| 834 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); | 836 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); |
| 835 } | 837 } |
| 836 | 838 |
| 837 } // namespace blink | 839 } // namespace blink |
| OLD | NEW |