[Webkit-unassigned] [Bug 96637] Remove V8DOMWindowShell::getEntered

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 17 11:11:48 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=96637





--- Comment #23 from Adam Barth <abarth at webkit.org>  2012-09-17 11:12:17 PST ---
(From update of attachment 164371)
View in context: https://bugs.webkit.org/attachment.cgi?id=164371&action=review

> Source/WebCore/bindings/v8/ScriptController.cpp:447
>  v8::Local<v8::Context> ScriptController::currentWorldContext()
>  {
> -    if (V8DOMWindowShell* isolatedShell = V8DOMWindowShell::getEntered()) {
> -        v8::Persistent<v8::Context> context = isolatedShell->context();
> -        if (context.IsEmpty() || m_frame != toFrameIfNotDetached(context))
> +    V8DOMWindowShell::IsolatedContextData* isolatedContextData = V8DOMWindowShell::enteredIsolatedContextData();
> +    if (UNLIKELY(!!isolatedContextData)) {
> +        V8DOMWindowShell* isolatedShell = existingWindowShellInternal(isolatedContextData->world());
> +        // A temporary isolated world has been deleted, so use the current context.
> +        if (UNLIKELY(!isolatedShell)) {
> +            v8::Handle<v8::Context> context = v8::Context::GetEntered();
> +            if (m_frame != toFrameIfNotDetached(context))
> +                return v8::Local<v8::Context>();
> +            return v8::Local<v8::Context>::New(context);
> +        }
> +        // The shell exists, but potentially it has a new context, so use it.
> +        if (isolatedShell->context().IsEmpty() || m_frame != toFrameIfNotDetached(isolatedShell->context()))
>              return v8::Local<v8::Context>();
> -        return v8::Local<v8::Context>::New(context);
> +        return v8::Local<v8::Context>::New(isolatedShell->context());
>      }

This function is getting way too complicated.  What's causing this complexity?  Perhaps we need to remove the concept of a temporary isolated world?  Maybe we need to treat temporary isolated worlds more like regular isolated worlds?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list