[debugger] deprecate v8::Debug:GetDebugContext.

R=jgruber@chromium.org
BUG=v8:5530

Review-Url: https://codereview.chromium.org/2589203002
Cr-Original-Commit-Position: refs/heads/master@{#41911}
Committed: 381082168d
Review-Url: https://codereview.chromium.org/2589203002
Cr-Commit-Position: refs/heads/master@{#42220}
This commit is contained in:
yangguo 2017-01-11 03:59:54 -08:00 committed by Commit bot
parent 93a357c707
commit a8cfc2f5e4
4 changed files with 7 additions and 27 deletions

View File

@ -248,7 +248,8 @@ class V8_EXPORT Debug {
* to change. The Context exists only when the debugger is active, i.e. at
* least one DebugEventListener or MessageHandler is set.
*/
static Local<Context> GetDebugContext(Isolate* isolate);
V8_DEPRECATED("Use v8-inspector",
static Local<Context> GetDebugContext(Isolate* isolate));
/**
* While in the debug context, this method returns the top-most non-debug

View File

@ -8900,9 +8900,7 @@ void Debug::ProcessDebugMessages(Isolate* isolate) {
Local<Context> Debug::GetDebugContext(Isolate* isolate) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
ENTER_V8(i_isolate);
return Utils::ToLocal(i_isolate->debug()->GetDebugContext());
return debug::GetDebugContext(isolate);
}
@ -8955,7 +8953,9 @@ bool debug::SetDebugEventListener(Isolate* isolate, debug::EventCallback that,
}
Local<Context> debug::GetDebugContext(Isolate* isolate) {
return Debug::GetDebugContext(isolate);
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
ENTER_V8(i_isolate);
return Utils::ToLocal(i_isolate->debug()->GetDebugContext());
}
MaybeLocal<Value> debug::Call(Local<Context> context,

View File

@ -486,7 +486,7 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
v8::Context::Scope scope(pausedContext);
v8::Local<v8::Context> context = m_isolate->GetCurrentContext();
CHECK(!context.IsEmpty() &&
context != v8::Debug::GetDebugContext(m_isolate));
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(

View File

@ -5663,27 +5663,6 @@ TEST(CallingContextIsNotDebugContext) {
}
TEST(DebugContextIsPreservedBetweenAccesses) {
v8::HandleScope scope(CcTest::isolate());
v8::Debug::SetDebugEventListener(CcTest::isolate(),
DebugEventBreakPointHitCount);
v8::Local<v8::Context> context1 =
v8::Debug::GetDebugContext(CcTest::isolate());
v8::Local<v8::Context> context2 =
v8::Debug::GetDebugContext(CcTest::isolate());
CHECK(v8::Utils::OpenHandle(*context1).is_identical_to(
v8::Utils::OpenHandle(*context2)));
v8::Debug::SetDebugEventListener(CcTest::isolate(), nullptr);
}
TEST(NoDebugContextWhenDebuggerDisabled) {
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> context =
v8::Debug::GetDebugContext(CcTest::isolate());
CHECK(context.IsEmpty());
}
static v8::Local<v8::Value> expected_callback_data;
static void DebugEventContextChecker(const v8::Debug::EventDetails& details) {
CHECK(details.GetEventContext() == expected_context);