Changeset 96788 in webkit
- Timestamp:
- Oct 5, 2011 11:00:41 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96786 r96788 1 2011-10-05 Kentaro Hara <haraken@chromium.org> 2 3 Refactor IDL attributes about constructor 4 https://bugs.webkit.org/show_bug.cgi?id=69074 5 6 Reviewed by Adam Barth. 7 8 Currently, IDL attributes about constructor are confusing: 9 10 - [CustomConstructFunction] means that there is a custom constructor for JSC. 11 - [V8CustomConstructor] means that there is a custom constructor for V8. 12 - [CustomConstructor] exists in CodeGenerator*.pm but is not used in any IDL files. 13 - For almost all IDL files, [CustomConstructFunction] and [V8CustomConstructor] are used at the same time. 14 - ObjC, CPP and GObject bindings do not support custom constructors. 15 16 This patch makes the following changes: 17 18 - Rename [CustomConstructFunction] to [JSCustomConstructor]. 19 - [JSCustomConstructor] means that there is a custom constructor for JSC. 20 - [V8CustomConstructor] means that there is a custom constructor for V8. 21 - [CustomConstructor] means that there is a custom constructor for both JSC and V8. 22 23 No new tests. No change in behavior. Confirm that build succeeds. 24 25 * bindings/scripts/CodeGeneratorJS.pm: Removed [CustomConstructFunction] and added [JSCustomConstructor] 26 (GenerateHeader): 27 (GenerateAttributesHashTable): 28 (GenerateImplementation): 29 (GenerateConstructorDefinition): 30 * css/WebKitCSSMatrix.idl: Renamed [CustomConstructFunction] to [JSCustomConstructor]. If both [JSCustomConstructor] and [V8CustomConstructor] are specified, then we replaced them with [CustomConstructor]. 31 * dom/CustomEvent.idl: Ditto. 32 * dom/ErrorEvent.idl: Ditto. 33 * dom/Event.idl: Ditto. 34 * dom/HashChangeEvent.idl: Ditto. 35 * dom/MessageChannel.idl: Ditto. 36 * dom/MessageEvent.idl: Ditto. 37 * dom/PageTransitionEvent.idl: Ditto. 38 * dom/PopStateEvent.idl: Ditto. 39 * dom/ProgressEvent.idl: Ditto. 40 * dom/WebKitAnimationEvent.idl: Ditto. 41 * html/DOMFormData.idl: Ditto. 42 * html/canvas/ArrayBuffer.idl: Ditto. 43 * html/canvas/DataView.idl: Ditto. 44 * html/canvas/Float32Array.idl: Ditto. 45 * html/canvas/Float64Array.idl: Ditto. 46 * html/canvas/Int16Array.idl: Ditto. 47 * html/canvas/Int32Array.idl: Ditto. 48 * html/canvas/Int8Array.idl: Ditto. 49 * html/canvas/Uint16Array.idl: Ditto. 50 * html/canvas/Uint32Array.idl: Ditto. 51 * html/canvas/Uint8Array.idl: Ditto. 52 * p2p/PeerConnection.idl: Ditto. 53 * page/EventSource.idl: Ditto. 54 * page/WebKitPoint.idl: Ditto. 55 * webaudio/AudioContext.idl: Ditto. 56 * websockets/CloseEvent.idl: Ditto. 57 * websockets/WebSocket.idl: Ditto. 58 * workers/SharedWorker.idl: Ditto. 59 * workers/Worker.idl: Ditto. 60 * xml/XMLHttpRequest.idl: Ditto. 61 * xml/XSLTProcessor.idl: Ditto. 62 1 63 2011-10-03 Andy Estes <aestes@apple.com> 2 64 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r96346 r96788 760 760 761 761 my $hasGetter = $numAttributes > 0 762 || !($dataNode->extendedAttributes->{"OmitConstructor"} 763 || $dataNode->extendedAttributes->{"CustomConstructor"}) 762 || !$dataNode->extendedAttributes->{"OmitConstructor"} 764 763 || $dataNode->extendedAttributes->{"HasIndexGetter"} 765 764 || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} … … 857 856 858 857 # Constructor object getter 859 push(@headerContent, " static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);\n") if (!($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"}));858 push(@headerContent, " static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);\n") if !$dataNode->extendedAttributes->{"OmitConstructor"}; 860 859 861 860 my $numCustomFunctions = 0; … … 1072 1071 1073 1072 # Conditionally emit the constructor object's declaration 1074 if ($dataNode->extendedAttributes->{" CustomConstructFunction"}) {1073 if ($dataNode->extendedAttributes->{"JSCustomConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"}) { 1075 1074 GenerateConstructorDeclaration(\@headerContent, $className, $dataNode); 1076 1075 } … … 1086 1085 } 1087 1086 1088 if ($numAttributes > 0 || ! ($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {1087 if ($numAttributes > 0 || !$dataNode->extendedAttributes->{"OmitConstructor"}) { 1089 1088 push(@headerContent,"// Attributes\n\n"); 1090 1089 foreach my $attribute (@{$dataNode->attributes}) { … … 1097 1096 } 1098 1097 1099 if (! ($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {1098 if (!$dataNode->extendedAttributes->{"OmitConstructor"}) { 1100 1099 my $getter = "js" . $interfaceName . "Constructor"; 1101 1100 push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n"); … … 1138 1137 # - Add all attributes in a hashtable definition 1139 1138 my $numAttributes = @{$dataNode->attributes}; 1140 $numAttributes++ if (!($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"}));1139 $numAttributes++ if !$dataNode->extendedAttributes->{"OmitConstructor"}; 1141 1140 1142 1141 return 0 if !$numAttributes; … … 1180 1179 } 1181 1180 1182 if (! ($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {1181 if (!$dataNode->extendedAttributes->{"OmitConstructor"}) { 1183 1182 push(@hashKeys, "constructor"); 1184 1183 my $getter = "js" . $interfaceName . "Constructor"; … … 1339 1338 1340 1339 # - Add all constants 1341 if (! ($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {1340 if (!$dataNode->extendedAttributes->{"OmitConstructor"}) { 1342 1341 my $hashSize = $numConstants; 1343 1342 my $hashName = $className . "ConstructorTable"; … … 1365 1364 my $protoClassName = "${className}Prototype"; 1366 1365 1367 GenerateConstructorDeclaration(\@implContent, $className, $dataNode) unless $dataNode->extendedAttributes->{"CustomConstructFunction"};1366 GenerateConstructorDeclaration(\@implContent, $className, $dataNode) unless ($dataNode->extendedAttributes->{"JSCustomConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"}); 1368 1367 GenerateConstructorDefinition(\@implContent, $className, $protoClassName, $interfaceName, $visibleClassName, $dataNode); 1369 1368 } … … 1554 1553 1555 1554 my $hasGetter = $numAttributes > 0 1556 || !($dataNode->extendedAttributes->{"OmitConstructor"} 1557 || $dataNode->extendedAttributes->{"CustomConstructor"}) 1555 || !$dataNode->extendedAttributes->{"OmitConstructor"} 1558 1556 || $dataNode->extendedAttributes->{"HasIndexGetter"} 1559 1557 || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} … … 1708 1706 } 1709 1707 1710 if (! ($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {1708 if (!$dataNode->extendedAttributes->{"OmitConstructor"}) { 1711 1709 my $constructorFunctionName = "js" . $interfaceName . "Constructor"; 1712 1710 … … 1929 1927 } 1930 1928 1931 if (! ($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {1929 if (!$dataNode->extendedAttributes->{"OmitConstructor"}) { 1932 1930 push(@implContent, "JSValue ${className}::getConstructor(ExecState* exec, JSGlobalObject* globalObject)\n{\n"); 1933 1931 push(@implContent, " return getDOMConstructor<${className}Constructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));\n"); … … 3171 3169 my $constructorClassName = "${className}Constructor"; 3172 3170 my $canConstruct = $dataNode->extendedAttributes->{"CanBeConstructed"}; 3173 my $customConstruct Function = $dataNode->extendedAttributes->{"CustomConstructFunction"};3171 my $customConstructor = $dataNode->extendedAttributes->{"JSCustomConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"}; 3174 3172 my $callWith = $dataNode->extendedAttributes->{"CallWith"}; 3175 3173 my $numberOfconstructParameters = $dataNode->extendedAttributes->{"ConstructorParameters"}; … … 3205 3203 3206 3204 if ($canConstruct) { 3207 if (!$customConstruct Function) {3205 if (!$customConstructor) { 3208 3206 push(@$outputArray, "EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* exec)\n"); 3209 3207 push(@$outputArray, "{\n"); -
trunk/Source/WebCore/css/WebKitCSSMatrix.idl
r94891 r96788 29 29 interface [ 30 30 CanBeConstructed, 31 CustomConstructFunction,31 JSCustomConstructor, 32 32 ConstructorParameters=1, 33 33 Constructor(in [Optional=CallWithNullValue] DOMString cssValue), -
trunk/Source/WebCore/dom/CustomEvent.idl
r94480 r96788 30 30 interface [ 31 31 CanBeConstructed, 32 CustomConstructFunction, 33 V8CustomConstructor 32 CustomConstructor 34 33 ] CustomEvent : Event { 35 34 -
trunk/Source/WebCore/dom/ErrorEvent.idl
r96208 r96788 34 34 NoStaticTables, 35 35 CanBeConstructed, 36 CustomConstructFunction, 37 V8CustomConstructor 36 CustomConstructor 38 37 ] ErrorEvent : Event { 39 38 -
trunk/Source/WebCore/dom/Event.idl
r94424 r96788 25 25 CustomToJS, 26 26 CanBeConstructed, 27 CustomConstructFunction, 28 V8CustomConstructor, 27 CustomConstructor, 29 28 NoStaticTables, 30 29 Polymorphic -
trunk/Source/WebCore/dom/HashChangeEvent.idl
r95063 r96788 23 23 interface [ 24 24 CanBeConstructed, 25 CustomConstructFunction, 26 V8CustomConstructor 25 CustomConstructor 27 26 ] HashChangeEvent : Event { 28 27 void initHashChangeEvent(in [Optional=CallWithDefaultValue] DOMString type, -
trunk/Source/WebCore/dom/MessageChannel.idl
r89269 r96788 29 29 interface [ 30 30 CanBeConstructed, 31 CustomConstructFunction, 32 V8CustomConstructor, 31 CustomConstructor, 33 32 CustomMarkFunction, 34 33 NoStaticTables -
trunk/Source/WebCore/dom/MessageEvent.idl
r96179 r96788 31 31 NoStaticTables, 32 32 CanBeConstructed, 33 CustomConstructFunction33 JSCustomConstructor 34 34 ] MessageEvent : Event { 35 35 readonly attribute DOMString origin; -
trunk/Source/WebCore/dom/PageTransitionEvent.idl
r96180 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor 30 CustomConstructor 32 31 ] PageTransitionEvent : Event { 33 32 -
trunk/Source/WebCore/dom/PopStateEvent.idl
r96212 r96788 30 30 interface [ 31 31 CanBeConstructed, 32 CustomConstructFunction, 33 V8CustomConstructor 32 CustomConstructor, 34 33 ] PopStateEvent : Event { 35 34 void initPopStateEvent(in [Optional=CallWithDefaultValue] DOMString typeArg, -
trunk/Source/WebCore/dom/ProgressEvent.idl
r94946 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor 30 CustomConstructor 32 31 ] ProgressEvent : Event { 33 32 readonly attribute boolean lengthComputable; -
trunk/Source/WebCore/dom/WebKitAnimationEvent.idl
r94953 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor 30 CustomConstructor 32 31 ] WebKitAnimationEvent : Event { 33 32 readonly attribute DOMString animationName; -
trunk/Source/WebCore/html/DOMFormData.idl
r92327 r96788 33 33 interface [ 34 34 CanBeConstructed, 35 CustomConstructFunction, 36 V8CustomConstructor, 35 CustomConstructor, 37 36 GenerateNativeConverter, 38 37 GenerateToJS -
trunk/Source/WebCore/html/canvas/ArrayBuffer.idl
r89269 r96788 29 29 GenerateIsReachable=Impl, 30 30 CanBeConstructed, 31 CustomConstructFunction, 32 NoStaticTables, 33 V8CustomConstructor, 31 CustomConstructor, 32 NoStaticTables 34 33 ] ArrayBuffer { 35 34 readonly attribute int byteLength; -
trunk/Source/WebCore/html/canvas/DataView.idl
r89269 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstruct Function,30 CustomConstructor, 31 31 CustomToJS, 32 32 NoStaticTables, 33 V8CustomConstructor34 33 ] DataView : ArrayBufferView { 35 34 // All these methods raise an exception if they would read or write beyond the end of the view. -
trunk/Source/WebCore/html/canvas/Float32Array.idl
r92443 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor, 30 CustomConstructor, 32 31 HasNumericIndexGetter, 33 32 HasCustomIndexSetter, -
trunk/Source/WebCore/html/canvas/Float64Array.idl
r92443 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor, 30 CustomConstructor, 32 31 HasNumericIndexGetter, 33 32 HasCustomIndexSetter, -
trunk/Source/WebCore/html/canvas/Int16Array.idl
r92443 r96788 27 27 interface [ 28 28 CanBeConstructed, 29 CustomConstructFunction, 30 V8CustomConstructor, 29 CustomConstructor, 31 30 HasNumericIndexGetter, 32 31 HasCustomIndexSetter, -
trunk/Source/WebCore/html/canvas/Int32Array.idl
r92443 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor, 30 CustomConstructor, 32 31 HasNumericIndexGetter, 33 32 HasCustomIndexSetter, -
trunk/Source/WebCore/html/canvas/Int8Array.idl
r92443 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor, 30 CustomConstructor, 32 31 HasNumericIndexGetter, 33 32 HasCustomIndexSetter, -
trunk/Source/WebCore/html/canvas/Uint16Array.idl
r92443 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor, 30 CustomConstructor, 32 31 HasNumericIndexGetter, 33 32 HasCustomIndexSetter, -
trunk/Source/WebCore/html/canvas/Uint32Array.idl
r92443 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor, 30 CustomConstructor, 32 31 HasNumericIndexGetter, 33 32 HasCustomIndexSetter, -
trunk/Source/WebCore/html/canvas/Uint8Array.idl
r92443 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstructFunction, 31 V8CustomConstructor, 30 CustomConstructor, 32 31 HasNumericIndexGetter, 33 32 HasCustomIndexSetter, -
trunk/Source/WebCore/p2p/PeerConnection.idl
r92304 r96788 28 28 Conditional=MEDIA_STREAM, 29 29 CanBeConstructed, 30 CustomConstruct Function,30 CustomConstructor, 31 31 ConstructorParameters=2, 32 V8CustomConstructor,33 32 EventTarget 34 33 ] PeerConnection { -
trunk/Source/WebCore/page/EventSource.idl
r95501 r96788 35 35 ActiveDOMObject, 36 36 CanBeConstructed, 37 CustomConstructFunction,37 JSCustomConstructor, 38 38 ConstructorParameters=1, 39 39 Constructor(in DOMString scriptUrl), -
trunk/Source/WebCore/page/WebKitPoint.idl
r89269 r96788 28 28 interface [ 29 29 CanBeConstructed, 30 CustomConstruct Function,30 CustomConstructor, 31 31 ConstructorParameters=2, 32 V8CustomConstructor33 32 ] WebKitPoint { 34 33 attribute float x; -
trunk/Source/WebCore/webaudio/AudioContext.idl
r94397 r96788 29 29 ActiveDOMObject, 30 30 CanBeConstructed, 31 CustomConstructFunction, 32 V8CustomConstructor, 31 CustomConstructor, 33 32 CustomMarkFunction, 34 33 #if defined(V8_BINDING) && V8_BINDING -
trunk/Source/WebCore/websockets/CloseEvent.idl
r96061 r96788 34 34 NoStaticTables, 35 35 CanBeConstructed, 36 CustomConstructFunction, 37 V8CustomConstructor 36 CustomConstructor 38 37 ] CloseEvent : Event { 39 38 readonly attribute boolean wasClean; -
trunk/Source/WebCore/websockets/WebSocket.idl
r96785 r96788 36 36 ActiveDOMObject, 37 37 CanBeConstructed, 38 CustomConstruct Function,38 CustomConstructor, 39 39 ConstructorParameters=1, 40 V8CustomConstructor,41 40 EventTarget, 42 41 NoStaticTables -
trunk/Source/WebCore/workers/SharedWorker.idl
r89269 r96788 36 36 ActiveDOMObject, 37 37 CanBeConstructed, 38 CustomConstruct Function,38 CustomConstructor, 39 39 ConstructorParameters=2, 40 V8CustomConstructor,41 40 CustomMarkFunction, 42 41 GenerateNativeConverter, -
trunk/Source/WebCore/workers/Worker.idl
r95362 r96788 32 32 ActiveDOMObject, 33 33 CanBeConstructed, 34 CustomConstructFunction,34 JSCustomConstructor, 35 35 ConstructorParameters=1, 36 36 Constructor(in DOMString scriptUrl), -
trunk/Source/WebCore/xml/XMLHttpRequest.idl
r95165 r96788 32 32 ActiveDOMObject, 33 33 CanBeConstructed, 34 CustomConstructFunction, 35 V8CustomConstructor, 34 CustomConstructor, 36 35 CustomMarkFunction, 37 36 EventTarget, -
trunk/Source/WebCore/xml/XSLTProcessor.idl
r94350 r96788 36 36 Conditional=XSLT, 37 37 CanBeConstructed, 38 CustomConstructFunction,38 JSCustomConstructor, 39 39 Constructor 40 40 ] XSLTProcessor {
Note: See TracChangeset
for help on using the changeset viewer.