|
|
Simplify invokeCallback() and support void return values for IDL callbacks
Now that all callbacks are forced to be v8::Functions, invokeCallback() can be
a lot simpler: no more need to look for a handleEvent method on a v8::Object.
Only a single caller made use of the |callbackReturnValue|, so it's been removed
and that caller now takes care of calling the callback.
invokeCallback() is now just a TryCatch around ScriptController::callFunction.
I also inverted the return value of invokeCallback: true means "everything went fine",
false means "threw an exception".
In making that change, it became clear that most callbacks don't actually have
a return value (and their callers don't care what the called function returns),
and were only using "boolean" in the IDL files because that was all the code
generator supported. I've added support for "void", which is used everywhere
except for a few cases in WebSQL.
R=haraken@chromium.org, nbarth@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163665
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+133 lines, -129 lines) |
Patch |
 |
M |
Source/bindings/scripts/code_generator_v8.pm
|
View
|
|
9 chunks |
+16 lines, -11 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/idls/TestCallback.idl
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestCallback.h
|
View
|
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestCallback.cpp
|
View
|
|
8 chunks |
+26 lines, -15 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/v8/V8Callback.h
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/v8/V8Callback.cpp
|
View
|
|
1 chunk |
+5 lines, -21 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
|
View
|
|
2 chunks |
+9 lines, -3 lines |
4 comments
|
Download
|
 |
M |
Source/bindings/v8/custom/V8SQLTransactionCustom.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/core/css/CSSVariablesMapForEachCallback.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/core/css/CSSVariablesMapForEachCallback.idl
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/RequestAnimationFrameCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/dom/RequestAnimationFrameCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/dom/StringCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/dom/StringCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/VoidCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/VoidCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/inspector/InspectorDatabaseAgent.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/inspector/InspectorFileSystemAgent.cpp
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/DOMFileSystem.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/DOMFileSystemSync.cpp
|
View
|
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/EntriesCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/EntriesCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/EntryCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/EntryCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/ErrorCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/ErrorCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileSystemCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileSystemCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileWriterBaseCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileWriterCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileWriterCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/MetadataCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/MetadataCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/SyncCallbackHelper.h
|
View
|
|
2 chunks |
+3 lines, -6 lines |
0 comments
|
Download
|
 |
M |
Source/modules/geolocation/PositionCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/geolocation/PositionCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/geolocation/PositionErrorCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/geolocation/PositionErrorCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/MediaStreamTrackSourcesCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/NavigatorUserMediaErrorCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/NavigatorUserMediaSuccessCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCErrorCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCErrorCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCSessionDescriptionCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCSessionDescriptionCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCStatsCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCStatsCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/notifications/NotificationPermissionCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/notifications/NotificationPermissionCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/quota/StorageErrorCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/quota/StorageErrorCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/quota/StorageQuotaCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/quota/StorageQuotaCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/quota/StorageUsageCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/quota/StorageUsageCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/webaudio/AudioBufferCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/webaudio/AudioBufferCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/webmidi/MIDIErrorCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/webmidi/MIDIErrorCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/webmidi/MIDISuccessCallback.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/webmidi/MIDISuccessCallback.idl
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 5 (0 generated)
|