Changeset 152168 in webkit


Ignore:
Timestamp:
Jun 28, 2013 9:01:32 AM (11 years ago)
Author:
Christophe Dumez
Message:

Get rid of IsWorkerGlobalScope and ExtendsDOMGlobalObject extended attributes
https://bugs.webkit.org/show_bug.cgi?id=118191

Reviewed by Kentaro Hara.

Remove WebKit-specific [IsWorkerGlobalScope] and [ExtendsDOMGlobalObject] IDL
extended attributes and update the JSC bindings generator to figure this out
on its own.

No new tests, no behavior change.

  • bindings/scripts/CodeGeneratorJS.pm:

(IsDOMGlobalObject):
(GenerateHeader):
(GenerateImplementation):
(GenerateConstructorHelperMethods):

  • bindings/scripts/IDLAttributes.txt:
  • page/DOMWindow.idl:
  • workers/DedicatedWorkerGlobalScope.idl:
  • workers/SharedWorkerGlobalScope.idl:
  • workers/WorkerGlobalScope.idl:
Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152167 r152168  
     12013-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
    1252013-06-28  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    226
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r152167 r152168  
    348348}
    349349
     350sub IsDOMGlobalObject
     351{
     352    my $interface = shift;
     353    return $interface->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope");
     354}
     355
    350356sub GenerateGetOwnPropertySlotBody
    351357{
     
    724730    } else {
    725731        # Implementation class forward declaration
    726         if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     732        if (IsDOMGlobalObject($interface)) {
    727733            AddClassForwardIfNeeded($interfaceName) unless $svgPropertyOrListPropertyType;
    728734        }
     
    746752        push(@headerContent, "        return ptr;\n");
    747753        push(@headerContent, "    }\n\n");
    748     } elsif ($interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     754    } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
    749755        push(@headerContent, "    static $className* create(JSC::VM& vm, JSC::Structure* structure, PassRefPtr<$implType> impl)\n");
    750756        push(@headerContent, "    {\n");
     
    773779    }
    774780
    775     if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     781    if (IsDOMGlobalObject($interface)) {
    776782        push(@headerContent, "    static const bool needsDestruction = false;\n\n");
    777783    }
    778784
    779785    # 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);
    781787
    782788    $headerTrailingIncludes{"${className}Custom.h"} = 1 if $interface->extendedAttributes->{"JSCustomHeader"};
     
    852858    push(@headerContent, "    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n");
    853859    push(@headerContent, "    {\n");
    854     if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     860    if (IsDOMGlobalObject($interface)) {
    855861        push(@headerContent, "        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), &s_info);\n");
    856862    } else {
     
    9961002    if ($interfaceName eq "DOMWindow") {
    9971003        push(@headerContent, "    $className(JSC::VM&, JSC::Structure*, PassRefPtr<$implType>, JSDOMWindowShell*);\n");
    998     } elsif ($interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     1004    } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
    9991005        push(@headerContent, "    $className(JSC::VM&, JSC::Structure*, PassRefPtr<$implType>);\n");
    10001006    } else {
     
    10981104    push(@headerContent, "public:\n");
    10991105    push(@headerContent, "    typedef JSC::JSNonFinalObject Base;\n");
    1100     if ($interfaceName ne "DOMWindow" && !$interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     1106    unless (IsDOMGlobalObject($interface)) {
    11011107        push(@headerContent, "    static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);\n");
    11021108    }
     
    17821788        push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleInterfaceName}Prototype\", &Base::s_info, &${className}PrototypeTable, 0, CREATE_METHOD_TABLE(${className}Prototype) };\n\n");
    17831789    }
    1784     if ($interfaceName ne "DOMWindow" && !$interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     1790    unless (IsDOMGlobalObject($interface)) {
    17851791        push(@implContent, "JSObject* ${className}Prototype::self(ExecState* exec, JSGlobalObject* globalObject)\n");
    17861792        push(@implContent, "{\n");
     
    18681874        push(@implContent, "{\n");
    18691875        push(@implContent, "}\n\n");
    1870     } elsif ($interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     1876    } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
    18711877        AddIncludesForTypeInImpl($interfaceName);
    18721878        push(@implContent, "${className}::$className(VM& vm, Structure* structure, PassRefPtr<$implType> impl)\n");
     
    18981904    }
    18991905
    1900     if (!$interface->extendedAttributes->{"ExtendsDOMGlobalObject"}) {
     1906    unless (IsDOMGlobalObject($interface)) {
    19011907        push(@implContent, "JSObject* ${className}::createPrototype(ExecState* exec, JSGlobalObject* globalObject)\n");
    19021908        push(@implContent, "{\n");
     
    20712077                    push(@implContent, "    if (EventListener* listener = impl->$implGetterFunctionName()) {\n");
    20722078                    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")) {
    20742080                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl))\n");
    20752081                    } else {
     
    25222528                    push(@implContent, "    if (!castedThis)\n");
    25232529                    push(@implContent, "        return throwVMTypeError(exec);\n");
    2524                 } elsif ($interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     2530                } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
    25252531                    push(@implContent, "    $className* castedThis = to${className}(exec->hostThisValue().toThisObject(exec));\n");
    25262532                    push(@implContent, "    if (!castedThis)\n");
     
    43054311    push(@$outputArray, "void ${constructorClassName}::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)\n");
    43064312    push(@$outputArray, "{\n");
    4307     if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerGlobalScope"}) {
     4313    if (IsDOMGlobalObject($interface)) {
    43084314        push(@$outputArray, "    Base::finishCreation(exec->vm());\n");
    43094315        push(@$outputArray, "    ASSERT(inherits(&s_info));\n");
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt

    r152100 r152168  
    5858EnforceRange
    5959EventTarget
    60 ExtendsDOMGlobalObject
    6160GenerateIsReachable=|Impl|ImplContext|ImplDocument|ImplElementRoot|ImplFrame|ImplOwnerNodeRoot
    6261GetterRaisesException
     
    6968InterfaceName=*
    7069IsIndex
    71 IsWorkerGlobalScope
    7270JSCustomDefineOwnProperty
    7371JSCustomDefineOwnPropertyOnPrototype
  • trunk/Source/WebCore/page/DOMWindow.idl

    r151908 r152168  
    3535    CustomPutFunction,
    3636    EventTarget,
    37     ExtendsDOMGlobalObject,
    3837    JSGenerateToNativeObject,
    3938    ReplaceableConstructor,
  • trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl

    r152100 r152168  
    3232    GlobalContext=DedicatedWorkerGlobalScope,
    3333    Conditional=WORKERS,
    34     ExtendsDOMGlobalObject,
    35     IsWorkerGlobalScope,
    3634    JSGenerateToNativeObject,
    3735    JSNoStaticTables,
  • trunk/Source/WebCore/workers/SharedWorkerGlobalScope.idl

    r152100 r152168  
    3232    GlobalContext=SharedWorkerGlobalScope,
    3333    Conditional=SHARED_WORKERS,
    34     ExtendsDOMGlobalObject,
    35     IsWorkerGlobalScope,
    3634    JSGenerateToNativeObject,
    3735    JSNoStaticTables,
  • trunk/Source/WebCore/workers/WorkerGlobalScope.idl

    r152100 r152168  
    3131    JSCustomGetOwnPropertySlotAndDescriptor,
    3232    EventTarget,
    33     ExtendsDOMGlobalObject,
    34     IsWorkerGlobalScope,
    3533    JSLegacyParent=JSWorkerGlobalScopeBase,
    3634    JSNoStaticTables,
Note: See TracChangeset for help on using the changeset viewer.