[Webkit-unassigned] [Bug 98108] Correct detection of context type in WorldContextHandle

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 1 22:42:45 PDT 2012


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





--- Comment #5 from Adam Barth <abarth at webkit.org>  2012-10-01 22:43:08 PST ---
(From update of attachment 166596)
View in context: https://bugs.webkit.org/attachment.cgi?id=166596&action=review

> Source/WebCore/ChangeLog:9
> +        It's possible that certain contexts get incorrectly detected as worker
> +        contexts.

Can you write a test that demonstrates this issue?

> Source/WebCore/bindings/v8/V8DOMWrapper.cpp:180
> +WrapperTypeInfo* V8DOMWrapper::domWrapperTypeSlow(v8::Handle<v8::Value> value)

Adding this function seems like the wrong approach.  We shouldn't be calling this function with a random object.  We're starting from a v8::Context.  We should know how to find the right JS object to call domWrapperType on.

> Source/WebCore/bindings/v8/WorldContextHandle.cpp:52
> +        m_worldToUse = UseMainWorld;
> +        return;

This seems to say that we'll always use the UseMainWorld if we call this function while JavaScript is on the stack.

> Source/WebCore/bindings/v8/WorldContextHandle.cpp:55
> +    v8::Handle<v8::Context> context = v8::Context::GetCurrent();

If we've reached this line, v8::Context::InContext() must have returned false, which means there is no current context.

-- 
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