Bug 96790 - [V8] Prevent workers from calling back into other worlds
Summary: [V8] Prevent workers from calling back into other worlds
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-14 08:25 PDT by Dan Carney
Modified: 2012-09-14 14:09 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.14 KB, patch)
2012-09-14 08:35 PDT, Dan Carney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.