[inspector] speculative avoid using debugger context as current in blink

Now we run nested message loop with debugger context as current one.

BUG=chromium:676749
R=yangguo@chromium.org,dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2604553002
Cr-Commit-Position: refs/heads/master@{#41937}
This commit is contained in:
kozyatinskiy 2016-12-23 02:06:24 -08:00 committed by Commit bot
parent 833d2c4b05
commit b571c6d1ce

View File

@ -488,6 +488,10 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
m_runningNestedMessageLoop = true;
int groupId = m_inspector->contextGroupId(pausedContext);
DCHECK(groupId);
v8::Context::Scope scope(pausedContext);
v8::Local<v8::Context> context = m_isolate->GetCurrentContext();
CHECK(!context.IsEmpty() &&
context != v8::Debug::GetDebugContext(m_isolate));
m_inspector->client()->runMessageLoopOnPause(groupId);
// The agent may have been removed in the nested loop.
agent = m_inspector->enabledDebuggerAgentForGroup(