Bug 70397 - Rename AllowAllocation to a better name
Summary: Rename AllowAllocation to a better name
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-18 21:43 PDT by Kentaro Hara
Modified: 2011-10-19 18:22 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.90 KB, patch)
2011-10-18 22:04 PDT, Kentaro Hara
abarth: review+
Details | Formatted Diff | Diff
patch for commit (7.93 KB, patch)
2011-10-19 00:15 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff

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