Changeset 152168 in webkit
- Timestamp:
- Jun 28, 2013 9:01:32 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152167 r152168 1 2013-06-28 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 Get rid of IsWorkerGlobalScope and ExtendsDOMGlobalObject extended attributes 4 https://bugs.webkit.org/show_bug.cgi?id=118191 5 6 Reviewed by Kentaro Hara. 7 8 Remove WebKit-specific [IsWorkerGlobalScope] and [ExtendsDOMGlobalObject] IDL 9 extended attributes and update the JSC bindings generator to figure this out 10 on its own. 11 12 No new tests, no behavior change. 13 14 * bindings/scripts/CodeGeneratorJS.pm: 15 (IsDOMGlobalObject): 16 (GenerateHeader): 17 (GenerateImplementation): 18 (GenerateConstructorHelperMethods): 19 * bindings/scripts/IDLAttributes.txt: 20 * page/DOMWindow.idl: 21 * workers/DedicatedWorkerGlobalScope.idl: 22 * workers/SharedWorkerGlobalScope.idl: 23 * workers/WorkerGlobalScope.idl: 24 1 25 2013-06-28 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 26 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r152167 r152168 348 348 } 349 349 350 sub IsDOMGlobalObject 351 { 352 my $interface = shift; 353 return $interface->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope"); 354 } 355 350 356 sub GenerateGetOwnPropertySlotBody 351 357 { … … 724 730 } else { 725 731 # Implementation class forward declaration 726 if ( $interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {732 if (IsDOMGlobalObject($interface)) { 727 733 AddClassForwardIfNeeded($interfaceName) unless $svgPropertyOrListPropertyType; 728 734 } … … 746 752 push(@headerContent, " return ptr;\n"); 747 753 push(@headerContent, " }\n\n"); 748 } elsif ($ interface->extendedAttributes->{"IsWorkerGlobalScope"}) {754 } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) { 749 755 push(@headerContent, " static $className* create(JSC::VM& vm, JSC::Structure* structure, PassRefPtr<$implType> impl)\n"); 750 756 push(@headerContent, " {\n"); … … 773 779 } 774 780 775 if ( $interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {781 if (IsDOMGlobalObject($interface)) { 776 782 push(@headerContent, " static const bool needsDestruction = false;\n\n"); 777 783 } 778 784 779 785 # Prototype 780 push(@headerContent, " static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);\n") unless ($interface->extendedAttributes->{"ExtendsDOMGlobalObject"});786 push(@headerContent, " static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);\n") unless IsDOMGlobalObject($interface); 781 787 782 788 $headerTrailingIncludes{"${className}Custom.h"} = 1 if $interface->extendedAttributes->{"JSCustomHeader"}; … … 852 858 push(@headerContent, " static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n"); 853 859 push(@headerContent, " {\n"); 854 if ( $interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {860 if (IsDOMGlobalObject($interface)) { 855 861 push(@headerContent, " return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), &s_info);\n"); 856 862 } else { … … 996 1002 if ($interfaceName eq "DOMWindow") { 997 1003 push(@headerContent, " $className(JSC::VM&, JSC::Structure*, PassRefPtr<$implType>, JSDOMWindowShell*);\n"); 998 } elsif ($ interface->extendedAttributes->{"IsWorkerGlobalScope"}) {1004 } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) { 999 1005 push(@headerContent, " $className(JSC::VM&, JSC::Structure*, PassRefPtr<$implType>);\n"); 1000 1006 } else { … … 1098 1104 push(@headerContent, "public:\n"); 1099 1105 push(@headerContent, " typedef JSC::JSNonFinalObject Base;\n"); 1100 if ($interfaceName ne "DOMWindow" && !$interface->extendedAttributes->{"IsWorkerGlobalScope"}) {1106 unless (IsDOMGlobalObject($interface)) { 1101 1107 push(@headerContent, " static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);\n"); 1102 1108 } … … 1782 1788 push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleInterfaceName}Prototype\", &Base::s_info, &${className}PrototypeTable, 0, CREATE_METHOD_TABLE(${className}Prototype) };\n\n"); 1783 1789 } 1784 if ($interfaceName ne "DOMWindow" && !$interface->extendedAttributes->{"IsWorkerGlobalScope"}) {1790 unless (IsDOMGlobalObject($interface)) { 1785 1791 push(@implContent, "JSObject* ${className}Prototype::self(ExecState* exec, JSGlobalObject* globalObject)\n"); 1786 1792 push(@implContent, "{\n"); … … 1868 1874 push(@implContent, "{\n"); 1869 1875 push(@implContent, "}\n\n"); 1870 } elsif ($ interface->extendedAttributes->{"IsWorkerGlobalScope"}) {1876 } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) { 1871 1877 AddIncludesForTypeInImpl($interfaceName); 1872 1878 push(@implContent, "${className}::$className(VM& vm, Structure* structure, PassRefPtr<$implType> impl)\n"); … … 1898 1904 } 1899 1905 1900 if (!$interface->extendedAttributes->{"ExtendsDOMGlobalObject"}) {1906 unless (IsDOMGlobalObject($interface)) { 1901 1907 push(@implContent, "JSObject* ${className}::createPrototype(ExecState* exec, JSGlobalObject* globalObject)\n"); 1902 1908 push(@implContent, "{\n"); … … 2071 2077 push(@implContent, " if (EventListener* listener = impl->$implGetterFunctionName()) {\n"); 2072 2078 push(@implContent, " if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n"); 2073 if ($interfaceName eq "Document" || $ interfaceName eq "WorkerGlobalScope" || $interfaceName eq "SharedWorkerGlobalScope" || $interfaceName eq "DedicatedWorkerGlobalScope") {2079 if ($interfaceName eq "Document" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) { 2074 2080 push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(impl))\n"); 2075 2081 } else { … … 2522 2528 push(@implContent, " if (!castedThis)\n"); 2523 2529 push(@implContent, " return throwVMTypeError(exec);\n"); 2524 } elsif ($ interface->extendedAttributes->{"IsWorkerGlobalScope"}) {2530 } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) { 2525 2531 push(@implContent, " $className* castedThis = to${className}(exec->hostThisValue().toThisObject(exec));\n"); 2526 2532 push(@implContent, " if (!castedThis)\n"); … … 4305 4311 push(@$outputArray, "void ${constructorClassName}::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)\n"); 4306 4312 push(@$outputArray, "{\n"); 4307 if ( $interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {4313 if (IsDOMGlobalObject($interface)) { 4308 4314 push(@$outputArray, " Base::finishCreation(exec->vm());\n"); 4309 4315 push(@$outputArray, " ASSERT(inherits(&s_info));\n"); -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt
r152100 r152168 58 58 EnforceRange 59 59 EventTarget 60 ExtendsDOMGlobalObject61 60 GenerateIsReachable=|Impl|ImplContext|ImplDocument|ImplElementRoot|ImplFrame|ImplOwnerNodeRoot 62 61 GetterRaisesException … … 69 68 InterfaceName=* 70 69 IsIndex 71 IsWorkerGlobalScope72 70 JSCustomDefineOwnProperty 73 71 JSCustomDefineOwnPropertyOnPrototype -
trunk/Source/WebCore/page/DOMWindow.idl
r151908 r152168 35 35 CustomPutFunction, 36 36 EventTarget, 37 ExtendsDOMGlobalObject,38 37 JSGenerateToNativeObject, 39 38 ReplaceableConstructor, -
trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl
r152100 r152168 32 32 GlobalContext=DedicatedWorkerGlobalScope, 33 33 Conditional=WORKERS, 34 ExtendsDOMGlobalObject,35 IsWorkerGlobalScope,36 34 JSGenerateToNativeObject, 37 35 JSNoStaticTables, -
trunk/Source/WebCore/workers/SharedWorkerGlobalScope.idl
r152100 r152168 32 32 GlobalContext=SharedWorkerGlobalScope, 33 33 Conditional=SHARED_WORKERS, 34 ExtendsDOMGlobalObject,35 IsWorkerGlobalScope,36 34 JSGenerateToNativeObject, 37 35 JSNoStaticTables, -
trunk/Source/WebCore/workers/WorkerGlobalScope.idl
r152100 r152168 31 31 JSCustomGetOwnPropertySlotAndDescriptor, 32 32 EventTarget, 33 ExtendsDOMGlobalObject,34 IsWorkerGlobalScope,35 33 JSLegacyParent=JSWorkerGlobalScopeBase, 36 34 JSNoStaticTables,
Note: See TracChangeset
for help on using the changeset viewer.