Changeset 67421 in webkit
- Timestamp:
- Sep 13, 2010 4:14:51 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r67420 r67421 1 2010-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 1 45 2010-09-13 Adam Barth <abarth@webkit.org> 2 46 -
trunk/WebCore/bindings/scripts/CodeGenerator.pm
r64414 r67421 345 345 $ret =~ s/Xml/XML/ if $ret =~ /^Xml[^a-z]/; 346 346 347 # For HTML5 FileSystem API Flags attributes.348 $ret =~ s/^CREATE/Create/ if $ret =~ /^CREATE$/;349 $ret =~ s/^EXCLUSIVE/Exclusive/ if $ret =~ /^EXCLUSIVE$/;350 351 347 return $ret; 352 348 } … … 365 361 366 362 # 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$/; 369 366 370 367 return $ret; -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r66888 r67421 1985 1985 # Setup the enable-at-runtime attrs if we have them 1986 1986 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); 1989 1988 my $conditionalString = GenerateConditionalString($runtime_attr->signature); 1990 1989 push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; … … 2035 2034 if ($attrExt->{"EnabledAtRuntime"}) { 2036 2035 # 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); 2038 2037 $conditional = "if (${enable_function}())\n "; 2039 2038 } … … 3390 3389 } 3391 3390 3391 # Returns the RuntimeEnabledFeatures function name that is hooked up to check if a method/attribute is enabled. 3392 sub 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 3392 3403 sub DebugPrint 3393 3404 { -
trunk/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
r66802 r67421 200 200 } 201 201 202 bool WebDOMTestObj:: CREATE() const202 bool WebDOMTestObj::create() const 203 203 { 204 204 if (!impl()) … … 208 208 } 209 209 210 void WebDOMTestObj::setC REATE(bool newCREATE)211 { 212 if (!impl()) 213 return; 214 215 impl()->setCreate(newC REATE);210 void WebDOMTestObj::setCreate(bool newCreate) 211 { 212 if (!impl()) 213 return; 214 215 impl()->setCreate(newCreate); 216 216 } 217 217 -
trunk/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
r66802 r67421 73 73 WebDOMTestObj XMLObjAttr() const; 74 74 void setXMLObjAttr(const WebDOMTestObj&); 75 bool CREATE() const;76 void setC REATE(bool);75 bool create() const; 76 void setCreate(bool); 77 77 WebDOMString reflectedStringAttr() const; 78 78 void setReflectedStringAttr(const WebDOMString&); -
trunk/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r66802 r67421 64 64 { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) }, 65 65 { "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) }, 67 67 { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) }, 68 68 { "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 65 65 - (DOMTestObj *)XMLObjAttr; 66 66 - (void)setXMLObjAttr:(DOMTestObj *)newXMLObjAttr; 67 - (BOOL) CREATE;68 - (void)setC REATE:(BOOL)newCREATE;67 - (BOOL)create; 68 - (void)setCreate:(BOOL)newCreate; 69 69 - (NSString *)reflectedStringAttr; 70 70 - (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr; -
trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
r66802 r67421 169 169 } 170 170 171 - (BOOL) CREATE171 - (BOOL)create 172 172 { 173 173 WebCore::JSMainThreadNullState state; … … 175 175 } 176 176 177 - (void)setC REATE:(BOOL)newCREATE178 { 179 WebCore::JSMainThreadNullState state; 180 IMPL->setCreate(newC REATE);177 - (void)setCreate:(BOOL)newCreate 178 { 179 WebCore::JSMainThreadNullState state; 180 IMPL->setCreate(newCreate); 181 181 } 182 182 -
trunk/WebCore/bindings/scripts/test/TestObj.idl
r66802 r67421 45 45 // WK_ucfirst, WK_lcfirst exceptional cases. 46 46 attribute TestObj XMLObjAttr; 47 attribute boolean CREATE;47 attribute boolean create; 48 48 49 49 // Reflected DOM attributes … … 143 143 [ClassMethod] long classMethodWithOptional(in [Optional] long arg); 144 144 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 145 153 // ObjectiveC reserved words. 146 154 readonly attribute long description; -
trunk/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r61131 r67421 71 71 } 72 72 73 TestInterface* V8TestInterface::toNative(v8::Handle<v8::Object> object)74 {75 return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));76 }77 78 73 bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value) 79 74 { … … 82 77 83 78 84 v8::Handle<v8::Object> V8TestInterface::wrap (TestInterface* impl)79 v8::Handle<v8::Object> V8TestInterface::wrapSlow(TestInterface* impl) 85 80 { 86 81 v8::Handle<v8::Object> wrapper; 87 82 V8Proxy* proxy = 0; 88 wrapper = getDOMObjectMap().get(impl);89 if (!wrapper.IsEmpty())90 return wrapper;91 83 wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl); 92 84 if (wrapper.IsEmpty()) … … 96 88 getDOMObjectMap().set(impl, v8::Persistent<v8::Object>::New(wrapper)); 97 89 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);110 90 } 111 91 -
trunk/WebCore/bindings/scripts/test/V8/V8TestInterface.h
r65180 r67421 25 25 26 26 #include "TestInterface.h" 27 #include "V8DOMWrapper.h" 27 28 #include "WrapperTypeInfo.h" 28 29 #include "wtf/text/StringHash.h" … … 38 39 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); 39 40 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*); 42 46 static void derefObject(void*); 43 47 static WrapperTypeInfo info; 44 48 static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args); 45 49 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; 50 private: 51 static v8::Handle<v8::Object> wrapSlow(TestInterface*); 46 52 }; 47 53 48 v8::Handle<v8::Value> toV8(TestInterface*); 49 v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >); 54 55 v8::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 63 inline v8::Handle<v8::Value> toV8(TestInterface* impl) 64 { 65 if (!impl) 66 return v8::Null(); 67 return V8TestInterface::wrap(impl); 68 } 69 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl) 70 { 71 return toV8(impl.get()); 72 } 50 73 } 51 74 -
trunk/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r66802 r67421 36 36 #include "V8Proxy.h" 37 37 #include "V8TestCallback.h" 38 #include "V8int.h" 38 39 #include "V8log.h" 39 40 #include <wtf/GetPtr.h> … … 173 174 } 174 175 175 static v8::Handle<v8::Value> CREATEAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)176 { 177 INC_STATS("DOM.TestObj. CREATE._get");176 static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 177 { 178 INC_STATS("DOM.TestObj.create._get"); 178 179 TestObj* imp = V8TestObj::toNative(info.Holder()); 179 180 return v8Boolean(imp->isCreate()); 180 181 } 181 182 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");183 static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) 184 { 185 INC_STATS("DOM.TestObj.create._set"); 185 186 TestObj* imp = V8TestObj::toNative(info.Holder()); 186 187 bool v = value->BooleanValue(); … … 515 516 516 517 #endif // ENABLE(Condition1) || ENABLE(Condition2) 518 519 static 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 526 static 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 535 static 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 542 static 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 } 517 550 518 551 static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) … … 1019 1052 EXCEPTION_BLOCK(int, arg, toInt32(args[0])); 1020 1053 return v8::Integer::New(TestObj::classMethodWithOptional(arg)); 1054 } 1055 1056 static 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 1065 static 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>(); 1021 1072 } 1022 1073 … … 1042 1093 // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '') 1043 1094 {"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 */}, 1046 1097 // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') 1047 1098 {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, … … 1158 1209 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 1159 1210 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 } 1160 1223 1161 1224 // Custom Signature 'voidMethodWithArgs' … … 1196 1259 desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>())); 1197 1260 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)); 1198 1265 batchConfigureConstants(desc, proto, TestObjConsts, sizeof(TestObjConsts) / sizeof(*TestObjConsts)); 1199 1266 … … 1215 1282 } 1216 1283 1217 TestObj* V8TestObj::toNative(v8::Handle<v8::Object> object)1218 {1219 return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));1220 }1221 1222 1284 bool V8TestObj::HasInstance(v8::Handle<v8::Value> value) 1223 1285 { … … 1226 1288 1227 1289 1228 v8::Handle<v8::Object> V8TestObj::wrap (TestObj* impl)1290 v8::Handle<v8::Object> V8TestObj::wrapSlow(TestObj* impl) 1229 1291 { 1230 1292 v8::Handle<v8::Object> wrapper; 1231 1293 V8Proxy* proxy = 0; 1232 wrapper = getDOMObjectMap().get(impl);1233 if (!wrapper.IsEmpty())1234 return wrapper;1235 1294 wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl); 1236 1295 if (wrapper.IsEmpty()) … … 1242 1301 } 1243 1302 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 1256 1303 void V8TestObj::derefObject(void* object) 1257 1304 { -
trunk/WebCore/bindings/scripts/test/V8/V8TestObj.h
r65180 r67421 23 23 24 24 #include "TestObj.h" 25 #include "V8DOMWrapper.h" 25 26 #include "WrapperTypeInfo.h" 26 27 #include "wtf/text/StringHash.h" … … 36 37 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); 37 38 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*); 40 44 static void derefObject(void*); 41 45 static WrapperTypeInfo info; … … 45 49 static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info); 46 50 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; 51 private: 52 static v8::Handle<v8::Object> wrapSlow(TestObj*); 47 53 }; 48 54 49 v8::Handle<v8::Value> toV8(TestObj*); 50 v8::Handle<v8::Value> toV8(PassRefPtr<TestObj >); 55 56 v8::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 64 inline v8::Handle<v8::Value> toV8(TestObj* impl) 65 { 66 if (!impl) 67 return v8::Null(); 68 return V8TestObj::wrap(impl); 69 } 70 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestObj > impl) 71 { 72 return toV8(impl.get()); 73 } 51 74 } 52 75 -
trunk/WebCore/fileapi/Flags.idl
r66586 r67421 31 31 module storage { 32 32 interface [ 33 Conditional=FILE_SYSTEM 33 Conditional=FILE_SYSTEM, 34 CanBeConstructed 34 35 ] Flags { 35 attribute boolean CREATE;36 attribute boolean EXCLUSIVE;36 attribute boolean create; 37 attribute boolean exclusive; 37 38 }; 38 39 } -
trunk/WebCore/page/DOMWindow.idl
r67100 r67421 194 194 const unsigned short PERSISTENT = 1; 195 195 [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; 196 198 #endif 197 199
Note: See TracChangeset
for help on using the changeset viewer.