Bug 70397

Summary: Rename AllowAllocation to a better name
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dominicc, japhet, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
abarth: review+
patch for commit none

Description Kentaro Hara 2011-10-18 21:43:53 PDT
The name 'AllowAllocation' is confusing (See discussion here: bug 70015). We should rename it to clarify that this class is for distinguishing the following two situations:

1. A programmer allocates an object via "new X"; X is a function with a C++ constructCallback.
2. C++ allocates an object via the function template and tries to wrap the object with the JS flavor.
Comment 1 Kentaro Hara 2011-10-18 22:04:34 PDT
Created attachment 111563 [details]
Patch
Comment 2 Adam Barth 2011-10-18 23:59:35 PDT
Comment on attachment 111563 [details]
Patch

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

> Source/WebCore/bindings/v8/V8Binding.h:211
> -        AllowAllocation allow;
> +        ConstructorMode allow;

Maybe rename "allow" to something else?
Comment 3 Kentaro Hara 2011-10-19 00:15:01 PDT
Created attachment 111568 [details]
patch for commit
Comment 4 Kentaro Hara 2011-10-19 00:23:34 PDT
(In reply to comment #2)
> (From update of attachment 111563 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=111563&action=review
> 
> > Source/WebCore/bindings/v8/V8Binding.h:211
> > -        AllowAllocation allow;
> > +        ConstructorMode allow;
> 
> Maybe rename "allow" to something else?

Renamed to "constructorMode", and committed. Thanks.

By the way, I am planning to add the ConstructorMode check to all existing custom ~25 constructors, but does that make sense?
Comment 5 WebKit Review Bot 2011-10-19 00:46:28 PDT
Comment on attachment 111568 [details]
patch for commit

Clearing flags on attachment: 111568

Committed r97839: <http://trac.webkit.org/changeset/97839>
Comment 6 Adam Barth 2011-10-19 13:25:49 PDT
> By the way, I am planning to add the ConstructorMode check to all existing custom ~25 constructors, but does that make sense?

Yep.