Bug 96790

Summary: [V8] Prevent workers from calling back into other worlds
Product: WebKit Reporter: Dan Carney <dcarney>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, haraken, japhet, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Dan Carney 2012-09-14 08:25:23 PDT
Prevent workers from calling back into other worlds
Comment 1 Dan Carney 2012-09-14 08:35:53 PDT
Created attachment 164161 [details]
Patch
Comment 3 Adam Barth 2012-09-14 13:09:48 PDT
Comment on attachment 164161 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=164161&action=review

> Source/WebCore/bindings/v8/WorldContextHandle.cpp:51
> +    if (v8::Context::InContext()) {
> +        v8::Handle<v8::Context> context = v8::Context::GetCurrent();
> +        if (!context.IsEmpty()) {

This is somewhat redundant.  You can skip the v8::Context::InContext() call and just test whether v8::Context::GetCurrent() returns an empty handle.
Comment 4 Dan Carney 2012-09-14 13:26:51 PDT
(In reply to comment #3)
> (From update of attachment 164161 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=164161&action=review
> 
> > Source/WebCore/bindings/v8/WorldContextHandle.cpp:51
> > +    if (v8::Context::InContext()) {
> > +        v8::Handle<v8::Context> context = v8::Context::GetCurrent();
> > +        if (!context.IsEmpty()) {
> 
> This is somewhat redundant.  You can skip the v8::Context::InContext() call and just test whether v8::Context::GetCurrent() returns an empty handle.

That's what I had at first, but v8 crashes on GetCurrent when not in context.
Comment 5 Adam Barth 2012-09-14 13:40:08 PDT
> That's what I had at first, but v8 crashes on GetCurrent when not in context.

Really!  I didn't know that.
Comment 6 WebKit Review Bot 2012-09-14 14:09:24 PDT
Comment on attachment 164161 [details]
Patch

Clearing flags on attachment: 164161

Committed r128651: <http://trac.webkit.org/changeset/128651>
Comment 7 WebKit Review Bot 2012-09-14 14:09:27 PDT
All reviewed patches have been landed.  Closing bug.