OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/v8-debugger.h" | 5 #include "src/inspector/v8-debugger.h" |
6 | 6 |
7 #include "src/inspector/debugger-script.h" | 7 #include "src/inspector/debugger-script.h" |
8 #include "src/inspector/inspected-context.h" | 8 #include "src/inspector/inspected-context.h" |
9 #include "src/inspector/protocol/Protocol.h" | 9 #include "src/inspector/protocol/Protocol.h" |
10 #include "src/inspector/script-breakpoint.h" | 10 #include "src/inspector/script-breakpoint.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } | 481 } |
482 | 482 |
483 m_pausedContext = pausedContext; | 483 m_pausedContext = pausedContext; |
484 m_executionState = executionState; | 484 m_executionState = executionState; |
485 V8DebuggerAgentImpl::SkipPauseRequest result = agent->didPause( | 485 V8DebuggerAgentImpl::SkipPauseRequest result = agent->didPause( |
486 pausedContext, exception, breakpointIds, isPromiseRejection, isUncaught); | 486 pausedContext, exception, breakpointIds, isPromiseRejection, isUncaught); |
487 if (result == V8DebuggerAgentImpl::RequestNoSkip) { | 487 if (result == V8DebuggerAgentImpl::RequestNoSkip) { |
488 m_runningNestedMessageLoop = true; | 488 m_runningNestedMessageLoop = true; |
489 int groupId = m_inspector->contextGroupId(pausedContext); | 489 int groupId = m_inspector->contextGroupId(pausedContext); |
490 DCHECK(groupId); | 490 DCHECK(groupId); |
| 491 v8::Context::Scope scope(pausedContext); |
| 492 v8::Local<v8::Context> context = m_isolate->GetCurrentContext(); |
| 493 CHECK(!context.IsEmpty() && |
| 494 context != v8::Debug::GetDebugContext(m_isolate)); |
491 m_inspector->client()->runMessageLoopOnPause(groupId); | 495 m_inspector->client()->runMessageLoopOnPause(groupId); |
492 // The agent may have been removed in the nested loop. | 496 // The agent may have been removed in the nested loop. |
493 agent = m_inspector->enabledDebuggerAgentForGroup( | 497 agent = m_inspector->enabledDebuggerAgentForGroup( |
494 m_inspector->contextGroupId(pausedContext)); | 498 m_inspector->contextGroupId(pausedContext)); |
495 if (agent) agent->didContinue(); | 499 if (agent) agent->didContinue(); |
496 m_runningNestedMessageLoop = false; | 500 m_runningNestedMessageLoop = false; |
497 } | 501 } |
498 m_pausedContext.Clear(); | 502 m_pausedContext.Clear(); |
499 m_executionState.Clear(); | 503 m_executionState.Clear(); |
500 | 504 |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 | 1002 |
999 size_t stackSize = | 1003 size_t stackSize = |
1000 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; | 1004 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; |
1001 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) | 1005 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) |
1002 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; | 1006 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; |
1003 | 1007 |
1004 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); | 1008 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); |
1005 } | 1009 } |
1006 | 1010 |
1007 } // namespace v8_inspector | 1011 } // namespace v8_inspector |
OLD | NEW |