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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 std::unique_ptr<V8StackTraceImpl> V8Debugger::createStackTrace(v8::Local<v8::Sta
ckTrace> stackTrace) | 708 std::unique_ptr<V8StackTraceImpl> V8Debugger::createStackTrace(v8::Local<v8::Sta
ckTrace> stackTrace) |
709 { | 709 { |
710 int contextGroupId = m_isolate->InContext() ? getGroupId(m_isolate->GetCurre
ntContext()) : 0; | 710 int contextGroupId = m_isolate->InContext() ? getGroupId(m_isolate->GetCurre
ntContext()) : 0; |
711 return V8StackTraceImpl::create(this, contextGroupId, stackTrace, V8StackTra
ceImpl::maxCallStackSizeToCapture); | 711 return V8StackTraceImpl::create(this, contextGroupId, stackTrace, V8StackTra
ceImpl::maxCallStackSizeToCapture); |
712 } | 712 } |
713 | 713 |
714 int V8Debugger::markContext(const V8ContextInfo& info) | 714 int V8Debugger::markContext(const V8ContextInfo& info) |
715 { | 715 { |
716 DCHECK(info.context->GetIsolate() == m_isolate); | 716 DCHECK(info.context->GetIsolate() == m_isolate); |
717 int contextId = ++m_lastContextId; | 717 int contextId = ++m_lastContextId; |
718 String16 debugData = String16::fromInteger(info.contextGroupId) + "," + Stri
ng16::fromInteger(contextId) + "," + (info.isDefault ? "default" : "nondefault")
; | 718 String16 debugData = String16::fromInteger(info.contextGroupId) + "," + Stri
ng16::fromInteger(contextId) + "," + info.auxData; |
719 v8::Context::Scope contextScope(info.context); | 719 v8::Context::Scope contextScope(info.context); |
720 info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex),
toV8String(m_isolate, debugData)); | 720 info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex),
toV8String(m_isolate, debugData)); |
721 return contextId; | 721 return contextId; |
722 } | 722 } |
723 | 723 |
724 void V8Debugger::setAsyncCallStackDepth(V8DebuggerAgentImpl* agent, int depth) | 724 void V8Debugger::setAsyncCallStackDepth(V8DebuggerAgentImpl* agent, int depth) |
725 { | 725 { |
726 if (depth <= 0) | 726 if (depth <= 0) |
727 m_maxAsyncCallStackDepthMap.erase(agent); | 727 m_maxAsyncCallStackDepthMap.erase(agent); |
728 else | 728 else |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 return nullptr; | 817 return nullptr; |
818 | 818 |
819 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture :
1; | 819 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture :
1; |
820 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) | 820 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) |
821 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; | 821 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; |
822 | 822 |
823 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); | 823 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); |
824 } | 824 } |
825 | 825 |
826 } // namespace blink | 826 } // namespace blink |
OLD | NEW |