Changeset 202551 in webkit
- Timestamp:
- Jun 28, 2016 12:04:55 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202546 r202551 1 2016-06-28 Youenn Fablet <youenn@apple.com> 2 3 Binding generator should generate accessors for constructors safely accessed from JS builtin 4 https://bugs.webkit.org/show_bug.cgi?id=159087 5 6 Reviewed by Alex Christensen. 7 8 Removed constructor private slots direct additions in JSDOMGlobalObject. 9 Added support for generating the code that will do that. 10 Advantage of the implementation: 11 - Private slots will expose constructors that are also publically visible (previously workers had some private slots filled with WebRTC constructors). 12 - Private slots no longer require the creation of the constructors at window creation time. 13 14 Although PublicIdentifier and PrivateIdentifier are both added where needed, the binding generator does not 15 support the case of a constructor accessible only privately. 16 17 Covered by existing test set and adding binding test. 18 19 * Modules/mediastream/MediaStream.idl: Marked as PublicIdentifier/PrivateIdentifier. 20 * Modules/mediastream/MediaStreamTrack.idl: Ditto. 21 * Modules/mediastream/RTCIceCandidate.idl: Ditto. 22 * Modules/mediastream/RTCSessionDescription.idl: Ditto. 23 * Modules/streams/ReadableStream.idl: Ditto. 24 * bindings/js/JSDOMGlobalObject.cpp: 25 (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Removed unneeded additions. 26 * bindings/scripts/CodeGeneratorJS.pm: 27 (GenerateImplementation): Added support for private slots for interface constructors marked as 28 PrivateIdentifier. 29 * bindings/scripts/preprocess-idls.pl: 30 (GenerateConstructorAttribute): Make PublicIdentifier/PrivateIdentifier copied interface attributes. 31 * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp: 32 (webkit_dom_test_global_object_set_property): 33 (webkit_dom_test_global_object_get_property): 34 (webkit_dom_test_global_object_class_init): 35 (webkit_dom_test_global_object_get_public_and_private_attribute): 36 (webkit_dom_test_global_object_set_public_and_private_attribute): 37 * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h: 38 * bindings/scripts/test/JS/JSTestGlobalObject.cpp: 39 (WebCore::JSTestGlobalObject::finishCreation): 40 (WebCore::jsTestGlobalObjectPublicAndPrivateAttribute): 41 (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute): 42 * bindings/scripts/test/ObjC/DOMTestGlobalObject.h: 43 * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm: 44 (-[DOMTestGlobalObject publicAndPrivateAttribute]): 45 (-[DOMTestGlobalObject setPublicAndPrivateAttribute:]): 46 * bindings/scripts/test/TestGlobalObject.idl: 47 48 1 49 2016-06-27 Jer Noble <jer.noble@apple.com> 2 50 -
trunk/Source/WebCore/Modules/mediastream/MediaStream.idl
r202376 r202551 29 29 Constructor(MediaStreamTrack[] tracks), 30 30 ConstructorCallWith=ScriptExecutionContext, 31 PrivateIdentifier, 32 PublicIdentifier 31 33 ] interface MediaStream : EventTarget { 32 34 -
trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.idl
r196568 r202551 30 30 ActiveDOMObject, 31 31 SkipVTableValidation, 32 PrivateIdentifier, 33 PublicIdentifier 32 34 ] interface MediaStreamTrack : EventTarget { 33 35 readonly attribute DOMString kind; -
trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl
r201350 r202551 33 33 Conditional=WEB_RTC, 34 34 Constructor(Dictionary dictionary), 35 ConstructorRaisesException 35 ConstructorRaisesException, 36 PrivateIdentifier, 37 PublicIdentifier 36 38 ] interface RTCIceCandidate { 37 39 readonly attribute DOMString candidate; -
trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl
r201420 r202551 33 33 Conditional=WEB_RTC, 34 34 Constructor(Dictionary dictionary), 35 ConstructorRaisesException 35 ConstructorRaisesException, 36 PrivateIdentifier, 37 PublicIdentifier 36 38 ] interface RTCSessionDescription { 37 39 [SetterRaisesException] readonly attribute RTCSdpType type; -
trunk/Source/WebCore/Modules/streams/ReadableStream.idl
r199587 r202551 32 32 Constructor, 33 33 Exposed=(Window,Worker), 34 JSBuiltin 34 JSBuiltin, 35 PrivateIdentifier, 36 PublicIdentifier 35 37 ] interface ReadableStream { 36 38 Promise cancel(optional any reason); -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
r202376 r202551 84 84 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), DontDelete | ReadOnly), 85 85 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), DontDelete | ReadOnly), 86 #if ENABLE(MEDIA_STREAM)87 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().MediaStreamPrivateName(), JSMediaStream::getConstructor(vm, this), DontDelete | ReadOnly),88 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().MediaStreamTrackPrivateName(), JSMediaStreamTrack::getConstructor(vm, this), DontDelete | ReadOnly),89 #endif90 #if ENABLE(STREAMS_API)91 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamPrivateName(), JSReadableStream::getConstructor(vm, this), DontDelete | ReadOnly),92 #endif93 86 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamControllerPrivateName(), privateReadableStreamControllerConstructor, DontDelete | ReadOnly), 94 87 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamReaderPrivateName(), privateReadableStreamReaderConstructor, DontDelete | ReadOnly), 95 #if ENABLE(WEB_RTC)96 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().RTCIceCandidatePrivateName(), JSRTCIceCandidate::getConstructor(vm, this), DontDelete | ReadOnly),97 JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().RTCSessionDescriptionPrivateName(), JSRTCSessionDescription::getConstructor(vm, this), DontDelete | ReadOnly),98 #endif99 88 }; 100 89 addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals)); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r202394 r202551 2394 2394 push(@implContent, "#endif\n") if $conditionalString; 2395 2395 } 2396 2397 # Support PrivateIdentifier attributes on global objects 2398 foreach my $attribute (@{$interface->attributes}) { 2399 next unless $attribute->signature->extendedAttributes->{"PrivateIdentifier"}; 2400 2401 AddToImplIncludes("WebCoreJSClientData.h"); 2402 my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); 2403 my $attributeName = $attribute->signature->name; 2404 my $getter = GetAttributeGetterName($interface, $className, $attribute); 2405 2406 push(@implContent, "#if ${conditionalString}\n") if $conditionalString; 2407 push(@implContent, " putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames()." . $attributeName . "PrivateName(), CustomGetterSetter::create(vm, $getter, nullptr), attributesForStructure(DontDelete | ReadOnly));\n"); 2408 push(@implContent, "#endif\n") if $conditionalString; 2409 } 2410 2396 2411 # Support for RuntimeEnabled operations on global objects. 2397 2412 foreach my $function (@{$interface->functions}) { -
trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl
r200689 r202551 239 239 my @extendedAttributesList; 240 240 foreach my $attributeName (sort keys %{$extendedAttributes}) { 241 next unless ($attributeName eq "Conditional" || $attributeName eq "EnabledAtRuntime" || $attributeName eq "EnabledBySetting" );241 next unless ($attributeName eq "Conditional" || $attributeName eq "EnabledAtRuntime" || $attributeName eq "EnabledBySetting" || $attributeName eq "PrivateIdentifier" || $attributeName eq "PublicIdentifier"); 242 242 my $extendedAttribute = $attributeName; 243 243 $extendedAttribute .= "=" . $extendedAttributes->{$attributeName} unless $extendedAttributes->{$attributeName} eq "VALUE_IS_MISSING"; -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp
r199103 r202551 71 71 PROP_0, 72 72 PROP_REGULAR_ATTRIBUTE, 73 PROP_PUBLIC_AND_PRIVATE_ATTRIBUTE, 74 PROP_PUBLIC_AND_PRIVATE_CONDITIONAL_ATTRIBUTE, 73 75 PROP_ENABLED_AT_RUNTIME_ATTRIBUTE, 74 76 }; … … 92 94 webkit_dom_test_global_object_set_regular_attribute(self, g_value_get_string(value)); 93 95 break; 96 case PROP_PUBLIC_AND_PRIVATE_ATTRIBUTE: 97 webkit_dom_test_global_object_set_public_and_private_attribute(self, g_value_get_string(value)); 98 break; 99 case PROP_PUBLIC_AND_PRIVATE_CONDITIONAL_ATTRIBUTE: 100 webkit_dom_test_global_object_set_public_and_private_conditional_attribute(self, g_value_get_string(value)); 101 break; 94 102 case PROP_ENABLED_AT_RUNTIME_ATTRIBUTE: 95 103 webkit_dom_test_global_object_set_enabled_at_runtime_attribute(self, g_value_get_string(value)); … … 108 116 case PROP_REGULAR_ATTRIBUTE: 109 117 g_value_take_string(value, webkit_dom_test_global_object_get_regular_attribute(self)); 118 break; 119 case PROP_PUBLIC_AND_PRIVATE_ATTRIBUTE: 120 g_value_take_string(value, webkit_dom_test_global_object_get_public_and_private_attribute(self)); 121 break; 122 case PROP_PUBLIC_AND_PRIVATE_CONDITIONAL_ATTRIBUTE: 123 g_value_take_string(value, webkit_dom_test_global_object_get_public_and_private_conditional_attribute(self)); 110 124 break; 111 125 case PROP_ENABLED_AT_RUNTIME_ATTRIBUTE: … … 150 164 g_object_class_install_property( 151 165 gobjectClass, 166 PROP_PUBLIC_AND_PRIVATE_ATTRIBUTE, 167 g_param_spec_string( 168 "public-and-private-attribute", 169 "TestGlobalObject:public-and-private-attribute", 170 "read-write gchar* TestGlobalObject:public-and-private-attribute", 171 "", 172 WEBKIT_PARAM_READWRITE)); 173 174 g_object_class_install_property( 175 gobjectClass, 176 PROP_PUBLIC_AND_PRIVATE_CONDITIONAL_ATTRIBUTE, 177 g_param_spec_string( 178 "public-and-private-conditional-attribute", 179 "TestGlobalObject:public-and-private-conditional-attribute", 180 "read-write gchar* TestGlobalObject:public-and-private-conditional-attribute", 181 "", 182 WEBKIT_PARAM_READWRITE)); 183 184 g_object_class_install_property( 185 gobjectClass, 152 186 PROP_ENABLED_AT_RUNTIME_ATTRIBUTE, 153 187 g_param_spec_string( … … 225 259 } 226 260 261 gchar* webkit_dom_test_global_object_get_public_and_private_attribute(WebKitDOMTestGlobalObject* self) 262 { 263 WebCore::JSMainThreadNullState state; 264 g_return_val_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self), 0); 265 WebCore::TestGlobalObject* item = WebKit::core(self); 266 gchar* result = convertToUTF8String(item->publicAndPrivateAttribute()); 267 return result; 268 } 269 270 void webkit_dom_test_global_object_set_public_and_private_attribute(WebKitDOMTestGlobalObject* self, const gchar* value) 271 { 272 WebCore::JSMainThreadNullState state; 273 g_return_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self)); 274 g_return_if_fail(value); 275 WebCore::TestGlobalObject* item = WebKit::core(self); 276 WTF::String convertedValue = WTF::String::fromUTF8(value); 277 item->setPublicAndPrivateAttribute(convertedValue); 278 } 279 280 gchar* webkit_dom_test_global_object_get_public_and_private_conditional_attribute(WebKitDOMTestGlobalObject* self) 281 { 282 #if ENABLE(TEST_FEATURE) 283 WebCore::JSMainThreadNullState state; 284 g_return_val_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self), 0); 285 WebCore::TestGlobalObject* item = WebKit::core(self); 286 gchar* result = convertToUTF8String(item->publicAndPrivateConditionalAttribute()); 287 return result; 288 #else 289 UNUSED_PARAM(self); 290 WEBKIT_WARN_FEATURE_NOT_PRESENT("Test Feature") 291 return 0; 292 #endif /* ENABLE(TEST_FEATURE) */ 293 } 294 295 void webkit_dom_test_global_object_set_public_and_private_conditional_attribute(WebKitDOMTestGlobalObject* self, const gchar* value) 296 { 297 #if ENABLE(TEST_FEATURE) 298 WebCore::JSMainThreadNullState state; 299 g_return_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self)); 300 g_return_if_fail(value); 301 WebCore::TestGlobalObject* item = WebKit::core(self); 302 WTF::String convertedValue = WTF::String::fromUTF8(value); 303 item->setPublicAndPrivateConditionalAttribute(convertedValue); 304 #else 305 UNUSED_PARAM(self); 306 UNUSED_PARAM(value); 307 WEBKIT_WARN_FEATURE_NOT_PRESENT("Test Feature") 308 #endif /* ENABLE(TEST_FEATURE) */ 309 } 310 227 311 gchar* webkit_dom_test_global_object_get_enabled_at_runtime_attribute(WebKitDOMTestGlobalObject* self) 228 312 { -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h
r199103 r202551 100 100 101 101 /** 102 * webkit_dom_test_global_object_get_public_and_private_attribute: 103 * @self: A #WebKitDOMTestGlobalObject 104 * 105 * Returns: A #gchar 106 * 107 * Stability: Unstable 108 **/ 109 WEBKIT_API gchar* 110 webkit_dom_test_global_object_get_public_and_private_attribute(WebKitDOMTestGlobalObject* self); 111 112 /** 113 * webkit_dom_test_global_object_set_public_and_private_attribute: 114 * @self: A #WebKitDOMTestGlobalObject 115 * @value: A #gchar 116 * 117 * Stability: Unstable 118 **/ 119 WEBKIT_API void 120 webkit_dom_test_global_object_set_public_and_private_attribute(WebKitDOMTestGlobalObject* self, const gchar* value); 121 122 /** 123 * webkit_dom_test_global_object_get_public_and_private_conditional_attribute: 124 * @self: A #WebKitDOMTestGlobalObject 125 * 126 * Returns: A #gchar 127 * 128 * Stability: Unstable 129 **/ 130 WEBKIT_API gchar* 131 webkit_dom_test_global_object_get_public_and_private_conditional_attribute(WebKitDOMTestGlobalObject* self); 132 133 /** 134 * webkit_dom_test_global_object_set_public_and_private_conditional_attribute: 135 * @self: A #WebKitDOMTestGlobalObject 136 * @value: A #gchar 137 * 138 * Stability: Unstable 139 **/ 140 WEBKIT_API void 141 webkit_dom_test_global_object_set_public_and_private_conditional_attribute(WebKitDOMTestGlobalObject* self, const gchar* value); 142 143 /** 102 144 * webkit_dom_test_global_object_get_enabled_at_runtime_attribute: 103 145 * @self: A #WebKitDOMTestGlobalObject -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
r201816 r202551 28 28 #include "RuntimeEnabledFeatures.h" 29 29 #include "URL.h" 30 #include "WebCoreJSClientData.h" 30 31 #include <runtime/Error.h> 31 32 #include <runtime/FunctionPrototype.h> … … 48 49 JSC::EncodedJSValue jsTestGlobalObjectRegularAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); 49 50 bool setJSTestGlobalObjectRegularAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); 51 JSC::EncodedJSValue jsTestGlobalObjectPublicAndPrivateAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); 52 bool setJSTestGlobalObjectPublicAndPrivateAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); 53 #if ENABLE(TEST_FEATURE) 54 JSC::EncodedJSValue jsTestGlobalObjectPublicAndPrivateConditionalAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); 55 bool setJSTestGlobalObjectPublicAndPrivateConditionalAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); 56 #endif 50 57 #if ENABLE(TEST_FEATURE) 51 58 JSC::EncodedJSValue jsTestGlobalObjectEnabledAtRuntimeAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); … … 59 66 /* Hash table */ 60 67 61 static const struct CompactHashIndex JSTestGlobalObjectTableIndex[8] = { 68 static const struct CompactHashIndex JSTestGlobalObjectTableIndex[16] = { 69 { -1, -1 }, 70 { -1, -1 }, 71 { 2, -1 }, 72 { 0, -1 }, 73 { -1, -1 }, 74 { -1, -1 }, 75 { -1, -1 }, 76 { -1, -1 }, 77 { -1, -1 }, 78 { 3, -1 }, 79 { -1, -1 }, 80 { -1, -1 }, 81 { -1, -1 }, 62 82 { -1, -1 }, 63 83 { 1, -1 }, 64 84 { -1, -1 }, 65 { 0, -1 },66 { -1, -1 },67 { -1, -1 },68 { -1, -1 },69 { -1, -1 },70 85 }; 71 86 … … 74 89 { 75 90 { "regularAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectRegularAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectRegularAttribute) } }, 91 { "publicAndPrivateAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectPublicAndPrivateAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectPublicAndPrivateAttribute) } }, 92 #if ENABLE(TEST_FEATURE) 93 { "publicAndPrivateConditionalAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectPublicAndPrivateConditionalAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectPublicAndPrivateConditionalAttribute) } }, 94 #else 95 { 0, 0, NoIntrinsic, { 0, 0 } }, 96 #endif 76 97 { "regularOperation", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestGlobalObjectInstanceFunctionRegularOperation), (intptr_t) (1) } }, 77 98 }; 78 99 79 static const HashTable JSTestGlobalObjectTable = { 2, 7, true, JSTestGlobalObjectTableValues, JSTestGlobalObjectTableIndex };100 static const HashTable JSTestGlobalObjectTable = { 4, 15, true, JSTestGlobalObjectTableValues, JSTestGlobalObjectTableIndex }; 80 101 template<> JSValue JSTestGlobalObjectConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) 81 102 { … … 126 147 } 127 148 #endif 149 putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().publicAndPrivateAttributePrivateName(), CustomGetterSetter::create(vm, jsTestGlobalObjectPublicAndPrivateAttribute, nullptr), attributesForStructure(DontDelete | ReadOnly)); 150 #if ENABLE(TEST_FEATURE) 151 putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().publicAndPrivateConditionalAttributePrivateName(), CustomGetterSetter::create(vm, jsTestGlobalObjectPublicAndPrivateConditionalAttribute, nullptr), attributesForStructure(DontDelete | ReadOnly)); 152 #endif 128 153 #if ENABLE(TEST_FEATURE) 129 154 if (RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled()) … … 152 177 } 153 178 179 180 EncodedJSValue jsTestGlobalObjectPublicAndPrivateAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 181 { 182 UNUSED_PARAM(state); 183 UNUSED_PARAM(thisValue); 184 JSValue decodedThisValue = JSValue::decode(thisValue); 185 auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue); 186 if (UNLIKELY(!castedThis)) { 187 return throwGetterTypeError(*state, "TestGlobalObject", "publicAndPrivateAttribute"); 188 } 189 auto& impl = castedThis->wrapped(); 190 JSValue result = jsStringWithCache(state, impl.publicAndPrivateAttribute()); 191 return JSValue::encode(result); 192 } 193 194 195 #if ENABLE(TEST_FEATURE) 196 EncodedJSValue jsTestGlobalObjectPublicAndPrivateConditionalAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 197 { 198 UNUSED_PARAM(state); 199 UNUSED_PARAM(thisValue); 200 JSValue decodedThisValue = JSValue::decode(thisValue); 201 auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue); 202 if (UNLIKELY(!castedThis)) { 203 return throwGetterTypeError(*state, "TestGlobalObject", "publicAndPrivateConditionalAttribute"); 204 } 205 auto& impl = castedThis->wrapped(); 206 JSValue result = jsStringWithCache(state, impl.publicAndPrivateConditionalAttribute()); 207 return JSValue::encode(result); 208 } 209 210 #endif 154 211 155 212 #if ENABLE(TEST_FEATURE) … … 206 263 } 207 264 265 266 bool setJSTestGlobalObjectPublicAndPrivateAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) 267 { 268 JSValue value = JSValue::decode(encodedValue); 269 UNUSED_PARAM(thisValue); 270 JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue)); 271 if (UNLIKELY(!castedThis)) { 272 return throwSetterTypeError(*state, "TestGlobalObject", "publicAndPrivateAttribute"); 273 } 274 auto& impl = castedThis->wrapped(); 275 auto nativeValue = value.toWTFString(state); 276 if (UNLIKELY(state->hadException())) 277 return false; 278 impl.setPublicAndPrivateAttribute(WTFMove(nativeValue)); 279 return true; 280 } 281 282 283 #if ENABLE(TEST_FEATURE) 284 bool setJSTestGlobalObjectPublicAndPrivateConditionalAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) 285 { 286 JSValue value = JSValue::decode(encodedValue); 287 UNUSED_PARAM(thisValue); 288 JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue)); 289 if (UNLIKELY(!castedThis)) { 290 return throwSetterTypeError(*state, "TestGlobalObject", "publicAndPrivateConditionalAttribute"); 291 } 292 auto& impl = castedThis->wrapped(); 293 auto nativeValue = value.toWTFString(state); 294 if (UNLIKELY(state->hadException())) 295 return false; 296 impl.setPublicAndPrivateConditionalAttribute(WTFMove(nativeValue)); 297 return true; 298 } 299 300 #endif 208 301 209 302 #if ENABLE(TEST_FEATURE) -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.h
r199103 r202551 32 32 WEBCORE_EXPORT @interface DOMTestGlobalObject : DOMObject 33 33 @property (copy) NSString *regularAttribute; 34 @property (copy) NSString *publicAndPrivateAttribute; 35 @property (copy) NSString *publicAndPrivateConditionalAttribute; 34 36 @property (copy) NSString *enabledAtRuntimeAttribute; 35 37 -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.mm
r199103 r202551 67 67 } 68 68 69 - (NSString *)publicAndPrivateAttribute 70 { 71 WebCore::JSMainThreadNullState state; 72 return IMPL->publicAndPrivateAttribute(); 73 } 74 75 - (void)setPublicAndPrivateAttribute:(NSString *)newPublicAndPrivateAttribute 76 { 77 WebCore::JSMainThreadNullState state; 78 IMPL->setPublicAndPrivateAttribute(newPublicAndPrivateAttribute); 79 } 80 81 #if ENABLE(TEST_FEATURE) 82 - (NSString *)publicAndPrivateConditionalAttribute 83 { 84 WebCore::JSMainThreadNullState state; 85 return IMPL->publicAndPrivateConditionalAttribute(); 86 } 87 88 - (void)setPublicAndPrivateConditionalAttribute:(NSString *)newPublicAndPrivateConditionalAttribute 89 { 90 WebCore::JSMainThreadNullState state; 91 IMPL->setPublicAndPrivateConditionalAttribute(newPublicAndPrivateConditionalAttribute); 92 } 93 #endif 94 69 95 #if ENABLE(TEST_FEATURE) 70 96 - (NSString *)enabledAtRuntimeAttribute -
trunk/Source/WebCore/bindings/scripts/test/TestGlobalObject.idl
r199103 r202551 27 27 interface TestGlobalObject { 28 28 attribute DOMString regularAttribute; 29 [PrivateIdentifier, PublicIdentifier] attribute DOMString publicAndPrivateAttribute; 30 [Conditional=TEST_FEATURE, PrivateIdentifier, PublicIdentifier] attribute DOMString publicAndPrivateConditionalAttribute; 29 31 [Conditional=TEST_FEATURE, EnabledAtRuntime=TestFeature] attribute DOMString enabledAtRuntimeAttribute; 30 32 void regularOperation(DOMString testParam);
Note: See TracChangeset
for help on using the changeset viewer.