IDL functions and attributes should be JSBuiltin by default if interface is marked...
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 11:00:35 +0000 (11:00 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 11:00:35 +0000 (11:00 +0000)
commit9b4387159aa5fc7694ee6c7d27f0cce3f9047af9
tree08e66176467e92df55711a6aa959bc868612900a
parent5e46637eaa4d32d642ca0ab24e8d942dcc37f101
IDL functions and attributes should be JSBuiltin by default if interface is marked as JSBuiltinConstructor
https://bugs.webkit.org/show_bug.cgi?id=150438

Reviewed by Darin Adler.

Binding generator is now deducing that function/attribute is JSBuiltin if the interface is marked as JSBuiltin.
One exception is custom setters, getters or functions which remain C++ handled.
Updated streams API IDLs accordingly.

Binding generator knows whether class needs a DOM class by checking whether the interface is marked as JSBuiltin.
Binding generator knows that class uses a JS built-in constructor if marked as JSBuiltin+Constructor.
In particular, JSBuiltIn+CustomConstructor means that a DOM class is not needed and constructor is not JS built-in.

Applied JSBuiltin+CustomConstructor to ReadableStreamReader and ReadableStreamController.
Removing ReadableStreamReader and ReadableStreamController classes.

Removed unneeded "Default" keyword for cancel function in WebIDL.

Added a binding test case.
No change in behavior.

* Modules/streams/ByteLengthQueuingStrategy.idl: Marking interface as JSBuiltin and Constructable.
* Modules/streams/CountQueuingStrategy.idl: Ditto.
* Modules/streams/ReadableStream.idl: Ditto.
* Modules/streams/ReadableStreamController.h: Removed.
* Modules/streams/ReadableStreamController.idl: Marking interface as JSBuiltin and Constructable.
* Modules/streams/ReadableStreamReader.h: Removed.
* Modules/streams/ReadableStreamReader.idl: Marking interface as JSBuiltin and Constructable.
* Modules/streams/WritableStream.idl: Ditto.
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::JSBuiltinReadableStreamReaderPrivateConstructor::createJSObject): Updated according new constructor.
(WebCore::JSBuiltinReadableStreamControllerPrivateConstructor::createJSObject): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsImplementationClass):
(GetAttributeGetterName):
(GetAttributeSetterName):
(GetFunctionName):
(InstanceNeedsVisitChildren):
(GenerateHeader):
(GenerateAttributesHashTable):
(GenerateImplementation):
(GetConstructorTemplateClassName):
(GenerateConstructorDefinition):
(GenerateConstructorHelperMethods):
(IsConstructable):
(ComputeFunctionSpecial):
(IsJSBuiltin):
(IsJSBuiltinConstructor):
(AddJSBuiltinIncludesIfNeeded):
(GetJSBuiltinFunctionName): Deleted.
(GetJSBuiltinFunctionNameFromString): Deleted.
(GetJSBuiltinScopeName): Deleted.
* bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.cpp:
(webkit_dom_test_js_builtin_constructor_set_property):
(webkit_dom_test_js_builtin_constructor_get_property):
(webkit_dom_test_js_builtin_constructor_class_init):
(webkit_dom_test_js_builtin_constructor_test_function):
(webkit_dom_test_js_builtin_constructor_get_test_attribute):
(webkit_dom_test_js_builtin_constructor_set_test_attribute):
* bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor):
(WebCore::JSTestJSBuiltinConstructor::getOwnPropertySlot):
(WebCore::jsTestJSBuiltinConstructorTestAttribute):
(WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
(WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
(WebCore::setJSTestJSBuiltinConstructorTestAttribute):
(WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
(WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestFunction):
(WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction):
(WebCore::JSTestJSBuiltinConstructorOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestJSBuiltinConstructorOwner::finalize):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
(WebCore::JSTestJSBuiltinConstructor::toWrapped):
(WebCore::JSTestJSBuiltinConstructorPrototype::createStructure): Deleted.
(WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties): Deleted.
(WebCore::JSTestJSBuiltinConstructor::createPrototype): Deleted.
(WebCore::JSTestJSBuiltinConstructor::getPrototype): Deleted.
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
(WebCore::JSTestJSBuiltinConstructor::create):
(WebCore::JSTestJSBuiltinConstructor::finishCreation):
(WebCore::wrapperOwner):
(WebCore::toJS):
(WebCore::JSTestJSBuiltinConstructor::createStructure): Deleted.
* bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.h:
* bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm:
(-[DOMTestJSBuiltinConstructor testAttribute]):
(-[DOMTestJSBuiltinConstructor setTestAttribute:]):
(-[DOMTestJSBuiltinConstructor testAttributeCustom]):
(-[DOMTestJSBuiltinConstructor testAttributeRWCustom]):
(-[DOMTestJSBuiltinConstructor setTestAttributeRWCustom:]):
(-[DOMTestJSBuiltinConstructor testFunction]):
(-[DOMTestJSBuiltinConstructor testCustomFunction]):
* bindings/scripts/test/TestJSBuiltinConstructor.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl
Source/WebCore/Modules/streams/CountQueuingStrategy.idl
Source/WebCore/Modules/streams/ReadableStream.idl
Source/WebCore/Modules/streams/ReadableStreamController.h [deleted file]
Source/WebCore/Modules/streams/ReadableStreamController.idl
Source/WebCore/Modules/streams/ReadableStreamReader.h [deleted file]
Source/WebCore/Modules/streams/ReadableStreamReader.idl
Source/WebCore/Modules/streams/WritableStream.idl
Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm
Source/WebCore/bindings/scripts/test/TestCustomConstructor.idl
Source/WebCore/bindings/scripts/test/TestJSBuiltinConstructor.idl