Bug 95156 - [V8] ScriptController::matchesCurrentContext duplicates code from ScriptController::currentWorldContext
Summary: [V8] ScriptController::matchesCurrentContext duplicates code from ScriptContr...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-27 17:19 PDT by Adam Barth
Modified: 2012-08-29 23:24 PDT (History)
4 users (show)

See Also:


Attachments
Patch (22.56 KB, patch)
2012-08-27 17:21 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (9.85 KB, patch)
2012-08-27 17:47 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch for landing (9.73 KB, patch)
2012-08-29 09:46 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2012-08-27 17:19:35 PDT
[V8] ScriptController::matchesCurrentContext duplicates code from ScriptController::currentWorldContext
Comment 1 Adam Barth 2012-08-27 17:21:20 PDT
Created attachment 160865 [details]
Patch
Comment 2 Kentaro Hara 2012-08-27 17:24:19 PDT
Comment on attachment 160865 [details]
Patch

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

> Source/WebCore/bindings/v8/ScriptController.cpp:447
> +    return v8::Context::GetCurrent() == contextForCurrentWorldPrivate();

CodeGeneratorV8.pm is the only caller site of matchesCurrentContext(). You might want to write this in CodeGeneratorV8.pm and remove matchesCurrentContext().
Comment 3 Adam Barth 2012-08-27 17:31:13 PDT
(In reply to comment #2)
> (From update of attachment 160865 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=160865&action=review
> 
> > Source/WebCore/bindings/v8/ScriptController.cpp:447
> > +    return v8::Context::GetCurrent() == contextForCurrentWorldPrivate();
> 
> CodeGeneratorV8.pm is the only caller site of matchesCurrentContext(). You might want to write this in CodeGeneratorV8.pm and remove matchesCurrentContext().

Good point...  The downside is that then I'd need to make contextForCurrentWorldPrivate non-private.

Eric prefers the old names for these functions, so I'm going to try another iteration of the patch.
Comment 4 Adam Barth 2012-08-27 17:47:33 PDT
Created attachment 160869 [details]
Patch
Comment 5 Eric Seidel (no email) 2012-08-27 17:49:31 PDT
Comment on attachment 160869 [details]
Patch

Maybe unsafeHandleToCurrentWorldContext()?  Otherwise looks fine.
Comment 6 Adam Barth 2012-08-29 09:46:12 PDT
Created attachment 161250 [details]
Patch for landing
Comment 7 WebKit Review Bot 2012-08-29 23:24:14 PDT
Comment on attachment 161250 [details]
Patch for landing

Clearing flags on attachment: 161250

Committed r127106: <http://trac.webkit.org/changeset/127106>
Comment 8 WebKit Review Bot 2012-08-29 23:24:18 PDT
All reviewed patches have been landed.  Closing bug.