Automatically generate WorkerContext constructor attributes
authorch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jun 2013 14:17:51 +0000 (14:17 +0000)
committerch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jun 2013 14:17:51 +0000 (14:17 +0000)
commit14b03d467b9e1598fe8aab4d10d8ea5bfb9a284e
treedb944841e1c9243db2c428d6d6e32a5f238b7e41
parentcfee7925083a759e570de59ddbfa5c4e348a31c5
Automatically generate WorkerContext constructor attributes
https://bugs.webkit.org/show_bug.cgi?id=117183

Reviewed by Kentaro Hara.

.:

Update GENERATE_BINDINGS macro to take an additional _workercontext_constructors_file
optional argument.

* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

Add [GlobalContext=WindowOnly|WorkerOnly|WindowAndWorker] IDL extended attribute
to indicate to the bindings generator on which global context the constructor
attribute should be generated for interfaces without [NoInterfaceObject]:
- WindowOnly: only on the global Window object (default if ommitted)
- WorkerOnly: only on the worker context
- WindowAndWorker: On both the global Window object and the worker context

This covers all the current use cases.

The JSC bindings generator now automatically generates the Constructor attributes
on the WorkerContext for non-callback interfaces which do not have the
[NoInterfaceObject] extended attribute but have [GlobalContext=WorkerOnly|WindowAndWorker]
extended attribute.

No new tests, already covered by:
fast/js/global-constructors-attributes.html
fast/js/global-constructors-attributes-worker.html

* CMakeLists.txt:
* DerivedSources.make: Pass new --workerContextConstructorsFile argument to preprocess-idls.pl.
* DerivedSources.pri: Ditto.
* GNUmakefile.am: Ditto.
* PlatformBlackBerry.cmake: Ditto.
* UseJSC.cmake: Ditto.
* bindings/scripts/IDLAttributes.txt: Add [GlobalContext=WindowOnly|WorkerOnly|WindowAndWorker]
IDL extended attribute.
* bindings/scripts/preprocess-idls.pl: Add support for [GlobalContext] extended attribute and
generate a partial interface for WorkerContext global constructors that are automatically
generated.
* dom/MessageEvent.idl: Add [GlobalContext=WindowAndWorker].
* fileapi/Blob.idl: Add [GlobalContext=WindowAndWorker].
* fileapi/FileReader.idl: Add [GlobalContext=WindowAndWorker].
* fileapi/FileReaderSync.idl: Add [GlobalContext=WorkerOnly] and remove [NoInterfaceObject]
as the interface should only be visible in worker environment as per the spec.
* html/DOMURL.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/ArrayBuffer.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/DataView.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Float32Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Float64Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Int16Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Int32Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Int8Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Uint16Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Uint32Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Uint8Array.idl: Add [GlobalContext=WindowAndWorker].
* html/canvas/Uint8ClampedArray.idl: Add [GlobalContext=WindowAndWorker].
* workers/WorkerContext.idl: Remove several Constructor attributes which are now automatically
generated.
* workers/WorkerLocation.idl: Add [GlobalContext=WorkerOnly] and remove [NoInterfaceObject]
as the interface should only be visible in worker environment as per the spec.

Tools:

Pass new --workerContextConstructorsFile to preprocess-idl.pl for bindings
tests.

* Scripts/webkitpy/bindings/main.py:
(BindingsTests.generate_supplemental_dependency):
(BindingsTests.main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
ChangeLog
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.am
Source/WebCore/PlatformBlackBerry.cmake
Source/WebCore/UseJSC.cmake
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/preprocess-idls.pl
Source/WebCore/dom/MessageEvent.idl
Source/WebCore/fileapi/Blob.idl
Source/WebCore/fileapi/FileReader.idl
Source/WebCore/fileapi/FileReaderSync.idl
Source/WebCore/html/DOMURL.idl
Source/WebCore/html/canvas/ArrayBuffer.idl
Source/WebCore/html/canvas/DataView.idl
Source/WebCore/html/canvas/Float32Array.idl
Source/WebCore/html/canvas/Float64Array.idl
Source/WebCore/html/canvas/Int16Array.idl
Source/WebCore/html/canvas/Int32Array.idl
Source/WebCore/html/canvas/Int8Array.idl
Source/WebCore/html/canvas/Uint16Array.idl
Source/WebCore/html/canvas/Uint32Array.idl
Source/WebCore/html/canvas/Uint8Array.idl
Source/WebCore/html/canvas/Uint8ClampedArray.idl
Source/WebCore/workers/WorkerContext.idl
Source/WebCore/workers/WorkerLocation.idl
Source/cmake/WebKitMacros.cmake
Tools/ChangeLog
Tools/Scripts/webkitpy/bindings/main.py