Commit 0908fdc2 authored by yurys@chromium.org's avatar yurys@chromium.org

Don't unload debug context after it was requested through public API

Review URL: http://codereview.chromium.org/1731011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cf9eebaf
......@@ -4020,8 +4020,8 @@ void Debug::ProcessDebugMessages() {
}
Local<Context> Debug::GetDebugContext() {
i::EnterDebugger debugger;
return Utils::ToLocal(i::Debug::debug_context());
ENTER_V8;
return Utils::ToLocal(i::Debugger::GetDebugContext());
}
#endif // ENABLE_DEBUGGER_SUPPORT
......
......@@ -2133,6 +2133,13 @@ void Debugger::ProcessDebugEvent(v8::DebugEvent event,
}
Handle<Context> Debugger::GetDebugContext() {
never_unload_debugger_ = true;
EnterDebugger debugger;
return Debug::debug_context();
}
void Debugger::UnloadDebugger() {
// Make sure that there are no breakpoints left.
Debug::ClearAllBreakPoints();
......
......@@ -665,6 +665,8 @@ class Debugger {
static void CallMessageDispatchHandler();
static Handle<Context> GetDebugContext();
// Unload the debugger if possible. Only called when no debugger is currently
// active.
static void UnloadDebugger();
......
......@@ -6139,3 +6139,12 @@ TEST(CallingContextIsNotDebugContext) {
debugger_context = v8::Handle<v8::Context>();
CheckDebuggerUnloaded();
}
TEST(DebugContextIsPreservedBetweenAccesses) {
v8::HandleScope scope;
v8::Local<v8::Context> context1 = v8::Debug::GetDebugContext();
v8::Local<v8::Context> context2 = v8::Debug::GetDebugContext();
CHECK_EQ(*context1, *context2);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment