Get rid of [Callback] IDL extended attribute for parameters

https://bugs.webkit.org/show_bug.cgi?id=115250

Reviewed by Kentaro Hara.

Remove the WebKit-specific [Callback] extended attribute and make the bindings
generator smart enough to know when a parameter is of callback type on its
own.

No new tests, no behavior change.

* DerivedSources.make: Use WebCore/Modules as IDL include path instead of using
subdirs. The generator will search recursively anyway and the list of subdirs was
incomplete.
* Modules/filesystem/DOMWindowFileSystem.idl:
* Modules/filesystem/DirectoryEntry.idl:
* Modules/filesystem/DirectoryReader.idl:
* Modules/filesystem/Entry.idl:
* Modules/filesystem/FileEntry.idl:
* Modules/filesystem/WorkerContextFileSystem.idl:
* Modules/mediastream/NavigatorMediaStream.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/notifications/Notification.idl:
* Modules/notifications/NotificationCenter.idl:
* Modules/quota/StorageInfo.idl:
* Modules/quota/StorageQuota.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* Modules/webdatabase/Database.idl:
* Modules/webdatabase/DatabaseSync.idl:
* Modules/webdatabase/SQLTransaction.idl:
* Modules/webdatabase/WorkerContextWebDatabase.idl:
* bindings/gobject/GNUmakefile.am: Add missing IDL include dirs.
* bindings/scripts/CodeGenerator.pm:
(IsWrapperType):
(IsCallbackInterface):
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheckExpression):
(GenerateParametersCheck):
* bindings/scripts/IDLAttributes.txt: Remove "Callback" extended attribute.
* bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
(WebDOMTestCallback::callbackWithArrayParam):
(WebDOMTestCallback::callbackWithSerializedScriptValueParam):
(WebDOMTestCallback::callbackWithNonBoolReturnType):
(WebDOMTestCallback::callbackRequiresThisToPass):
* bindings/scripts/test/CPP/WebDOMTestCallback.h:
(WebDOMTestCallback):
* bindings/scripts/test/CPP/WebDOMTestObj.cpp:
(WebDOMTestObj::convert1):
(WebDOMTestObj::convert2):
(WebDOMTestObj::convert4):
(WebDOMTestObj::convert5):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp:
(WebDOMTestSerializedScriptValueInterface::acceptTransferList):
(WebDOMTestSerializedScriptValueInterface::multiTransferList):
* bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h:
(WebDOMTestSerializedScriptValueInterface):
* bindings/scripts/test/CPP/WebDOMTestTypedefs.cpp:
(WebDOMTestTypedefs::multiTransferList):
* bindings/scripts/test/CPP/WebDOMTestTypedefs.h:
(WebDOMTestTypedefs):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
(webkit_dom_test_callback_callback_with_array_param):
(webkit_dom_test_callback_callback_with_serialized_script_value_param):
(webkit_dom_test_callback_callback_with_non_bool_return_type):
(webkit_dom_test_callback_callback_requires_this_to_pass):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_convert1):
(webkit_dom_test_obj_convert2):
(webkit_dom_test_obj_convert4):
(webkit_dom_test_obj_convert5):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
(webkit_dom_test_serialized_script_value_interface_accept_transfer_list):
(webkit_dom_test_serialized_script_value_interface_multi_transfer_list):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
(webkit_dom_test_typedefs_multi_transfer_list):
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::callbackWithArrayParam):
(WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
(WebCore::JSTestCallback::callbackRequiresThisToPass):
* bindings/scripts/test/JS/JSTestCallback.h:
(JSTestCallback):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionConvert1):
(WebCore::jsTestObjPrototypeFunctionConvert2):
(WebCore::jsTestObjPrototypeFunctionConvert4):
(WebCore::jsTestObjPrototypeFunctionConvert5):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionMultiTransferList):
* bindings/scripts/test/ObjC/DOMTestCallback.h:
* bindings/scripts/test/ObjC/DOMTestCallback.mm:
(-[DOMTestCallback callbackWithArrayParam:]):
(-[DOMTestCallback callbackWithSerializedScriptValueParam:strArg:]):
(-[DOMTestCallback callbackWithNonBoolReturnType:]):
(-[DOMTestCallback callbackRequiresThisToPass:testNodeParam:]):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj convert1:]):
(-[DOMTestObj convert2:]):
(-[DOMTestObj convert4:]):
(-[DOMTestObj convert5:]):
* bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
(-[DOMTestSerializedScriptValueInterface acceptTransferList:transferList:]):
(-[DOMTestSerializedScriptValueInterface multiTransferList:tx:second:txx:]):
* bindings/scripts/test/ObjC/DOMTestTypedefs.h:
* bindings/scripts/test/ObjC/DOMTestTypedefs.mm:
(-[DOMTestTypedefs multiTransferList:tx:second:txx:]):
* bindings/scripts/test/TestCallback.idl: Use valid types instead of Class1, Class2, ...
so that the bindings generator does not complain about not being able to resolve
them.
* bindings/scripts/test/TestObj.idl: Use valid parameter types instead of 'a', 'b', 'd', 'e'
so that the bindings generator does not complain about them.
* bindings/scripts/test/TestSerializedScriptValueInterface.idl:
* bindings/scripts/test/TestTypedefs.idl:
* css/FontLoader.idl:
* dom/DataTransferItem.idl:
* page/DOMWindow.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4825c416
2013-04-28 Christophe Dumez <ch.dumez@sisa.samsung.com>
Get rid of [Callback] IDL extended attribute for parameters
https://bugs.webkit.org/show_bug.cgi?id=115250
Reviewed by Kentaro Hara.
Remove the WebKit-specific [Callback] extended attribute and make the bindings
generator smart enough to know when a parameter is of callback type on its
own.
No new tests, no behavior change.
* DerivedSources.make: Use WebCore/Modules as IDL include path instead of using
subdirs. The generator will search recursively anyway and the list of subdirs was
incomplete.
* Modules/filesystem/DOMWindowFileSystem.idl:
* Modules/filesystem/DirectoryEntry.idl:
* Modules/filesystem/DirectoryReader.idl:
* Modules/filesystem/Entry.idl:
* Modules/filesystem/FileEntry.idl:
* Modules/filesystem/WorkerContextFileSystem.idl:
* Modules/mediastream/NavigatorMediaStream.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/notifications/Notification.idl:
* Modules/notifications/NotificationCenter.idl:
* Modules/quota/StorageInfo.idl:
* Modules/quota/StorageQuota.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* Modules/webdatabase/Database.idl:
* Modules/webdatabase/DatabaseSync.idl:
* Modules/webdatabase/SQLTransaction.idl:
* Modules/webdatabase/WorkerContextWebDatabase.idl:
* bindings/gobject/GNUmakefile.am: Add missing IDL include dirs.
* bindings/scripts/CodeGenerator.pm:
(IsWrapperType):
(IsCallbackInterface):
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheckExpression):
(GenerateParametersCheck):
* bindings/scripts/IDLAttributes.txt: Remove "Callback" extended attribute.
* bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
(WebDOMTestCallback::callbackWithArrayParam):
(WebDOMTestCallback::callbackWithSerializedScriptValueParam):
(WebDOMTestCallback::callbackWithNonBoolReturnType):
(WebDOMTestCallback::callbackRequiresThisToPass):
* bindings/scripts/test/CPP/WebDOMTestCallback.h:
(WebDOMTestCallback):
* bindings/scripts/test/CPP/WebDOMTestObj.cpp:
(WebDOMTestObj::convert1):
(WebDOMTestObj::convert2):
(WebDOMTestObj::convert4):
(WebDOMTestObj::convert5):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp:
(WebDOMTestSerializedScriptValueInterface::acceptTransferList):
(WebDOMTestSerializedScriptValueInterface::multiTransferList):
* bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h:
(WebDOMTestSerializedScriptValueInterface):
* bindings/scripts/test/CPP/WebDOMTestTypedefs.cpp:
(WebDOMTestTypedefs::multiTransferList):
* bindings/scripts/test/CPP/WebDOMTestTypedefs.h:
(WebDOMTestTypedefs):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
(webkit_dom_test_callback_callback_with_array_param):
(webkit_dom_test_callback_callback_with_serialized_script_value_param):
(webkit_dom_test_callback_callback_with_non_bool_return_type):
(webkit_dom_test_callback_callback_requires_this_to_pass):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_convert1):
(webkit_dom_test_obj_convert2):
(webkit_dom_test_obj_convert4):
(webkit_dom_test_obj_convert5):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
(webkit_dom_test_serialized_script_value_interface_accept_transfer_list):
(webkit_dom_test_serialized_script_value_interface_multi_transfer_list):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
(webkit_dom_test_typedefs_multi_transfer_list):
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::callbackWithArrayParam):
(WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
(WebCore::JSTestCallback::callbackRequiresThisToPass):
* bindings/scripts/test/JS/JSTestCallback.h:
(JSTestCallback):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionConvert1):
(WebCore::jsTestObjPrototypeFunctionConvert2):
(WebCore::jsTestObjPrototypeFunctionConvert4):
(WebCore::jsTestObjPrototypeFunctionConvert5):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionMultiTransferList):
* bindings/scripts/test/ObjC/DOMTestCallback.h:
* bindings/scripts/test/ObjC/DOMTestCallback.mm:
(-[DOMTestCallback callbackWithArrayParam:]):
(-[DOMTestCallback callbackWithSerializedScriptValueParam:strArg:]):
(-[DOMTestCallback callbackWithNonBoolReturnType:]):
(-[DOMTestCallback callbackRequiresThisToPass:testNodeParam:]):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj convert1:]):
(-[DOMTestObj convert2:]):
(-[DOMTestObj convert4:]):
(-[DOMTestObj convert5:]):
* bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
(-[DOMTestSerializedScriptValueInterface acceptTransferList:transferList:]):
(-[DOMTestSerializedScriptValueInterface multiTransferList:tx:second:txx:]):
* bindings/scripts/test/ObjC/DOMTestTypedefs.h:
* bindings/scripts/test/ObjC/DOMTestTypedefs.mm:
(-[DOMTestTypedefs multiTransferList:tx:second:txx:]):
* bindings/scripts/test/TestCallback.idl: Use valid types instead of Class1, Class2, ...
so that the bindings generator does not complain about not being able to resolve
them.
* bindings/scripts/test/TestObj.idl: Use valid parameter types instead of 'a', 'b', 'd', 'e'
so that the bindings generator does not complain about them.
* bindings/scripts/test/TestSerializedScriptValueInterface.idl:
* bindings/scripts/test/TestTypedefs.idl:
* css/FontLoader.idl:
* dom/DataTransferItem.idl:
* page/DOMWindow.idl:
2013-04-27 Darin Adler <darin@apple.com>
Move from constructor and member function adoptCF/NS to free function adoptCF/NS.
......
......@@ -970,21 +970,7 @@ preprocess_idls_script = perl $(addprefix -I $(WebCore)/, $(sort $(dir $(1)))) $
# JS bindings generator
IDL_INCLUDES = \
$(WebCore)/Modules/battery \
$(WebCore)/Modules/encryptedmedia \
$(WebCore)/Modules/filesystem \
$(WebCore)/Modules/gamepad \
$(WebCore)/Modules/geolocation \
$(WebCore)/Modules/indexeddb \
$(WebCore)/Modules/mediasource \
$(WebCore)/Modules/mediastream \
$(WebCore)/Modules/networkinfo \
$(WebCore)/Modules/notifications \
$(WebCore)/Modules/speech \
$(WebCore)/Modules/vibration \
$(WebCore)/Modules/webaudio \
$(WebCore)/Modules/webdatabase \
$(WebCore)/Modules/websockets \
$(WebCore)/Modules \
$(WebCore)/css \
$(WebCore)/dom \
$(WebCore)/fileapi \
......
......@@ -31,8 +31,8 @@
const unsigned short PERSISTENT = 1;
void webkitRequestFileSystem(in unsigned short type, in long long size,
in [Callback] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
in FileSystemCallback successCallback, in [Optional] ErrorCallback errorCallback);
void webkitResolveLocalFileSystemURL(in DOMString url,
in [Callback] EntryCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
in EntryCallback successCallback, in [Optional] ErrorCallback errorCallback);
};
......@@ -35,7 +35,7 @@
JSNoStaticTables
] interface DirectoryEntry : Entry {
DirectoryReader createReader();
void getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void removeRecursively(in [Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional] EntryCallback successCallback, in [Optional] ErrorCallback errorCallback);
void getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional] EntryCallback successCallback, in [Optional] ErrorCallback errorCallback);
void removeRecursively(in VoidCallback successCallback, in [Optional] ErrorCallback errorCallback);
};
......@@ -33,5 +33,5 @@
JSNoStaticTables,
ImplementationLacksVTable
] interface DirectoryReader {
void readEntries(in [Callback] EntriesCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void readEntries(in EntriesCallback successCallback, in [Optional] ErrorCallback errorCallback);
};
......@@ -39,10 +39,10 @@
readonly attribute DOMString fullPath;
readonly attribute DOMFileSystem filesystem;
void getMetadata(in [Callback] MetadataCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void moveTo(in DirectoryEntry parent, in [Optional, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void copyTo(in DirectoryEntry parent, in [Optional, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void getMetadata(in MetadataCallback successCallback, in [Optional] ErrorCallback errorCallback);
void moveTo(in DirectoryEntry parent, in [Optional, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString name, in [Optional] EntryCallback successCallback, in [Optional] ErrorCallback errorCallback);
void copyTo(in DirectoryEntry parent, in [Optional, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString name, in [Optional] EntryCallback successCallback, in [Optional] ErrorCallback errorCallback);
DOMString toURL();
void remove(in [Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void getParent(in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void remove(in VoidCallback successCallback, in [Optional] ErrorCallback errorCallback);
void getParent(in [Optional] EntryCallback successCallback, in [Optional] ErrorCallback errorCallback);
};
......@@ -34,6 +34,6 @@
JSGenerateToJSObject,
JSNoStaticTables
] interface FileEntry : Entry {
void createWriter(in [Callback] FileWriterCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void file(in [Callback] FileCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void createWriter(in FileWriterCallback successCallback, in [Optional] ErrorCallback errorCallback);
void file(in FileCallback successCallback, in [Optional] ErrorCallback errorCallback);
};
......@@ -30,9 +30,9 @@
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
void webkitRequestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
void webkitRequestFileSystem(in unsigned short type, in long long size, in [Optional] FileSystemCallback successCallback, in [Optional] ErrorCallback errorCallback);
DOMFileSystemSync webkitRequestFileSystemSync(in unsigned short type, in long long size) raises (FileException);
void webkitResolveLocalFileSystemURL(in DOMString url, in [Callback] EntryCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
void webkitResolveLocalFileSystemURL(in DOMString url, in EntryCallback successCallback, in [Optional] ErrorCallback errorCallback);
EntrySync webkitResolveLocalFileSystemSyncURL(in DOMString url) raises (FileException);
attribute FileErrorConstructor FileError;
......
......@@ -21,8 +21,8 @@
Conditional=MEDIA_STREAM,
] partial interface Navigator {
void webkitGetUserMedia(in Dictionary options,
in [Callback] NavigatorUserMediaSuccessCallback successCallback,
in [Callback, Optional] NavigatorUserMediaErrorCallback errorCallback)
in NavigatorUserMediaSuccessCallback successCallback,
in [Optional] NavigatorUserMediaErrorCallback errorCallback)
raises(DOMException);
};
......@@ -36,18 +36,18 @@
CallWith=ScriptExecutionContext,
EventTarget
] interface RTCPeerConnection {
void createOffer(in [Callback] RTCSessionDescriptionCallback successCallback, in [Callback,Optional=DefaultIsUndefined] RTCErrorCallback failureCallback, in [Optional] Dictionary mediaConstraints)
void createOffer(in RTCSessionDescriptionCallback successCallback, in [Optional=DefaultIsUndefined] RTCErrorCallback failureCallback, in [Optional] Dictionary mediaConstraints)
raises(DOMException);
void createAnswer(in [Callback] RTCSessionDescriptionCallback successCallback, in [Callback, Optional=DefaultIsUndefined] RTCErrorCallback failureCallback, in [Optional] Dictionary mediaConstraints)
void createAnswer(in RTCSessionDescriptionCallback successCallback, in [Optional=DefaultIsUndefined] RTCErrorCallback failureCallback, in [Optional] Dictionary mediaConstraints)
raises(DOMException);
void setLocalDescription(in RTCSessionDescription description, in [Callback, Optional=DefaultIsUndefined] VoidCallback successCallback, in [Callback, Optional=DefaultIsUndefined] RTCErrorCallback failureCallback)
void setLocalDescription(in RTCSessionDescription description, in [Optional=DefaultIsUndefined] VoidCallback successCallback, in [Optional=DefaultIsUndefined] RTCErrorCallback failureCallback)
raises(DOMException);
readonly attribute RTCSessionDescription localDescription
getter raises(DOMException);
void setRemoteDescription(in RTCSessionDescription description, in [Callback, Optional=DefaultIsUndefined] VoidCallback successCallback, in [Callback, Optional=DefaultIsUndefined] RTCErrorCallback failureCallback)
void setRemoteDescription(in RTCSessionDescription description, in [Optional=DefaultIsUndefined] VoidCallback successCallback, in [Optional=DefaultIsUndefined] RTCErrorCallback failureCallback)
raises(DOMException);
readonly attribute RTCSessionDescription remoteDescription
getter raises(DOMException);
......@@ -72,7 +72,7 @@
[StrictTypeChecking] void removeStream(in MediaStream stream)
raises(DOMException);
void getStats(in [Callback] RTCStatsCallback successCallback, in [Optional=DefaultIsUndefined] MediaStreamTrack selector);
void getStats(in RTCStatsCallback successCallback, in [Optional=DefaultIsUndefined] MediaStreamTrack selector);
RTCDataChannel createDataChannel(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString label, in [Optional] Dictionary options)
raises(DOMException);
......
......@@ -51,7 +51,7 @@
#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
static readonly attribute [CallWith=ScriptExecutionContext] DOMString permission;
[CallWith=ScriptExecutionContext] static void requestPermission(in [Optional, Callback] NotificationPermissionCallback callback);
[CallWith=ScriptExecutionContext] static void requestPermission(in [Optional] NotificationPermissionCallback callback);
#endif
attribute EventListener onshow;
......
......@@ -37,6 +37,6 @@
Notification createNotification(in DOMString iconUrl, in DOMString title, in DOMString body) raises(DOMException);
int checkPermission();
void requestPermission(in [Optional, Callback] VoidCallback callback);
void requestPermission(in [Optional] VoidCallback callback);
};
......@@ -31,6 +31,6 @@
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
[CallWith=ScriptExecutionContext] void queryUsageAndQuota(in unsigned short storageType, in [Callback, Optional] StorageUsageCallback usageCallback, in [Callback, Optional] StorageErrorCallback errorCallback);
[CallWith=ScriptExecutionContext] void requestQuota(in unsigned short storageType, in unsigned long long newQuotaInBytes, in [Callback, Optional] StorageQuotaCallback quotaCallback, in [Callback, Optional] StorageErrorCallback errorCallback);
[CallWith=ScriptExecutionContext] void queryUsageAndQuota(in unsigned short storageType, in [Optional] StorageUsageCallback usageCallback, in [Optional] StorageErrorCallback errorCallback);
[CallWith=ScriptExecutionContext] void requestQuota(in unsigned short storageType, in unsigned long long newQuotaInBytes, in [Optional] StorageQuotaCallback quotaCallback, in [Optional] StorageErrorCallback errorCallback);
};
......@@ -28,6 +28,6 @@
OmitConstructor,
ImplementationLacksVTable
] interface StorageQuota {
[CallWith=ScriptExecutionContext] void queryUsageAndQuota(in [Callback] StorageUsageCallback usageCallback, in [Callback, Optional] StorageErrorCallback errorCallback);
[CallWith=ScriptExecutionContext] void requestQuota(in unsigned long long newQuotaInBytes, in [Callback, Optional] StorageQuotaCallback quotaCallback, in [Callback, Optional] StorageErrorCallback errorCallback);
[CallWith=ScriptExecutionContext] void queryUsageAndQuota(in StorageUsageCallback usageCallback, in [Optional] StorageErrorCallback errorCallback);
[CallWith=ScriptExecutionContext] void requestQuota(in unsigned long long newQuotaInBytes, in [Optional] StorageQuotaCallback quotaCallback, in [Optional] StorageErrorCallback errorCallback);
};
......@@ -51,7 +51,7 @@
raises(DOMException);
// Asynchronous audio file data decoding.
void decodeAudioData(in ArrayBuffer audioData, in [Callback] AudioBufferCallback successCallback, in [Optional, Callback] AudioBufferCallback errorCallback)
void decodeAudioData(in ArrayBuffer audioData, in AudioBufferCallback successCallback, in [Optional] AudioBufferCallback errorCallback)
raises(DOMException);
// Sources
......
......@@ -27,7 +27,7 @@
[
Conditional=SQL_DATABASE,
] partial interface DOMWindow {
Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Optional] DatabaseCallback creationCallback)
raises(DOMException);
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
attribute SQLExceptionConstructor SQLException;
......
......@@ -32,8 +32,8 @@
JSNoStaticTables
] interface Database {
readonly attribute DOMString version;
void changeVersion(in DOMString oldVersion, in DOMString newVersion, in [Callback, Optional] SQLTransactionCallback callback, in [Callback, Optional] SQLTransactionErrorCallback errorCallback, in [Callback, Optional] VoidCallback successCallback);
void transaction(in [Callback] SQLTransactionCallback callback, in [Callback, Optional] SQLTransactionErrorCallback errorCallback, in [Callback, Optional] VoidCallback successCallback);
void readTransaction(in [Callback] SQLTransactionCallback callback, in [Callback, Optional] SQLTransactionErrorCallback errorCallback, in [Callback, Optional] VoidCallback successCallback);
void changeVersion(in DOMString oldVersion, in DOMString newVersion, in [Optional] SQLTransactionCallback callback, in [Optional] SQLTransactionErrorCallback errorCallback, in [Optional] VoidCallback successCallback);
void transaction(in SQLTransactionCallback callback, in [Optional] SQLTransactionErrorCallback errorCallback, in [Optional] VoidCallback successCallback);
void readTransaction(in SQLTransactionCallback callback, in [Optional] SQLTransactionErrorCallback errorCallback, in [Optional] VoidCallback successCallback);
};
......@@ -35,8 +35,8 @@
] interface DatabaseSync {
readonly attribute DOMString version;
readonly attribute DOMString lastErrorMessage;
void changeVersion(in DOMString oldVersion, in DOMString newVersion, in [Callback, Optional] SQLTransactionSyncCallback callback) raises(DOMException);
void transaction(in [Callback] SQLTransactionSyncCallback callback) raises(DOMException);
void readTransaction(in [Callback] SQLTransactionSyncCallback callback) raises(DOMException);
void changeVersion(in DOMString oldVersion, in DOMString newVersion, in [Optional] SQLTransactionSyncCallback callback) raises(DOMException);
void transaction(in SQLTransactionSyncCallback callback) raises(DOMException);
void readTransaction(in SQLTransactionSyncCallback callback) raises(DOMException);
};
......@@ -34,6 +34,6 @@
] interface SQLTransaction {
[Custom] void executeSql(in DOMString sqlStatement,
in ObjectArray arguments,
in [Optional, Callback] SQLStatementCallback callback,
in [Optional, Callback] SQLStatementErrorCallback errorCallback);
in [Optional] SQLStatementCallback callback,
in [Optional] SQLStatementErrorCallback errorCallback);
};
......@@ -27,10 +27,10 @@
[
Conditional=SQL_DATABASE,
] partial interface WorkerContext {
Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Optional] DatabaseCallback creationCallback)
raises(DOMException);
DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Optional] DatabaseCallback creationCallback)
raises(DOMException);
};
......@@ -497,7 +497,7 @@ $(top_builddir)/DerivedSources/webkitdom/WebKitDOMCustom.h: $(WebCore)/bindings/
# Filter out SVG and IndexedDB for now
gdom_feature_defines := $(filter-out ENABLE_INDEXED_DATABASE=1, $(filter-out ENABLE_SVG%, $(feature_defines))) ENABLE_INDEXED_DATABASE=0
DerivedSources/webkitdom/WebKitDOM%.cpp DerivedSources/webkitdom/WebKitDOM%.h DerivedSources/webkitdom/WebKitDOM%Private.h: %.idl $(SCRIPTS_FOR_GENERATE_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorGObject.pm $(WebCore)/bindings/gobject/GNUmakefile.am $(supplemental_dependency_file)
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCES_WEBKITDOM)" --defines "LANGUAGE_GOBJECT=1 $(gdom_feature_defines)" --generator GObject --supplementalDependencyFile $(supplemental_dependency_file) $<
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/Modules --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/fileapi --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCES_WEBKITDOM)" --defines "LANGUAGE_GOBJECT=1 $(gdom_feature_defines)" --generator GObject --supplementalDependencyFile $(supplemental_dependency_file) $<
libwebkitdomincludedir = $(libwebkitgtkincludedir)/webkitdom
nodist_libwebkitdominclude_HEADERS = \
......
......@@ -6,6 +6,7 @@
# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
# Copyright (C) Research In Motion Limited 2010. All rights reserved.
# Copyright (C) 2013 Samsung Electronics. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
......@@ -53,6 +54,13 @@ my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1);
my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1);
# WebCore types used directly in IDL files.
my %webCoreTypeHash = (
"CompareHow" => 1,
"SerializedScriptValue" => 1,
"Dictionary" => 1
);
my %enumTypeHash = ();
my %nonPointerTypeHash = ("DOMTimeStamp" => 1, "CompareHow" => 1);
......@@ -665,6 +673,40 @@ sub SetterExpression
return ($functionName, $contentAttributeName);
}
sub IsWrapperType
{
my $object = shift;
my $type = shift;
return 0 if $object->IsPrimitiveType($type);
return 0 if $object->GetArrayType($type);
return 0 if $object->GetSequenceType($type);
return 0 if $object->IsEnumType($type);
return 0 if $object->IsStringType($type);
return 0 if $webCoreTypeHash{$type};
return 0 if $type eq "any";
return 1;
}
sub IsCallbackInterface
{
my $object = shift;
my $type = shift;
return 0 unless $object->IsWrapperType($type);
my $idlFile = $object->IDLFileForInterface($type)
or die("Could NOT find IDL file for interface \"$type\"!\n");
open FILE, "<", $idlFile;
my @lines = <FILE>;
close FILE;
my $fileContents = join('', @lines);
return ($fileContents =~ /callback\s+interface\s+(\w+)/gs);
}
sub GenerateConditionalString
{
my $generator = shift;
......
......@@ -293,12 +293,12 @@ sub SkipFunction {
return 1;
}
# Skip functions that have ["Callback"] parameters, because this
# Skip functions that have callback parameters, because this
# code generator doesn't know how to auto-generate callbacks.
# Skip functions that have "MediaQueryListListener" or sequence<T> parameters, because this
# code generator doesn't know how to auto-generate MediaQueryListListener or sequence<T>.
foreach my $param (@{$function->parameters}) {
if ($param->extendedAttributes->{"Callback"} ||
if ($codeGenerator->IsCallbackInterface($param->type) ||
$param->extendedAttributes->{"Clamp"} ||
$param->type eq "MediaQueryListListener" ||
$codeGenerator->GetSequenceType($param->type)) {
......
......@@ -10,6 +10,7 @@
# Copyright (C) 2011 Patrick Gansterer <paroga@webkit.org>
# Copyright (C) 2012 Ericsson AB. All rights reserved.
# Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
# Copyright (C) 2013 Samsung Electronics. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
......@@ -1293,7 +1294,7 @@ sub GenerateParametersCheckExpression
push(@andExpression, "(${value}.isUndefinedOrNull() || ${value}.isString() || ${value}.isObject())");
$usedArguments{$parameterIndex} = 1;
}
} elsif ($parameter->extendedAttributes->{"Callback"}) {
} elsif ($codeGenerator->IsCallbackInterface($parameter->type)) {
# For Callbacks only checks if the value is null or object.
push(@andExpression, "(${value}.isNull() || ${value}.isFunction())");
$usedArguments{$parameterIndex} = 1;
......@@ -2898,7 +2899,7 @@ sub GenerateParametersCheck
# Optional arguments with [Optional=...] should not generate the early call.
# Optional Dictionary arguments always considered to have default of empty dictionary.
my $optional = $parameter->extendedAttributes->{"Optional"};
if ($optional && $optional ne "DefaultIsUndefined" && $optional ne "DefaultIsNullString" && $argType ne "Dictionary" && !$parameter->extendedAttributes->{"Callback"}) {
if ($optional && $optional ne "DefaultIsUndefined" && $optional ne "DefaultIsNullString" && $argType ne "Dictionary" && !$codeGenerator->IsCallbackInterface($parameter->type)) {
# Generate early call if there are enough parameters.
if (!$hasOptionalArguments) {
push(@$outputArray, "\n size_t argsCount = exec->argumentCount();\n");
......@@ -2926,7 +2927,7 @@ sub GenerateParametersCheck
push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
push(@$outputArray, " resolver = customResolver.get();\n");
push(@$outputArray, " }\n");
} elsif ($parameter->extendedAttributes->{"Callback"}) {
} elsif ($codeGenerator->IsCallbackInterface($parameter->type)) {
my $callbackClassName = GetCallbackClassName($argType);
$implIncludes{"$callbackClassName.h"} = 1;
if ($optional) {
......
......@@ -22,7 +22,6 @@ ActiveDOMObject
CPPPureInterface
CachedAttribute
CallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack
Callback
CheckSecurity
CheckSecurityForNode
Clamp
......
......@@ -24,20 +24,15 @@
#include "WebDOMTestCallback.h"
#include "Class1.h"
#include "Class2.h"
#include "Class3.h"
#include "Class8.h"
#include "DOMStringList.h"
#include "Float32Array.h"
#include "KURL.h"
#include "ThisClass.h"
#include "WebDOMClass1.h"
#include "WebDOMClass2.h"
#include "WebDOMClass3.h"
#include "WebDOMClass8.h"
#include "SerializedScriptValue.h"
#include "TestNode.h"
#include "WebDOMDOMStringList.h"
#include "WebDOMFloat32Array.h"
#include "WebDOMString.h"
#include "WebDOMThisClass.h"
#include "WebDOMTestNode.h"
#include "WebExceptionHandler.h"
#include "wtf/text/AtomicString.h"
#include <wtf/GetPtr.h>
......@@ -96,28 +91,28 @@ bool WebDOMTestCallback::callbackWithNoParam()
return impl()->callbackWithNoParam();
}
bool WebDOMTestCallback::callbackWithClass1Param(const WebDOMClass1& class1Param)
bool WebDOMTestCallback::callbackWithArrayParam(const WebDOMFloat32Array& arrayParam)
{
if (!impl())
return false;