| 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" |
| 11 #include "platform/v8_inspector/V8InspectorImpl.h" | 11 #include "platform/v8_inspector/V8InspectorImpl.h" |
| 12 #include "platform/v8_inspector/V8InternalValueType.h" | 12 #include "platform/v8_inspector/V8InternalValueType.h" |
| 13 #include "platform/v8_inspector/V8StackTraceImpl.h" | 13 #include "platform/v8_inspector/V8StackTraceImpl.h" |
| 14 #include "platform/v8_inspector/V8StringUtil.h" | 14 #include "platform/v8_inspector/V8StringUtil.h" |
| 15 #include "platform/v8_inspector/public/V8InspectorClient.h" | 15 #include "platform/v8_inspector/public/V8InspectorClient.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace v8_inspector { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 const char stepIntoV8MethodName[] = "stepIntoStatement"; | 20 const char stepIntoV8MethodName[] = "stepIntoStatement"; |
| 21 const char stepOutV8MethodName[] = "stepOutOfFunction"; | 21 const char stepOutV8MethodName[] = "stepOutOfFunction"; |
| 22 static const char v8AsyncTaskEventEnqueue[] = "enqueue"; | 22 static const char v8AsyncTaskEventEnqueue[] = "enqueue"; |
| 23 static const char v8AsyncTaskEventWillHandle[] = "willHandle"; | 23 static const char v8AsyncTaskEventWillHandle[] = "willHandle"; |
| 24 static const char v8AsyncTaskEventDidHandle[] = "didHandle"; | 24 static const char v8AsyncTaskEventDidHandle[] = "didHandle"; |
| 25 | 25 |
| 26 inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) | 26 inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) |
| 27 { | 27 { |
| 28 return value ? v8::True(isolate) : v8::False(isolate); | 28 return value ? v8::True(isolate) : v8::False(isolate); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } | 31 } // namespace |
| 32 | 32 |
| 33 static bool inLiveEditScope = false; | 33 static bool inLiveEditScope = false; |
| 34 | 34 |
| 35 v8::MaybeLocal<v8::Value> V8Debugger::callDebuggerMethod(const char* functionNam
e, int argc, v8::Local<v8::Value> argv[]) | 35 v8::MaybeLocal<v8::Value> V8Debugger::callDebuggerMethod(const char* functionNam
e, int argc, v8::Local<v8::Value> argv[]) |
| 36 { | 36 { |
| 37 v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicr
otasks); | 37 v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicr
otasks); |
| 38 v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate); | 38 v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate); |
| 39 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(debuggerScr
ipt->Get(toV8StringInternalized(m_isolate, functionName))); | 39 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(debuggerScr
ipt->Get(toV8StringInternalized(m_isolate, functionName))); |
| 40 DCHECK(m_isolate->InContext()); | 40 DCHECK(m_isolate->InContext()); |
| 41 return function->Call(m_isolate->GetCurrentContext(), debuggerScript, argc,
argv); | 41 return function->Call(m_isolate->GetCurrentContext(), debuggerScript, argc,
argv); |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 if (!contextGroupId) | 829 if (!contextGroupId) |
| 830 return nullptr; | 830 return nullptr; |
| 831 | 831 |
| 832 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture :
1; | 832 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture :
1; |
| 833 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) | 833 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) |
| 834 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; | 834 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; |
| 835 | 835 |
| 836 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); | 836 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); |
| 837 } | 837 } |
| 838 | 838 |
| 839 } // namespace blink | 839 } // namespace v8_inspector |
| OLD | NEW |