Closed GoogleCodeExporter closed 9 years ago
Is it related to the following piece of code in
V8DOMWindowShell::initContextIfNeeded()?
// FIXME: This is wrong. We should actually do this for the proper world once
// we do isolated worlds the WebCore way.
m_frame->loader()->dispatchDidClearWindowObjectInWorld(0);
Original comment by emerick
on 18 Nov 2011 at 9:23
Based on the comment for this function, maybe this is a better delegate to
implement for this purpose:
// Notifies that a new script context has been created for this frame.
// This is similar to didClearWindowObject but only called once per
// frame context.
virtual void didCreateScriptContext(WebFrame*) { }
It seems to imply that didClearWindowObject can be called multiple times per
frame whereas this delegate is called only once.
Original comment by emerick
on 21 Nov 2011 at 8:27
I'm in the process of eliminating didClearWindowObject usage in favor of
didCreateScriptContext. Changes to land this afternoon.
Original comment by magreenb...@gmail.com
on 21 Nov 2011 at 8:45
Fantastic, thanks!
Original comment by emerick
on 21 Nov 2011 at 8:47
Revision 392 replaces JSBindingHandler with a new V8ContextHandler interface
that contains callbacks for V8 context creation and release.
Old code:
virtual void OnJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object) OVERRIDE
{
// ...
}
New code:
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) OVERRIDE
{
// Retrieve the 'window' object.
CefRefPtr<CefV8Value> object = context->GetGlobal();
// ...
}
Original comment by magreenb...@gmail.com
on 21 Nov 2011 at 9:27
Original issue reported on code.google.com by
fdd...@gmail.com
on 1 Oct 2011 at 8:57