Support implicit detachment of CEF V8 references when the associated context is released (issue #484).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@881 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-10-29 21:46:02 +00:00
parent 95b29d590d
commit 0cea9668fe
25 changed files with 505 additions and 31 deletions

View File

@@ -227,12 +227,16 @@ void CefContentRendererClient::WillReleaseScriptContext(
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
v8::HandleScope handle_scope;
v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope(
WebCore::getScriptExecutionContext());
{
v8::HandleScope handle_scope;
v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope(
WebCore::getScriptExecutionContext());
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(context));
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(context));
handler->OnContextReleased(browserPtr.get(), framePtr.get(), contextPtr);
handler->OnContextReleased(browserPtr.get(), framePtr.get(), contextPtr);
}
CefV8ReleaseContext(context);
}