Changeset 67421 in webkit


Ignore:
Timestamp:
Sep 13, 2010 4:14:51 PM (14 years ago)
Author:
kinuko@chromium.org
Message:

2010-09-13 Kinuko Yasuda <kinuko@chromium.org>

Reviewed by Dumitru Daniliuc.

Expose Flags constructor if FileSystem API is Enabled
https://bugs.webkit.org/show_bug.cgi?id=45165

This change also includes:

No new tests; tests will be added when we fully expose the interface.

  • bindings/v8/V8DOMWindowCustom.cpp: Added custom getter for FlagsConstructor.
  • fileapi/Flags.idl: Changed attribute names to camelCase.
  • page/DOMWindow.idl: Exposed Flags constructor.
  • bindings/scripts/CodeGenerator.pm: Updated the WK_lcfirst hack to work around getter method for 'create' (create() should be avoided as it's widely used to instantiate an object).
  • bindings/scripts/CodeGeneratorV8.pm: Added EnabledAtRuntime=FeatureName support.
  • bindings/scripts/test/CPP/WebDOMTestObj.cpp: (WebDOMTestObj::create): (WebDOMTestObj::setCreate):
  • bindings/scripts/test/CPP/WebDOMTestObj.h:
  • bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: (webkit_dom_test_obj_set_property): (webkit_dom_test_obj_get_property): (webkit_dom_test_obj_class_init):
  • bindings/scripts/test/GObject/WebKitDOMTestObj.h:
  • bindings/scripts/test/JS/JSTestObj.cpp:
  • bindings/scripts/test/ObjC/DOMTestObj.h:
  • bindings/scripts/test/ObjC/DOMTestObj.mm:
  • bindings/scripts/test/TestObj.idl:
  • bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjInternal::createAttrGetter): (WebCore::TestObjInternal::createAttrSetter): (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrGetter): (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrSetter): (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrGetter): (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrSetter): (WebCore::TestObjInternal::enabledAtRuntimeMethod1Callback): (WebCore::TestObjInternal::enabledAtRuntimeMethod2Callback): (WebCore::ConfigureV8TestObjTemplate):
Location:
trunk/WebCore
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r67420 r67421  
     12010-09-13  Kinuko Yasuda  <kinuko@chromium.org>
     2
     3        Reviewed by Dumitru Daniliuc.
     4
     5        Expose Flags constructor if FileSystem API is Enabled
     6        https://bugs.webkit.org/show_bug.cgi?id=45165
     7
     8        This change also includes:
     9        - Changed Flags' attribute names from UPPERCASE to camelCase to reflect the recent spec change.
     10          http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interface
     11        - Enhanced EnabledAtRuntime attribute to take parameter that is used to generate a RuntimeEnabledFeatures method name.
     12
     13        No new tests; tests will be added when we fully expose the interface.
     14
     15        * bindings/v8/V8DOMWindowCustom.cpp: Added custom getter for FlagsConstructor.
     16        * fileapi/Flags.idl: Changed attribute names to camelCase.
     17        * page/DOMWindow.idl: Exposed Flags constructor.
     18
     19        * bindings/scripts/CodeGenerator.pm: Updated the WK_lcfirst hack to work around getter method for 'create' (create() should be avoided as it's widely used to instantiate an object).
     20        * bindings/scripts/CodeGeneratorV8.pm: Added EnabledAtRuntime=FeatureName support.
     21        * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
     22        (WebDOMTestObj::create):
     23        (WebDOMTestObj::setCreate):
     24        * bindings/scripts/test/CPP/WebDOMTestObj.h:
     25        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
     26        (webkit_dom_test_obj_set_property):
     27        (webkit_dom_test_obj_get_property):
     28        (webkit_dom_test_obj_class_init):
     29        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
     30        * bindings/scripts/test/JS/JSTestObj.cpp:
     31        * bindings/scripts/test/ObjC/DOMTestObj.h:
     32        * bindings/scripts/test/ObjC/DOMTestObj.mm:
     33        * bindings/scripts/test/TestObj.idl:
     34        * bindings/scripts/test/V8/V8TestObj.cpp:
     35        (WebCore::TestObjInternal::createAttrGetter):
     36        (WebCore::TestObjInternal::createAttrSetter):
     37        (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrGetter):
     38        (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrSetter):
     39        (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrGetter):
     40        (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrSetter):
     41        (WebCore::TestObjInternal::enabledAtRuntimeMethod1Callback):
     42        (WebCore::TestObjInternal::enabledAtRuntimeMethod2Callback):
     43        (WebCore::ConfigureV8TestObjTemplate):
     44
    1452010-09-13  Adam Barth  <abarth@webkit.org>
    246
  • trunk/WebCore/bindings/scripts/CodeGenerator.pm

    r64414 r67421  
    345345    $ret =~ s/Xml/XML/ if $ret =~ /^Xml[^a-z]/;
    346346
    347     # For HTML5 FileSystem API Flags attributes.
    348     $ret =~ s/^CREATE/Create/ if $ret =~ /^CREATE$/;
    349     $ret =~ s/^EXCLUSIVE/Exclusive/ if $ret =~ /^EXCLUSIVE$/;
    350 
    351347    return $ret;
    352348}
     
    365361
    366362    # For HTML5 FileSystem API Flags attributes.
    367     $ret =~ s/^cREATE/isCreate/ if $ret =~ /^cREATE$/;
    368     $ret =~ s/^eXCLUSIVE/isExclusive/ if $ret =~ /^eXCLUSIVE$/;
     363    # (create is widely used to instantiate an object and must be avoided.)
     364    $ret =~ s/^create/isCreate/ if $ret =~ /^create$/;
     365    $ret =~ s/^exclusive/isExclusive/ if $ret =~ /^exclusive$/;
    369366
    370367    return $ret;
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r66888 r67421  
    19851985    # Setup the enable-at-runtime attrs if we have them
    19861986    foreach my $runtime_attr (@enabledAtRuntime) {
    1987         # A function named RuntimeEnabledFeatures::{methodName}Enabled() need to be written by hand.
    1988         $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($runtime_attr->signature->name) . "Enabled";
     1987        my $enable_function = GetRuntimeEnableFunctionName($runtime_attr->signature);
    19891988        my $conditionalString = GenerateConditionalString($runtime_attr->signature);
    19901989        push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
     
    20352034        if ($attrExt->{"EnabledAtRuntime"}) {
    20362035            # Only call Set()/SetAccessor() if this method should be enabled
    2037             $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($function->signature->name) . "Enabled";
     2036            $enable_function = GetRuntimeEnableFunctionName($function->signature);
    20382037            $conditional = "if (${enable_function}())\n        ";
    20392038        }
     
    33903389}
    33913390
     3391# Returns the RuntimeEnabledFeatures function name that is hooked up to check if a method/attribute is enabled.
     3392sub GetRuntimeEnableFunctionName
     3393{
     3394    my $signature = shift;
     3395
     3396    # If a parameter is given (e.g. "EnabledAtRuntime=FeatureName") return the RuntimeEnabledFeatures::{FeatureName}Enabled() method.
     3397    return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->extendedAttributes->{"EnabledAtRuntime"}) . "Enabled" if ($signature->extendedAttributes->{"EnabledAtRuntime"} && $signature->extendedAttributes->{"EnabledAtRuntime"} ne "1");
     3398
     3399    # Otherwise return a function named RuntimeEnabledFeatures::{methodName}Enabled().
     3400    return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->name) . "Enabled";
     3401}
     3402
    33923403sub DebugPrint
    33933404{
  • trunk/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp

    r66802 r67421  
    200200}
    201201
    202 bool WebDOMTestObj::CREATE() const
     202bool WebDOMTestObj::create() const
    203203{
    204204    if (!impl())
     
    208208}
    209209
    210 void WebDOMTestObj::setCREATE(bool newCREATE)
    211 {
    212     if (!impl())
    213         return;
    214 
    215     impl()->setCreate(newCREATE);
     210void WebDOMTestObj::setCreate(bool newCreate)
     211{
     212    if (!impl())
     213        return;
     214
     215    impl()->setCreate(newCreate);
    216216}
    217217
  • trunk/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h

    r66802 r67421  
    7373    WebDOMTestObj XMLObjAttr() const;
    7474    void setXMLObjAttr(const WebDOMTestObj&);
    75     bool CREATE() const;
    76     void setCREATE(bool);
     75    bool create() const;
     76    void setCreate(bool);
    7777    WebDOMString reflectedStringAttr() const;
    7878    void setReflectedStringAttr(const WebDOMString&);
  • trunk/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r66802 r67421  
    6464    { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
    6565    { "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr THUNK_GENERATOR(0) },
    66     { "CREATE", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
     66    { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
    6767    { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
    6868    { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) },
  • trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h

    r66802 r67421  
    6565- (DOMTestObj *)XMLObjAttr;
    6666- (void)setXMLObjAttr:(DOMTestObj *)newXMLObjAttr;
    67 - (BOOL)CREATE;
    68 - (void)setCREATE:(BOOL)newCREATE;
     67- (BOOL)create;
     68- (void)setCreate:(BOOL)newCreate;
    6969- (NSString *)reflectedStringAttr;
    7070- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
  • trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm

    r66802 r67421  
    169169}
    170170
    171 - (BOOL)CREATE
     171- (BOOL)create
    172172{
    173173    WebCore::JSMainThreadNullState state;
     
    175175}
    176176
    177 - (void)setCREATE:(BOOL)newCREATE
    178 {
    179     WebCore::JSMainThreadNullState state;
    180     IMPL->setCreate(newCREATE);
     177- (void)setCreate:(BOOL)newCreate
     178{
     179    WebCore::JSMainThreadNullState state;
     180    IMPL->setCreate(newCreate);
    181181}
    182182
  • trunk/WebCore/bindings/scripts/test/TestObj.idl

    r66802 r67421  
    4545        // WK_ucfirst, WK_lcfirst exceptional cases.
    4646        attribute TestObj                  XMLObjAttr;
    47         attribute boolean                  CREATE;
     47        attribute boolean                  create;
    4848
    4949        // Reflected DOM attributes
     
    143143        [ClassMethod] long classMethodWithOptional(in [Optional] long arg);
    144144
     145#if defined(TESTING_V8)
     146        // 'EnabledAtRuntime' methods and attributes.
     147        [EnabledAtRuntime] void enabledAtRuntimeMethod1(in int intArg);
     148        [EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(in int intArg);
     149        attribute [EnabledAtRuntime] long enabledAtRuntimeAttr1;
     150        attribute [EnabledAtRuntime=FeatureName] long enabledAtRuntimeAttr2;
     151#endif
     152
    145153        // ObjectiveC reserved words.
    146154        readonly attribute long      description;
  • trunk/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp

    r61131 r67421  
    7171}
    7272
    73 TestInterface* V8TestInterface::toNative(v8::Handle<v8::Object> object)
    74 {
    75     return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
    76 }
    77 
    7873bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value)
    7974{
     
    8277
    8378
    84 v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
     79v8::Handle<v8::Object> V8TestInterface::wrapSlow(TestInterface* impl)
    8580{
    8681    v8::Handle<v8::Object> wrapper;
    8782    V8Proxy* proxy = 0;
    88         wrapper = getDOMObjectMap().get(impl);
    89         if (!wrapper.IsEmpty())
    90             return wrapper;
    9183    wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
    9284    if (wrapper.IsEmpty())
     
    9688    getDOMObjectMap().set(impl, v8::Persistent<v8::Object>::New(wrapper));
    9789    return wrapper;
    98 }
    99 
    100 v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface > impl)
    101 {
    102     return toV8(impl.get());
    103 }
    104 
    105 v8::Handle<v8::Value> toV8(TestInterface* impl)
    106 {
    107     if (!impl)
    108         return v8::Null();
    109     return V8TestInterface::wrap(impl);
    11090}
    11191
  • trunk/WebCore/bindings/scripts/test/V8/V8TestInterface.h

    r65180 r67421  
    2525
    2626#include "TestInterface.h"
     27#include "V8DOMWrapper.h"
    2728#include "WrapperTypeInfo.h"
    2829#include "wtf/text/StringHash.h"
     
    3839    static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
    3940    static v8::Persistent<v8::FunctionTemplate> GetTemplate();
    40     static TestInterface* toNative(v8::Handle<v8::Object>);
    41     static v8::Handle<v8::Object> wrap(TestInterface*);
     41    static TestInterface* toNative(v8::Handle<v8::Object> object)
     42    {
     43        return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
     44    }
     45    inline static v8::Handle<v8::Object> wrap(TestInterface*);
    4246    static void derefObject(void*);
    4347    static WrapperTypeInfo info;
    4448    static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
    4549    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
     50private:
     51    static v8::Handle<v8::Object> wrapSlow(TestInterface*);
    4652};
    4753
    48 v8::Handle<v8::Value> toV8(TestInterface*);
    49 v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >);
     54
     55v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
     56{
     57        v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
     58        if (!wrapper.IsEmpty())
     59            return wrapper;
     60    return V8TestInterface::wrapSlow(impl);
     61}
     62
     63inline v8::Handle<v8::Value> toV8(TestInterface* impl)
     64{
     65    if (!impl)
     66        return v8::Null();
     67    return V8TestInterface::wrap(impl);
     68}
     69inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl)
     70{
     71    return toV8(impl.get());
     72}
    5073}
    5174
  • trunk/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r66802 r67421  
    3636#include "V8Proxy.h"
    3737#include "V8TestCallback.h"
     38#include "V8int.h"
    3839#include "V8log.h"
    3940#include <wtf/GetPtr.h>
     
    173174}
    174175
    175 static v8::Handle<v8::Value> CREATEAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    176 {
    177     INC_STATS("DOM.TestObj.CREATE._get");
     176static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     177{
     178    INC_STATS("DOM.TestObj.create._get");
    178179    TestObj* imp = V8TestObj::toNative(info.Holder());
    179180    return v8Boolean(imp->isCreate());
    180181}
    181182
    182 static void CREATEAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
    183 {
    184     INC_STATS("DOM.TestObj.CREATE._set");
     183static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
     184{
     185    INC_STATS("DOM.TestObj.create._set");
    185186    TestObj* imp = V8TestObj::toNative(info.Holder());
    186187    bool v = value->BooleanValue();
     
    515516
    516517#endif // ENABLE(Condition1) || ENABLE(Condition2)
     518
     519static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     520{
     521    INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._get");
     522    TestObj* imp = V8TestObj::toNative(info.Holder());
     523    return v8::Integer::New(imp->enabledAtRuntimeAttr1());
     524}
     525
     526static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
     527{
     528    INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._set");
     529    TestObj* imp = V8TestObj::toNative(info.Holder());
     530    int v = toInt32(value);
     531    imp->setEnabledAtRuntimeAttr1(v);
     532    return;
     533}
     534
     535static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     536{
     537    INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._get");
     538    TestObj* imp = V8TestObj::toNative(info.Holder());
     539    return v8::Integer::New(imp->enabledAtRuntimeAttr2());
     540}
     541
     542static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
     543{
     544    INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._set");
     545    TestObj* imp = V8TestObj::toNative(info.Holder());
     546    int v = toInt32(value);
     547    imp->setEnabledAtRuntimeAttr2(v);
     548    return;
     549}
    517550
    518551static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     
    10191052    EXCEPTION_BLOCK(int, arg, toInt32(args[0]));
    10201053    return v8::Integer::New(TestObj::classMethodWithOptional(arg));
     1054}
     1055
     1056static v8::Handle<v8::Value> enabledAtRuntimeMethod1Callback(const v8::Arguments& args)
     1057{
     1058    INC_STATS("DOM.TestObj.enabledAtRuntimeMethod1");
     1059    TestObj* imp = V8TestObj::toNative(args.Holder());
     1060    EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     1061    imp->enabledAtRuntimeMethod1(intArg);
     1062    return v8::Handle<v8::Value>();
     1063}
     1064
     1065static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments& args)
     1066{
     1067    INC_STATS("DOM.TestObj.enabledAtRuntimeMethod2");
     1068    TestObj* imp = V8TestObj::toNative(args.Holder());
     1069    EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     1070    imp->enabledAtRuntimeMethod2(intArg);
     1071    return v8::Handle<v8::Value>();
    10211072}
    10221073
     
    10421093    // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '')
    10431094    {"XMLObjAttr", TestObjInternal::XMLObjAttrAttrGetter, TestObjInternal::XMLObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    1044     // Attribute 'CREATE' (Type: 'attribute' ExtAttr: '')
    1045     {"CREATE", TestObjInternal::CREATEAttrGetter, TestObjInternal::CREATEAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     1095    // Attribute 'create' (Type: 'attribute' ExtAttr: '')
     1096    {"create", TestObjInternal::createAttrGetter, TestObjInternal::createAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    10461097    // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
    10471098    {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     
    11581209    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    11591210   
     1211    if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) {
     1212        static const BatchedAttribute attrData =\
     1213        // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
     1214        {"enabledAtRuntimeAttr1", TestObjInternal::enabledAtRuntimeAttr1AttrGetter, TestObjInternal::enabledAtRuntimeAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
     1215        configureAttribute(instance, proto, attrData);
     1216    }
     1217    if (RuntimeEnabledFeatures::featureNameEnabled()) {
     1218        static const BatchedAttribute attrData =\
     1219        // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
     1220        {"enabledAtRuntimeAttr2", TestObjInternal::enabledAtRuntimeAttr2AttrGetter, TestObjInternal::enabledAtRuntimeAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
     1221        configureAttribute(instance, proto, attrData);
     1222    }
    11601223
    11611224    // Custom Signature 'voidMethodWithArgs'
     
    11961259    desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
    11971260    desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjInternal::classMethodWithOptionalCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
     1261    if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
     1262        proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod1Callback, v8::Handle<v8::Value>(), defaultSignature));
     1263    if (RuntimeEnabledFeatures::featureNameEnabled())
     1264        proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod2Callback, v8::Handle<v8::Value>(), defaultSignature));
    11981265    batchConfigureConstants(desc, proto, TestObjConsts, sizeof(TestObjConsts) / sizeof(*TestObjConsts));
    11991266
     
    12151282}
    12161283
    1217 TestObj* V8TestObj::toNative(v8::Handle<v8::Object> object)
    1218 {
    1219     return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
    1220 }
    1221 
    12221284bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
    12231285{
     
    12261288
    12271289
    1228 v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
     1290v8::Handle<v8::Object> V8TestObj::wrapSlow(TestObj* impl)
    12291291{
    12301292    v8::Handle<v8::Object> wrapper;
    12311293    V8Proxy* proxy = 0;
    1232         wrapper = getDOMObjectMap().get(impl);
    1233         if (!wrapper.IsEmpty())
    1234             return wrapper;
    12351294    wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
    12361295    if (wrapper.IsEmpty())
     
    12421301}
    12431302
    1244 v8::Handle<v8::Value> toV8(PassRefPtr<TestObj > impl)
    1245 {
    1246     return toV8(impl.get());
    1247 }
    1248 
    1249 v8::Handle<v8::Value> toV8(TestObj* impl)
    1250 {
    1251     if (!impl)
    1252         return v8::Null();
    1253     return V8TestObj::wrap(impl);
    1254 }
    1255 
    12561303void V8TestObj::derefObject(void* object)
    12571304{
  • trunk/WebCore/bindings/scripts/test/V8/V8TestObj.h

    r65180 r67421  
    2323
    2424#include "TestObj.h"
     25#include "V8DOMWrapper.h"
    2526#include "WrapperTypeInfo.h"
    2627#include "wtf/text/StringHash.h"
     
    3637    static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
    3738    static v8::Persistent<v8::FunctionTemplate> GetTemplate();
    38     static TestObj* toNative(v8::Handle<v8::Object>);
    39     static v8::Handle<v8::Object> wrap(TestObj*);
     39    static TestObj* toNative(v8::Handle<v8::Object> object)
     40    {
     41        return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
     42    }
     43    inline static v8::Handle<v8::Object> wrap(TestObj*);
    4044    static void derefObject(void*);
    4145    static WrapperTypeInfo info;
     
    4549    static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
    4650    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
     51private:
     52    static v8::Handle<v8::Object> wrapSlow(TestObj*);
    4753};
    4854
    49 v8::Handle<v8::Value> toV8(TestObj*);
    50 v8::Handle<v8::Value> toV8(PassRefPtr<TestObj >);
     55
     56v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
     57{
     58        v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
     59        if (!wrapper.IsEmpty())
     60            return wrapper;
     61    return V8TestObj::wrapSlow(impl);
     62}
     63
     64inline v8::Handle<v8::Value> toV8(TestObj* impl)
     65{
     66    if (!impl)
     67        return v8::Null();
     68    return V8TestObj::wrap(impl);
     69}
     70inline v8::Handle<v8::Value> toV8(PassRefPtr< TestObj > impl)
     71{
     72    return toV8(impl.get());
     73}
    5174}
    5275
  • trunk/WebCore/fileapi/Flags.idl

    r66586 r67421  
    3131module storage {
    3232    interface [
    33         Conditional=FILE_SYSTEM
     33        Conditional=FILE_SYSTEM,
     34        CanBeConstructed
    3435    ] Flags {
    35         attribute boolean CREATE;
    36         attribute boolean EXCLUSIVE;
     36        attribute boolean create;
     37        attribute boolean exclusive;
    3738    };
    3839}
  • trunk/WebCore/page/DOMWindow.idl

    r67100 r67421  
    194194        const unsigned short PERSISTENT = 1;
    195195        [EnabledAtRuntime] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
     196
     197        attribute [EnabledAtRuntime=FileSystem] FlagsConstructor Flags;
    196198#endif
    197199
Note: See TracChangeset for help on using the changeset viewer.