<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208408] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208408">208408</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-11-04 17:03:32 -0700 (Fri, 04 Nov 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WebIDL] Add support for modern callback syntax
https://bugs.webkit.org/show_bug.cgi?id=164435
Patch by Sam Weinig <sam@webkit.org> on 2016-11-04
Reviewed by Chris Dumez.
Support new callback syntax:
callback Function = void (DOMString arg1, long arg2);
This replaces "callback interface" types with a Callback=FunctionOnly
extended attribute.
* Modules/geolocation/PositionCallback.idl:
* Modules/geolocation/PositionErrorCallback.idl:
* Modules/notifications/NotificationPermissionCallback.idl:
* Modules/quota/StorageErrorCallback.idl:
* Modules/quota/StorageQuotaCallback.idl:
* Modules/quota/StorageUsageCallback.idl:
* Modules/webaudio/AudioBufferCallback.idl:
* Modules/webdatabase/DatabaseCallback.idl:
* Modules/webdatabase/SQLStatementCallback.idl:
* Modules/webdatabase/SQLStatementErrorCallback.idl:
* Modules/webdatabase/SQLTransactionCallback.idl:
* Modules/webdatabase/SQLTransactionErrorCallback.idl:
* dom/RequestAnimationFrameCallback.idl:
* dom/StringCallback.idl:
* html/VoidCallback.idl:
* page/IntersectionObserverCallback.idl:
* css/MediaQueryListListener.idl:
Update to new syntax.
* css/MediaQueryListListener.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::styleResolverChanged):
Switch to using the now required 'handleEvent' name. This is an implementation detail
that we should change.
* bindings/scripts/CodeGenerator.pm:
Update document processing to allow a callback only file. Update callback
type checks to look for a regex that matches in the new format.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
(AddToIncludesForIDLType):
(AddToImplIncludes):
(AddToIncludes):
Abstract includes functions to allow passing in an include hash.
(GenerateCallbackFunctionHeader):
(GenerateCallbackFunctionImplementation):
(GenerateCallbackInterfaceHeader):
(GenerateCallbackInterfaceImplementation):
(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
to allow using it for both the new callbacks as well as the old callback interfaces.
* bindings/scripts/IDLParser.pm:
(Parse):
(applyTypedefs):
(applyTypedefsToOperation):
(parseCallbackRest):
Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.
* bindings/scripts/IDLAttributes.txt:
Remove support for Callback=FunctionOnly.
* bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
* bindings/scripts/test/JS/JSTestCallback.h: Removed.
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
* bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestCallback.idl: Removed.
* bindings/scripts/test/TestCallbackFunction.idl:
* bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
* bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestTypedefs.idl:
Update existing tests and add new ones to test callback functions specifically.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationPositionCallbackidl">trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationPositionErrorCallbackidl">trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsNotificationPermissionCallbackidl">trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesquotaStorageErrorCallbackidl">trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesquotaStorageQuotaCallbackidl">trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesquotaStorageUsageCallbackidl">trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioBufferCallbackidl">trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseCallbackidl">trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementErrorCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionErrorCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackFunctionidl">trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestTypedefsidl">trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryListListenerh">trunk/Source/WebCore/css/MediaQueryListListener.h</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryListListeneridl">trunk/Source/WebCore/css/MediaQueryListListener.idl</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryMatchercpp">trunk/Source/WebCore/css/MediaQueryMatcher.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRequestAnimationFrameCallbackidl">trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl</a></li>
<li><a href="#trunkSourceWebCoredomStringCallbackidl">trunk/Source/WebCore/dom/StringCallback.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlVoidCallbackidl">trunk/Source/WebCore/html/VoidCallback.idl</a></li>
<li><a href="#trunkSourceWebCorepageIntersectionObserverCallbackidl">trunk/Source/WebCore/page/IntersectionObserverCallback.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackFunctionWithTypedefsidl">trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackInterfaceidl">trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackidl">trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/ChangeLog        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,3 +1,89 @@
</span><ins>+2016-11-04 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Add support for modern callback syntax
+ https://bugs.webkit.org/show_bug.cgi?id=164435
+
+ Reviewed by Chris Dumez.
+
+ Support new callback syntax:
+ callback Function = void (DOMString arg1, long arg2);
+
+ This replaces "callback interface" types with a Callback=FunctionOnly
+ extended attribute.
+
+ * Modules/geolocation/PositionCallback.idl:
+ * Modules/geolocation/PositionErrorCallback.idl:
+ * Modules/notifications/NotificationPermissionCallback.idl:
+ * Modules/quota/StorageErrorCallback.idl:
+ * Modules/quota/StorageQuotaCallback.idl:
+ * Modules/quota/StorageUsageCallback.idl:
+ * Modules/webaudio/AudioBufferCallback.idl:
+ * Modules/webdatabase/DatabaseCallback.idl:
+ * Modules/webdatabase/SQLStatementCallback.idl:
+ * Modules/webdatabase/SQLStatementErrorCallback.idl:
+ * Modules/webdatabase/SQLTransactionCallback.idl:
+ * Modules/webdatabase/SQLTransactionErrorCallback.idl:
+ * dom/RequestAnimationFrameCallback.idl:
+ * dom/StringCallback.idl:
+ * html/VoidCallback.idl:
+ * page/IntersectionObserverCallback.idl:
+ * css/MediaQueryListListener.idl:
+ Update to new syntax.
+
+ * css/MediaQueryListListener.h:
+ * css/MediaQueryMatcher.cpp:
+ (WebCore::MediaQueryMatcher::styleResolverChanged):
+ Switch to using the now required 'handleEvent' name. This is an implementation detail
+ that we should change.
+
+ * bindings/scripts/CodeGenerator.pm:
+ Update document processing to allow a callback only file. Update callback
+ type checks to look for a regex that matches in the new format.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (AddToImplIncludesForIDLType):
+ (AddToIncludesForIDLType):
+ (AddToImplIncludes):
+ (AddToIncludes):
+ Abstract includes functions to allow passing in an include hash.
+
+ (GenerateCallbackFunctionHeader):
+ (GenerateCallbackFunctionImplementation):
+ (GenerateCallbackInterfaceHeader):
+ (GenerateCallbackInterfaceImplementation):
+ (GenerateCallbackHeaderContent):
+ (GenerateCallbackImplementationContent):
+ Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
+ to allow using it for both the new callbacks as well as the old callback interfaces.
+
+ * bindings/scripts/IDLParser.pm:
+ (Parse):
+ (applyTypedefs):
+ (applyTypedefsToOperation):
+ (parseCallbackRest):
+ Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.
+
+ * bindings/scripts/IDLAttributes.txt:
+ Remove support for Callback=FunctionOnly.
+
+ * bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
+ * bindings/scripts/test/JS/JSTestCallback.h: Removed.
+ * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
+ * bindings/scripts/test/JS/JSTestCallbackFunction.h:
+ * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
+ * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
+ * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
+ * bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+ * bindings/scripts/test/TestCallback.idl: Removed.
+ * bindings/scripts/test/TestCallbackFunction.idl:
+ * bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
+ * bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/TestTypedefs.idl:
+ Update existing tests and add new ones to test callback functions specifically.
+
</ins><span class="cx"> 2016-11-04 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Move isDefaultPortForProtocol from URLParser.cpp back to URL.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationPositionCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -24,7 +24,4 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=GEOLOCATION,
</span><del>- Callback=FunctionOnly,
-] callback interface PositionCallback {
- boolean handleEvent(Geoposition position);
-};
</del><ins>+] callback PositionCallback = void (Geoposition position);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationPositionErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -24,7 +24,4 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=GEOLOCATION,
</span><del>- Callback=FunctionOnly,
-] callback interface PositionErrorCallback {
- boolean handleEvent(PositionError error);
-};
</del><ins>+] callback PositionErrorCallback = void (PositionError error);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationPermissionCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,5 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=NOTIFICATIONS,
</span><del>- Callback=FunctionOnly,
-] callback interface NotificationPermissionCallback {
- boolean handleEvent(DOMString permission);
-};
</del><ins>+] callback NotificationPermissionCallback = void (DOMString permission);
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesquotaStorageErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -30,7 +30,4 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=QUOTA,
</span><del>- Callback=FunctionOnly,
-] callback interface StorageErrorCallback {
- boolean handleEvent(DOMCoreException error);
-};
</del><ins>+] callback StorageErrorCallback = void (DOMCoreException error);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesquotaStorageQuotaCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -30,7 +30,4 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=QUOTA,
</span><del>- Callback=FunctionOnly,
-] callback interface StorageQuotaCallback {
- boolean handleEvent(unsigned long long grantedQuotaInBytes);
-};
</del><ins>+] callback StorageQuotaCallback = void (unsigned long long grantedQuotaInBytes);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesquotaStorageUsageCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -30,7 +30,4 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=QUOTA,
</span><del>- Callback=FunctionOnly,
-] callback interface StorageUsageCallback {
- boolean handleEvent(unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes);
-};
</del><ins>+] callback StorageUsageCallback = void (unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioBufferCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,7 +25,4 @@
</span><span class="cx"> [
</span><span class="cx"> Conditional=WEB_AUDIO,
</span><span class="cx"> JSGenerateToJSObject,
</span><del>- Callback=FunctionOnly,
-] callback interface AudioBufferCallback {
- boolean handleEvent(AudioBuffer audioBuffer);
-};
</del><ins>+] callback AudioBufferCallback = void (AudioBuffer audioBuffer);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,8 +26,4 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-[
- Callback=FunctionOnly,
-] callback interface DatabaseCallback {
- boolean handleEvent(Database database);
-};
</del><ins>+callback DatabaseCallback = void (Database database);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,5 @@
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><del>-[
- Callback=FunctionOnly,
-] callback interface SQLStatementCallback {
- boolean handleEvent(SQLTransaction transaction, SQLResultSet resultSet);
-};
</del><ins>+
+callback SQLStatementCallback = void (SQLTransaction transaction, SQLResultSet resultSet);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,7 @@
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><ins>+
</ins><span class="cx"> [
</span><del>- Callback=FunctionOnly,
-] callback interface SQLStatementErrorCallback {
- [Custom] boolean handleEvent(SQLTransaction transaction, SQLError error);
-};
</del><ins>+ Custom
+] callback SQLStatementErrorCallback = boolean (SQLTransaction transaction, SQLError error);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,5 @@
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><del>-[
- Callback=FunctionOnly,
-] callback interface SQLTransactionCallback {
- boolean handleEvent(SQLTransaction transaction);
-};
</del><ins>+
+callback SQLTransactionCallback = void (SQLTransaction transaction);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,8 +26,4 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-[
- Callback=FunctionOnly,
-] callback interface SQLTransactionErrorCallback {
- boolean handleEvent(SQLError error);
-};
</del><ins>+callback SQLTransactionErrorCallback = void (SQLError error);
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -64,18 +64,11 @@
</span><span class="cx"> "unrestricted double" => 1,
</span><span class="cx"> );
</span><span class="cx">
</span><del>-my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1 );
-
-# WebCore types used directly in IDL files.
-my %webCoreTypeHash = (
- "Dictionary" => 1,
- "SerializedScriptValue" => 1,
</del><ins>+my %stringTypeHash = (
+ "DOMString" => 1,
+ "USVString" => 1,
</ins><span class="cx"> );
</span><span class="cx">
</span><del>-my %dictionaryTypeImplementationNameOverrides = ();
-my %enumTypeImplementationNameOverrides = ();
-
-
</del><span class="cx"> my %typedArrayTypes = (
</span><span class="cx"> "ArrayBuffer" => 1,
</span><span class="cx"> "ArrayBufferView" => 1,
</span><span class="lines">@@ -91,6 +84,21 @@
</span><span class="cx"> "Uint8ClampedArray" => 1,
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+my %primitiveTypeHash = (
+ "boolean" => 1,
+ "void" => 1,
+ "Date" => 1
+);
+
+# WebCore types used directly in IDL files.
+my %webCoreTypeHash = (
+ "Dictionary" => 1,
+ "SerializedScriptValue" => 1,
+);
+
+my %dictionaryTypeImplementationNameOverrides = ();
+my %enumTypeImplementationNameOverrides = ();
+
</ins><span class="cx"> my %svgAttributesInHTMLHash = (
</span><span class="cx"> "class" => 1,
</span><span class="cx"> "id" => 1,
</span><span class="lines">@@ -209,6 +217,17 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ my $callbackFunctions = $useDocument->callbackFunctions;
+ if (@$callbackFunctions) {
+ die "Multiple standalone callback functions per document are not supported" if @$callbackFunctions > 1;
+
+ my $callbackFunction = @$callbackFunctions[0];
+ print "Generating $useGenerator bindings code for IDL callback function \"" . $callbackFunction->type->name . "\"...\n" if $verbose;
+ $codeGenerator->GenerateCallbackFunction($callbackFunction, $useDocument->enumerations, $useDocument->dictionaries);
+ $codeGenerator->WriteData($callbackFunction, $useOutputDir, $useOutputHeadersDir);
+ return;
+ }
+
</ins><span class="cx"> my $dictionaries = $useDocument->dictionaries;
</span><span class="cx"> if (@$dictionaries) {
</span><span class="cx"> die "Multiple standalone dictionaries per document are not supported" if @$dictionaries > 1;
</span><span class="lines">@@ -364,8 +383,7 @@
</span><span class="cx"> return 1 if $integerTypeHash{$typeName};
</span><span class="cx"> return 1 if $floatingPointTypeHash{$typeName};
</span><span class="cx"> return 1 if $typedArrayTypes{$typeName};
</span><del>- return 1 if $typeName eq "DOMString";
- return 1 if $typeName eq "USVString";
</del><ins>+ return 1 if $stringTypeHash{$typeName};
</ins><span class="cx"> return 1 if $typeName eq "BufferSource";
</span><span class="cx"> return 1 if $typeName eq "SVGNumber";
</span><span class="cx"> return 1 if $typeName eq "any";
</span><span class="lines">@@ -426,7 +444,6 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-# Currently used outside WebKit in an internal Apple project; can be removed soon.
</del><span class="cx"> sub IsStringType
</span><span class="cx"> {
</span><span class="cx"> my ($object, $type) = @_;
</span><span class="lines">@@ -433,8 +450,7 @@
</span><span class="cx">
</span><span class="cx"> assert("Not a type") if ref($type) ne "IDLType";
</span><span class="cx">
</span><del>- return 1 if $type->name eq "DOMString";
- return 1 if $type->name eq "USVString";
</del><ins>+ return 1 if $stringTypeHash{$type->name};
</ins><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1031,16 +1047,13 @@
</span><span class="cx"> return $result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-# Callback interface with [Callback=FunctionOnly].
-# FIXME: This should be a callback function:
-# https://heycam.github.io/webidl/#idl-callback-functions
-sub ComputeIsFunctionOnlyCallbackInterface
</del><ins>+sub ComputeIsCallbackFunction
</ins><span class="cx"> {
</span><span class="cx"> my ($object, $type) = @_;
</span><span class="cx">
</span><span class="cx"> assert("Not a type") if ref($type) ne "IDLType";
</span><span class="cx">
</span><del>- return 0 unless $object->IsCallbackInterface($type);
</del><ins>+ return 0 unless $object->IsWrapperType($type);
</ins><span class="cx">
</span><span class="cx"> my $typeName = $type->name;
</span><span class="cx"> my $idlFile = $object->IDLFileForInterface($typeName) or assert("Could NOT find IDL file for interface \"$typeName\"!\n");
</span><span class="lines">@@ -1050,25 +1063,12 @@
</span><span class="cx"> close FILE;
</span><span class="cx">
</span><span class="cx"> my $fileContents = join('', @lines);
</span><del>- if ($fileContents =~ /\[(.*)\]\s+callback\s+interface\s+(\w+)/gs) {
- my @parts = split(',', $1);
- foreach my $part (@parts) {
- my @keyValue = split('=', $part);
- my $key = trim($keyValue[0]);
- next unless length($key);
- my $value = "VALUE_IS_MISSING";
- $value = trim($keyValue[1]) if @keyValue > 1;
-
- return 1 if ($key eq "Callback" && $value eq "FunctionOnly");
- }
- }
-
- return 0;
</del><ins>+ return ($fileContents =~ /(.*)callback\s+(\w+)\s+=/gs);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-my %isFunctionOnlyCallbackInterface = ();
</del><ins>+my %isCallbackFunction = ();
</ins><span class="cx">
</span><del>-sub IsFunctionOnlyCallbackInterface
</del><ins>+sub IsCallbackFunction
</ins><span class="cx"> {
</span><span class="cx"> # FIXME: It's bad to have a function like this that opens another IDL file to answer a question.
</span><span class="cx"> # Overusing this kind of function can make things really slow. Lets avoid these if we can.
</span><span class="lines">@@ -1078,9 +1078,9 @@
</span><span class="cx">
</span><span class="cx"> assert("Not a type") if ref($type) ne "IDLType";
</span><span class="cx">
</span><del>- return $isFunctionOnlyCallbackInterface{$type->name} if exists $isFunctionOnlyCallbackInterface{$type->name};
- my $result = $object->ComputeIsFunctionOnlyCallbackInterface($type);
- $isFunctionOnlyCallbackInterface{$type->name} = $result;
</del><ins>+ return $isCallbackFunction{$type->name} if exists $isCallbackFunction{$type->name};
+ my $result = $object->ComputeIsCallbackFunction($type);
+ $isCallbackFunction{$type->name} = $result;
</ins><span class="cx"> return $result;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -150,6 +150,14 @@
</span><span class="cx"> $object->GenerateDictionaryImplementation($dictionary, $className, $enumerations);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub GenerateCallbackFunction
+{
+ my ($object, $callbackFunction, $enumerations, $dictionaries) = @_;
+
+ $object->GenerateCallbackFunctionHeader($callbackFunction, $enumerations, $dictionaries);
+ $object->GenerateCallbackFunctionImplementation($callbackFunction, $enumerations, $dictionaries);
+}
+
</ins><span class="cx"> sub GenerateInterface
</span><span class="cx"> {
</span><span class="cx"> my ($object, $interface, $defines, $enumerations, $dictionaries) = @_;
</span><span class="lines">@@ -158,8 +166,8 @@
</span><span class="cx"> AddStringifierOperationIfNeeded($interface);
</span><span class="cx">
</span><span class="cx"> if ($interface->isCallback) {
</span><del>- $object->GenerateCallbackHeader($interface, $enumerations, $dictionaries);
- $object->GenerateCallbackImplementation($interface, $enumerations, $dictionaries);
</del><ins>+ $object->GenerateCallbackInterfaceHeader($interface, $enumerations, $dictionaries);
+ $object->GenerateCallbackInterfaceImplementation($interface, $enumerations, $dictionaries);
</ins><span class="cx"> } else {
</span><span class="cx"> $object->GenerateHeader($interface, $enumerations, $dictionaries);
</span><span class="cx"> $object->GenerateImplementation($interface, $enumerations, $dictionaries);
</span><span class="lines">@@ -222,9 +230,9 @@
</span><span class="cx">
</span><span class="cx"> sub GetJSCallbackDataType
</span><span class="cx"> {
</span><del>- my $callbackInterface = shift;
</del><ins>+ my $callback = shift;
</ins><span class="cx">
</span><del>- return $callbackInterface->extendedAttributes->{IsWeakCallback} ? "JSCallbackDataWeak" : "JSCallbackDataStrong";
</del><ins>+ return $callback->extendedAttributes->{IsWeakCallback} ? "JSCallbackDataWeak" : "JSCallbackDataStrong";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetExportMacroForJSClass
</span><span class="lines">@@ -261,6 +269,13 @@
</span><span class="cx"> sub AddToImplIncludesForIDLType
</span><span class="cx"> {
</span><span class="cx"> my ($type, $conditional) = @_;
</span><ins>+
+ return AddToIncludesForIDLType($type, \%implIncludes, $conditional)
+}
+
+sub AddToIncludesForIDLType
+{
+ my ($type, $includesRef, $conditional) = @_;
</ins><span class="cx">
</span><span class="cx"> return if $codeGenerator->IsPrimitiveType($type);
</span><span class="cx"> return if $codeGenerator->IsStringType($type);
</span><span class="lines">@@ -269,10 +284,10 @@
</span><span class="cx"> return if $type->name eq "any";
</span><span class="cx">
</span><span class="cx"> if ($type->isUnion) {
</span><del>- AddToImplIncludes("<wtf/Variant.h>", $conditional);
</del><ins>+ AddToIncludes("<wtf/Variant.h>", $includesRef, $conditional);
</ins><span class="cx">
</span><span class="cx"> foreach my $memberType (@{$type->subtypes}) {
</span><del>- AddToImplIncludesForIDLType($memberType, $conditional);
</del><ins>+ AddToIncludesForIDLType($memberType, $includesRef, $conditional);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return;
</span><span class="lines">@@ -279,23 +294,23 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
</span><del>- AddToImplIncludes("<runtime/JSArray.h>", $conditional);
- AddToImplIncludesForIDLType(@{$type->subtypes}[0], $conditional);
</del><ins>+ AddToIncludes("<runtime/JSArray.h>", $includesRef, $conditional);
+ AddToIncludesForIDLType(@{$type->subtypes}[0], $includesRef, $conditional);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsExternalDictionaryType($type) || $codeGenerator->IsExternalEnumType($type)) {
</span><del>- AddToImplIncludes("JS" . $type->name . ".h", $conditional);
</del><ins>+ AddToIncludes("JS" . $type->name . ".h", $includesRef, $conditional);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type->name eq "SerializedScriptValue") {
</span><del>- AddToImplIncludes("SerializedScriptValue.h", $conditional);
</del><ins>+ AddToIncludes("SerializedScriptValue.h", $includesRef, $conditional);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type->name eq "Dictionary") {
</span><del>- AddToImplIncludes("Dictionary.h", $conditional);
</del><ins>+ AddToIncludes("Dictionary.h", $includesRef, $conditional);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -302,16 +317,22 @@
</span><span class="cx">
</span><span class="cx"> sub AddToImplIncludes
</span><span class="cx"> {
</span><del>- my $header = shift;
- my $conditional = shift;
</del><ins>+ my ($header, $conditional) = @_;
</ins><span class="cx">
</span><ins>+ AddToIncludes($header, \%implIncludes, $conditional);
+}
+
+sub AddToIncludes
+{
+ my ($header, $includesRef, $conditional) = @_;
+
</ins><span class="cx"> if (not $conditional) {
</span><del>- $implIncludes{$header} = 1;
- } elsif (not exists($implIncludes{$header})) {
- $implIncludes{$header} = $conditional;
</del><ins>+ $includesRef->{$header} = 1;
+ } elsif (not exists($includesRef->{$header})) {
+ $includesRef->{$header} = $conditional;
</ins><span class="cx"> } else {
</span><del>- my $oldValue = $implIncludes{$header};
- $implIncludes{$header} = "$oldValue|$conditional" if $oldValue ne 1;
</del><ins>+ my $oldValue = $includesRef->{$header};
+ $includesRef->{$header} = "$oldValue|$conditional" if $oldValue ne 1;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2028,7 +2049,7 @@
</span><span class="cx"> };
</span><span class="cx"> my $isCallbackFunctionOrDictionary = sub {
</span><span class="cx"> my $type = shift;
</span><del>- return $codeGenerator->IsFunctionOnlyCallbackInterface($type) || &$isDictionary($type);
</del><ins>+ return $codeGenerator->IsCallbackFunction($type) || &$isDictionary($type);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> # Two types are distinguishable for overload resolution if at most one of the two includes a nullable type.
</span><span class="lines">@@ -2183,7 +2204,7 @@
</span><span class="cx"> };
</span><span class="cx"> my $isObjectOrCallbackFunctionParameter = sub {
</span><span class="cx"> my ($type, $optionality) = @_;
</span><del>- return $type->name eq "object" || $codeGenerator->IsFunctionOnlyCallbackInterface($type);
</del><ins>+ return $type->name eq "object" || $codeGenerator->IsCallbackFunction($type);
</ins><span class="cx"> };
</span><span class="cx"> my $isSequenceOrFrozenArrayParameter = sub {
</span><span class="cx"> my ($type, $optionality) = @_;
</span><span class="lines">@@ -2193,7 +2214,7 @@
</span><span class="cx"> my ($type, $optionality) = @_;
</span><span class="cx"> return 1 if &$isDictionaryParameter($type, $optionality);
</span><span class="cx"> return 1 if $type->name eq "object";
</span><del>- return 1 if $codeGenerator->IsCallbackInterface($type) && !$codeGenerator->IsFunctionOnlyCallbackInterface($type);
</del><ins>+ return 1 if $codeGenerator->IsCallbackInterface($type) && !$codeGenerator->IsCallbackFunction($type);
</ins><span class="cx"> return 0;
</span><span class="cx"> };
</span><span class="cx"> my $isBooleanParameter = sub {
</span><span class="lines">@@ -4444,13 +4465,13 @@
</span><span class="cx"> $argument->default("null") if $type->isNullable;
</span><span class="cx">
</span><span class="cx"> # For callback arguments, the generated bindings treat undefined as null, so use null as implicit default value.
</span><del>- $argument->default("null") if $codeGenerator->IsCallbackInterface($type);
</del><ins>+ $argument->default("null") if $codeGenerator->IsCallbackInterface($type) || $codeGenerator->IsCallbackFunction($type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> my $name = $argument->name;
</span><span class="cx"> my $value = $name;
</span><span class="cx">
</span><del>- if ($codeGenerator->IsCallbackInterface($type)) {
</del><ins>+ if ($codeGenerator->IsCallbackInterface($type) || $codeGenerator->IsCallbackFunction($type)) {
</ins><span class="cx"> my $callbackClassName = GetCallbackClassName($type->name);
</span><span class="cx"> my $typeName = $type->name;
</span><span class="cx"> $implIncludes{"$callbackClassName.h"} = 1;
</span><span class="lines">@@ -4457,7 +4478,7 @@
</span><span class="cx"> if ($argument->isOptional) {
</span><span class="cx"> push(@$outputArray, " RefPtr<$typeName> $name;\n");
</span><span class="cx"> push(@$outputArray, " if (!state->argument($argumentIndex).isUndefinedOrNull()) {\n");
</span><del>- if ($codeGenerator->IsFunctionOnlyCallbackInterface($type)) {
</del><ins>+ if ($codeGenerator->IsCallbackFunction($type)) {
</ins><span class="cx"> push(@$outputArray, " if (!state->uncheckedArgument($argumentIndex).isFunction())\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@$outputArray, " if (!state->uncheckedArgument($argumentIndex).isObject())\n");
</span><span class="lines">@@ -4472,7 +4493,7 @@
</span><span class="cx"> push(@$outputArray, " }\n");
</span><span class="cx"> } else {
</span><span class="cx"> die "CallbackInterface does not support Variadic arguments" if $argument->isVariadic;
</span><del>- if ($codeGenerator->IsFunctionOnlyCallbackInterface($type)) {
</del><ins>+ if ($codeGenerator->IsCallbackFunction($type)) {
</ins><span class="cx"> push(@$outputArray, " if (UNLIKELY(!state->uncheckedArgument($argumentIndex).isFunction()))\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@$outputArray, " if (UNLIKELY(!state->uncheckedArgument($argumentIndex).isObject()))\n");
</span><span class="lines">@@ -4676,138 +4697,210 @@
</span><span class="cx"> push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub GenerateCallbackHeader
</del><ins>+sub GenerateCallbackFunctionHeader
</ins><span class="cx"> {
</span><del>- my ($object, $interface, $enumerations, $dictionaries) = @_;
</del><ins>+ my ($object, $callbackFunction, $enumerations, $dictionaries) = @_;
</ins><span class="cx">
</span><del>- my $interfaceName = $interface->type->name;
- my $className = "JS$interfaceName";
</del><ins>+ push(@headerContentHeader, GenerateHeaderContentHeader($callbackFunction));
</ins><span class="cx">
</span><del>- # - Add default header template and header protection
- push(@headerContentHeader, GenerateHeaderContentHeader($interface));
</del><ins>+ push(@headerContent, "\nnamespace WebCore {\n\n");
</ins><span class="cx">
</span><del>- $headerIncludes{"ActiveDOMCallback.h"} = 1;
- $headerIncludes{"$interfaceName.h"} = 1;
- $headerIncludes{"JSCallbackData.h"} = 1;
- $headerIncludes{"<wtf/Forward.h>"} = 1;
</del><ins>+ my @functions = ();
+ push(@functions, $callbackFunction->operation);
+ my @constants = ();
</ins><span class="cx">
</span><ins>+ $object->GenerateCallbackHeaderContent($callbackFunction, \@functions, \@constants, \@headerContent, \%headerIncludes);
+
+ push(@headerContent, GenerateEnumerationsHeaderContent($callbackFunction, $enumerations));
+ push(@headerContent, GenerateDictionariesHeaderContent($callbackFunction, $dictionaries));
+
+ push(@headerContent, "} // namespace WebCore\n");
+
+ my $conditionalString = $codeGenerator->GenerateConditionalString($callbackFunction);
+ push(@headerContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
+}
+
+sub GenerateCallbackFunctionImplementation
+{
+ my ($object, $callbackFunction, $enumerations, $dictionaries) = @_;
+
+ push(@implContentHeader, GenerateImplementationContentHeader($callbackFunction));
+
+ push(@implContent, "\nusing namespace JSC;\n\n");
+ push(@implContent, "namespace WebCore {\n\n");
+
+ push(@implContent, GenerateEnumerationsImplementationContent($callbackFunction, $enumerations));
+ push(@implContent, GenerateDictionariesImplementationContent($callbackFunction, $dictionaries));
+
+ my @functions = ();
+ push(@functions, $callbackFunction->operation);
+ my @constants = ();
+
+ $object->GenerateCallbackImplementationContent($callbackFunction, \@functions, \@constants, \@implContent, \%implIncludes);
+
+ push(@implContent, "} // namespace WebCore\n");
+
+ my $conditionalString = $codeGenerator->GenerateConditionalString($callbackFunction);
+ push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
+}
+
+sub GenerateCallbackInterfaceHeader
+{
+ my ($object, $callbackInterface, $enumerations, $dictionaries) = @_;
+
+ push(@headerContentHeader, GenerateHeaderContentHeader($callbackInterface));
+
</ins><span class="cx"> push(@headerContent, "\nnamespace WebCore {\n\n");
</span><del>- push(@headerContent, "class $className : public $interfaceName, public ActiveDOMCallback {\n");
- push(@headerContent, "public:\n");
</del><ins>+
+ $object->GenerateCallbackHeaderContent($callbackInterface, $callbackInterface->functions, $callbackInterface->constants, \@headerContent, \%headerIncludes);
</ins><span class="cx">
</span><ins>+ push(@headerContent, GenerateEnumerationsHeaderContent($callbackInterface, $enumerations));
+ push(@headerContent, GenerateDictionariesHeaderContent($callbackInterface, $dictionaries));
+
+ push(@headerContent, "} // namespace WebCore\n");
+
+ my $conditionalString = $codeGenerator->GenerateConditionalString($callbackInterface);
+ push(@headerContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
+}
+
+sub GenerateCallbackInterfaceImplementation
+{
+ my ($object, $callbackInterface, $enumerations, $dictionaries) = @_;
+
+ push(@implContentHeader, GenerateImplementationContentHeader($callbackInterface));
+
+ push(@implContent, "\nusing namespace JSC;\n\n");
+ push(@implContent, "namespace WebCore {\n\n");
+
+ push(@implContent, GenerateEnumerationsImplementationContent($callbackInterface, $enumerations));
+ push(@implContent, GenerateDictionariesImplementationContent($callbackInterface, $dictionaries));
+
+ $object->GenerateCallbackImplementationContent($callbackInterface, $callbackInterface->functions, $callbackInterface->constants, \@implContent, \%implIncludes);
+
+ push(@implContent, "} // namespace WebCore\n");
+
+ my $conditionalString = $codeGenerator->GenerateConditionalString($callbackInterface);
+ push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
+}
+
+sub GenerateCallbackHeaderContent
+{
+ my ($object, $interfaceOrCallback, $functions, $constants, $contentRef, $includesRef) = @_;
+
+ my $name = $interfaceOrCallback->type->name;
+ my $callbackDataType = GetJSCallbackDataType($interfaceOrCallback);
+ my $className = "JS${name}";
+
+ $includesRef->{"ActiveDOMCallback.h"} = 1;
+ $includesRef->{"JSCallbackData.h"} = 1;
+ $includesRef->{"<wtf/Forward.h>"} = 1;
+ $includesRef->{"${name}.h"} = 1;
+
+ push(@$contentRef, "class $className : public ${name}, public ActiveDOMCallback {\n");
+ push(@$contentRef, "public:\n");
+
</ins><span class="cx"> # The static create() method.
</span><del>- push(@headerContent, " static Ref<$className> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)\n");
- push(@headerContent, " {\n");
- push(@headerContent, " return adoptRef(*new $className(callback, globalObject));\n");
- push(@headerContent, " }\n\n");
</del><ins>+ push(@$contentRef, " static Ref<$className> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)\n");
+ push(@$contentRef, " {\n");
+ push(@$contentRef, " return adoptRef(*new ${className}(callback, globalObject));\n");
+ push(@$contentRef, " }\n\n");
</ins><span class="cx">
</span><del>- push(@headerContent, " virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }\n\n");
</del><ins>+ push(@$contentRef, " virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }\n\n");
</ins><span class="cx">
</span><del>- push(@headerContent, " virtual ~$className();\n");
</del><ins>+ push(@$contentRef, " virtual ~$className();\n");
</ins><span class="cx">
</span><del>- push(@headerContent, " " . GetJSCallbackDataType($interface) . "* callbackData() { return m_data; }\n");
</del><ins>+ push(@$contentRef, " ${callbackDataType}* callbackData() { return m_data; }\n");
</ins><span class="cx">
</span><del>- push(@headerContent, " static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);\n") if @{$interface->constants};
</del><ins>+ push(@$contentRef, " static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);\n") if @{$constants};
</ins><span class="cx">
</span><del>- push(@headerContent, " virtual bool operator==(const $interfaceName&) const;\n\n") if $interface->extendedAttributes->{CallbackNeedsOperatorEqual};
</del><ins>+ push(@$contentRef, " virtual bool operator==(const ${name}&) const;\n\n") if $interfaceOrCallback->extendedAttributes->{CallbackNeedsOperatorEqual};
</ins><span class="cx">
</span><span class="cx"> # Functions
</span><del>- my $numFunctions = @{$interface->functions};
</del><ins>+ my $numFunctions = @{$functions};
</ins><span class="cx"> if ($numFunctions > 0) {
</span><del>- push(@headerContent, "\n // Functions\n");
- foreach my $function (@{$interface->functions}) {
</del><ins>+ push(@$contentRef, "\n // Functions\n");
+ foreach my $function (@{$functions}) {
</ins><span class="cx"> my @arguments = ();
</span><span class="cx"> foreach my $argument (@{$function->arguments}) {
</span><del>- push(@arguments, GetNativeTypeForCallbacks($interface, $argument->type) . " " . $argument->name);
</del><ins>+ push(@arguments, GetNativeTypeForCallbacks($argument->type, $interfaceOrCallback) . " " . $argument->name);
</ins><span class="cx"> }
</span><del>- push(@headerContent, " virtual " . GetNativeTypeForCallbacks($interface, $function->type) . " " . $function->name . "(" . join(", ", @arguments) . ");\n");
</del><ins>+
+ # FIXME: Add support for non-void return types (the bool actually is returning exception state), for non-custom functions.
+ my $nativeReturnType = $function->extendedAttributes->{Custom} ? GetNativeTypeForCallbacks($function->type, $interfaceOrCallback) : "bool";
+
+ # FIXME: Change the default name (used for callback functions) to something other than handleEvent. It makes little sense.
+ my $functionName = $function->name ? $function->name : "handleEvent";
+
+ push(@$contentRef, " virtual ${nativeReturnType} ${functionName}(" . join(", ", @arguments) . ");\n");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- push(@headerContent, "\nprivate:\n");
</del><ins>+ push(@$contentRef, "\nprivate:\n");
</ins><span class="cx">
</span><span class="cx"> # Constructor
</span><del>- push(@headerContent, " $className(JSC::JSObject* callback, JSDOMGlobalObject*);\n\n");
</del><ins>+ push(@$contentRef, " $className(JSC::JSObject* callback, JSDOMGlobalObject*);\n\n");
</ins><span class="cx">
</span><span class="cx"> # Private members
</span><del>- push(@headerContent, " " . GetJSCallbackDataType($interface) . "* m_data;\n");
- push(@headerContent, "};\n\n");
</del><ins>+ push(@$contentRef, " ${callbackDataType}* m_data;\n");
+ push(@$contentRef, "};\n\n");
</ins><span class="cx">
</span><span class="cx"> # toJS().
</span><del>- push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName&);\n");
- push(@headerContent, "inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, $interfaceName* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }\n\n");
-
- push(@headerContent, GenerateEnumerationsHeaderContent($interface, $enumerations));
- push(@headerContent, GenerateDictionariesHeaderContent($interface, $dictionaries));
-
- push(@headerContent, "} // namespace WebCore\n");
-
- my $conditionalString = $codeGenerator->GenerateConditionalString($interface);
- push(@headerContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
</del><ins>+ push(@$contentRef, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, ${name}&);\n");
+ push(@$contentRef, "inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, ${name}* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }\n\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-sub GenerateCallbackImplementation
</del><ins>+sub GenerateCallbackImplementationContent
</ins><span class="cx"> {
</span><del>- my ($object, $interface, $enumerations, $dictionaries) = @_;
</del><ins>+ my ($object, $interfaceOrCallback, $functions, $constants, $contentRef, $includesRef) = @_;
</ins><span class="cx">
</span><del>- my $interfaceName = $interface->type->name;
- my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
- my $className = "JS$interfaceName";
</del><ins>+ my $name = $interfaceOrCallback->type->name;
+ my $callbackDataType = GetJSCallbackDataType($interfaceOrCallback);
+ my $visibleName = $codeGenerator->GetVisibleInterfaceName($interfaceOrCallback);
+ my $className = "JS${name}";
</ins><span class="cx">
</span><del>- # - Add default header template
- push(@implContentHeader, GenerateImplementationContentHeader($interface));
</del><ins>+ $includesRef->{"ScriptExecutionContext.h"} = 1;
+ $includesRef->{"<runtime/JSLock.h>"} = 1;
</ins><span class="cx">
</span><del>- $implIncludes{"ScriptExecutionContext.h"} = 1;
- $implIncludes{"<runtime/JSLock.h>"} = 1;
-
- @implContent = ();
-
- push(@implContent, "\nusing namespace JSC;\n\n");
- push(@implContent, "namespace WebCore {\n\n");
-
- push(@implContent, GenerateEnumerationsImplementationContent($interface, $enumerations));
- push(@implContent, GenerateDictionariesImplementationContent($interface, $dictionaries));
-
</del><span class="cx"> # Constructor
</span><del>- push(@implContent, "${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n");
- if ($interface->extendedAttributes->{CallbackNeedsOperatorEqual}) {
- push(@implContent, " : ${interfaceName}(${className}Type)\n");
</del><ins>+ push(@$contentRef, "${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n");
+ if ($interfaceOrCallback->extendedAttributes->{CallbackNeedsOperatorEqual}) {
+ push(@$contentRef, " : ${name}(${className}Type)\n");
</ins><span class="cx"> } else {
</span><del>- push(@implContent, " : ${interfaceName}()\n");
</del><ins>+ push(@$contentRef, " : ${name}()\n");
</ins><span class="cx"> }
</span><del>- push(@implContent, " , ActiveDOMCallback(globalObject->scriptExecutionContext())\n");
- push(@implContent, " , m_data(new " . GetJSCallbackDataType($interface) . "(callback, this))\n");
- push(@implContent, "{\n");
- push(@implContent, "}\n\n");
</del><ins>+ push(@$contentRef, " , ActiveDOMCallback(globalObject->scriptExecutionContext())\n");
+ push(@$contentRef, " , m_data(new ${callbackDataType}(callback, this))\n");
+ push(@$contentRef, "{\n");
+ push(@$contentRef, "}\n\n");
</ins><span class="cx">
</span><span class="cx"> # Destructor
</span><del>- push(@implContent, "${className}::~${className}()\n");
- push(@implContent, "{\n");
- push(@implContent, " ScriptExecutionContext* context = scriptExecutionContext();\n");
- push(@implContent, " // When the context is destroyed, all tasks with a reference to a callback\n");
- push(@implContent, " // should be deleted. So if the context is 0, we are on the context thread.\n");
- push(@implContent, " if (!context || context->isContextThread())\n");
- push(@implContent, " delete m_data;\n");
- push(@implContent, " else\n");
- push(@implContent, " context->postTask(DeleteCallbackDataTask(m_data));\n");
- push(@implContent, "#ifndef NDEBUG\n");
- push(@implContent, " m_data = nullptr;\n");
- push(@implContent, "#endif\n");
- push(@implContent, "}\n\n");
</del><ins>+ push(@$contentRef, "${className}::~${className}()\n");
+ push(@$contentRef, "{\n");
+ push(@$contentRef, " ScriptExecutionContext* context = scriptExecutionContext();\n");
+ push(@$contentRef, " // When the context is destroyed, all tasks with a reference to a callback\n");
+ push(@$contentRef, " // should be deleted. So if the context is 0, we are on the context thread.\n");
+ push(@$contentRef, " if (!context || context->isContextThread())\n");
+ push(@$contentRef, " delete m_data;\n");
+ push(@$contentRef, " else\n");
+ push(@$contentRef, " context->postTask(DeleteCallbackDataTask(m_data));\n");
+ push(@$contentRef, "#ifndef NDEBUG\n");
+ push(@$contentRef, " m_data = nullptr;\n");
+ push(@$contentRef, "#endif\n");
+ push(@$contentRef, "}\n\n");
</ins><span class="cx">
</span><del>- if ($interface->extendedAttributes->{CallbackNeedsOperatorEqual}) {
- push(@implContent, "bool ${className}::operator==(const ${interfaceName}& other) const\n");
- push(@implContent, "{\n");
- push(@implContent, " if (other.type() != type())\n");
- push(@implContent, " return false;\n");
- push(@implContent, " return static_cast<const ${className}*>(&other)->m_data->callback() == m_data->callback();\n");
- push(@implContent, "}\n\n");
</del><ins>+ if ($interfaceOrCallback->extendedAttributes->{CallbackNeedsOperatorEqual}) {
+ push(@$contentRef, "bool ${className}::operator==(const ${name}& other) const\n");
+ push(@$contentRef, "{\n");
+ push(@$contentRef, " if (other.type() != type())\n");
+ push(@$contentRef, " return false;\n");
+ push(@$contentRef, " return static_cast<const ${className}*>(&other)->m_data->callback() == m_data->callback();\n");
+ push(@$contentRef, "}\n\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Constants.
</span><del>- my $numConstants = @{$interface->constants};
</del><ins>+ my $numConstants = @{$constants};
</ins><span class="cx"> if ($numConstants > 0) {
</span><del>- GenerateConstructorDeclaration(\@implContent, $className, $interface, $interfaceName);
</del><ins>+ GenerateConstructorDeclaration($contentRef, $className, $interfaceOrCallback, $name);
</ins><span class="cx">
</span><span class="cx"> my $hashSize = 0;
</span><span class="cx"> my $hashName = $className . "ConstructorTable";
</span><span class="lines">@@ -4818,7 +4911,7 @@
</span><span class="cx"> my @hashSpecials = ();
</span><span class="cx"> my %conditionals = ();
</span><span class="cx">
</span><del>- foreach my $constant (@{$interface->constants}) {
</del><ins>+ foreach my $constant (@{$constants}) {
</ins><span class="cx"> my $name = $constant->name;
</span><span class="cx"> push(@hashKeys, $name);
</span><span class="cx"> push(@hashValue1, $constant->value);
</span><span class="lines">@@ -4835,93 +4928,71 @@
</span><span class="cx"> }
</span><span class="cx"> $object->GenerateHashTable($hashName, $hashSize, \@hashKeys, \@hashSpecials, \@hashValue1, \@hashValue2, \%conditionals, 1) if $hashSize > 0;
</span><span class="cx">
</span><del>- push(@implContent, $codeGenerator->GenerateCompileTimeCheckForEnumsIfNeeded($interface));
</del><ins>+ push(@$contentRef, $codeGenerator->GenerateCompileTimeCheckForEnumsIfNeeded($interfaceOrCallback));
</ins><span class="cx">
</span><del>- GenerateConstructorDefinitions(\@implContent, $className, "", $visibleInterfaceName, $interface);
</del><ins>+ GenerateConstructorDefinitions($contentRef, $className, "", $visibleName, $interfaceOrCallback);
</ins><span class="cx">
</span><del>- push(@implContent, "JSValue ${className}::getConstructor(VM& vm, const JSGlobalObject* globalObject)\n{\n");
- push(@implContent, " return getDOMConstructor<${className}Constructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));\n");
- push(@implContent, "}\n\n");
</del><ins>+ push(@$contentRef, "JSValue ${className}::getConstructor(VM& vm, const JSGlobalObject* globalObject)\n{\n");
+ push(@$contentRef, " return getDOMConstructor<${className}Constructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));\n");
+ push(@$contentRef, "}\n\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Functions.
</span><del>- my $numFunctions = @{$interface->functions};
</del><ins>+ my $numFunctions = @{$functions};
</ins><span class="cx"> if ($numFunctions > 0) {
</span><del>- push(@implContent, "\n// Functions\n");
- foreach my $function (@{$interface->functions}) {
- my @params = @{$function->arguments};
- if ($function->extendedAttributes->{Custom} || GetNativeType($interface, $function->type) ne "bool") {
- next;
- }
</del><ins>+ foreach my $function (@{$functions}) {
+ next if $function->extendedAttributes->{Custom};
+
+ assert("Unsupport return type: " . $function->type->name . ".") unless $function->type->name eq "void";
</ins><span class="cx">
</span><del>- AddToImplIncludesForIDLType($function->type);
- my $functionName = $function->name;
- push(@implContent, "\n" . GetNativeTypeForCallbacks($interface, $function->type) . " ${className}::${functionName}(");
</del><ins>+ AddToIncludesForIDLType($function->type, $includesRef);
+
+ # FIXME: Change the default name (used for callback functions) to something other than handleEvent. It makes little sense.
+ my $functionName = $function->name ? $function->name : "handleEvent";
</ins><span class="cx">
</span><span class="cx"> my @args = ();
</span><del>- my @argsCheck = ();
- foreach my $param (@params) {
- my $paramName = $param->name;
- AddToImplIncludesForIDLType($param->type, 1);
- push(@args, GetNativeTypeForCallbacks($interface, $param->type) . " " . $paramName);
</del><ins>+ foreach my $argument (@{$function->arguments}) {
+ AddToIncludesForIDLType($argument->type, $includesRef, 1);
+ push(@args, GetNativeTypeForCallbacks($argument->type, $interfaceOrCallback) . " " . $argument->name);
</ins><span class="cx"> }
</span><del>- push(@implContent, join(", ", @args));
- push(@implContent, ")\n");
</del><ins>+ push(@$contentRef, "bool ${className}::${functionName}(" . join(", ", @args) . ")\n");
+ push(@$contentRef, "{\n");
+ push(@$contentRef, " if (!canInvokeCallback())\n");
+ push(@$contentRef, " return true;\n\n");
+ push(@$contentRef, " Ref<$className> protectedThis(*this);\n\n");
+ push(@$contentRef, " JSLockHolder lock(m_data->globalObject()->vm());\n\n");
+ push(@$contentRef, " ExecState* state = m_data->globalObject()->globalExec();\n");
+ push(@$contentRef, " MarkedArgumentBuffer args;\n");
</ins><span class="cx">
</span><del>- push(@implContent, "{\n");
- push(@implContent, @argsCheck) if @argsCheck;
- push(@implContent, " if (!canInvokeCallback())\n");
- push(@implContent, " return true;\n\n");
- push(@implContent, " Ref<$className> protectedThis(*this);\n\n");
- push(@implContent, " JSLockHolder lock(m_data->globalObject()->vm());\n\n");
- push(@implContent, " ExecState* state = m_data->globalObject()->globalExec();\n");
- push(@implContent, " MarkedArgumentBuffer args;\n");
-
- foreach my $param (@params) {
- my $paramName = $param->name;
- push(@implContent, " args.append(" . NativeToJSValueUsingPointers($param, 1, $interface, $paramName, "m_data") . ");\n");
</del><ins>+ foreach my $argument (@{$function->arguments}) {
+ push(@$contentRef, " args.append(" . NativeToJSValueUsingPointers($argument, 1, $interfaceOrCallback, $argument->name, "m_data") . ");\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- push(@implContent, "\n NakedPtr<JSC::Exception> returnedException;\n");
</del><ins>+ push(@$contentRef, "\n NakedPtr<JSC::Exception> returnedException;\n");
</ins><span class="cx">
</span><del>- my $propertyToLookup = "Identifier::fromString(state, \"${functionName}\")";
- my $invokeMethod = "JSCallbackData::CallbackType::FunctionOrObject";
- if ($codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{Callback}, "FunctionOnly")) {
- # For callback functions, do not look up callable property on the user object.
- # https://heycam.github.io/webidl/#es-callback-function
- $invokeMethod = "JSCallbackData::CallbackType::Function";
- $propertyToLookup = "Identifier()";
- push(@implContent, " UNUSED_PARAM(state);\n");
- } elsif ($numFunctions > 1) {
- # The callback interface has more than one operation so we should not call the user object as a function.
- # instead, we should look for a property with the same name as the operation on the user object.
- # https://heycam.github.io/webidl/#es-user-objects
- $invokeMethod = "JSCallbackData::CallbackType::Object";
</del><ins>+ if (ref($interfaceOrCallback) eq "IDLCallbackFunction") {
+ push(@$contentRef, " m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);\n");
+ } else {
+ my $callbackType = $numFunctions > 1 ? "Object" : "FunctionOrObject";
+ push(@$contentRef, " m_data->invokeCallback(args, JSCallbackData::CallbackType::${callbackType}, Identifier::fromString(state, \"${functionName}\"), returnedException);\n");
</ins><span class="cx"> }
</span><del>- push(@implContent, " m_data->invokeCallback(args, $invokeMethod, $propertyToLookup, returnedException);\n");
</del><span class="cx">
</span><span class="cx"> # FIXME: We currently just report the exception. We should probably add an extended attribute to indicate when
</span><span class="cx"> # we want the exception to be rethrown instead.
</span><del>- push(@implContent, " if (returnedException)\n");
- push(@implContent, " reportException(state, returnedException);\n");
- push(@implContent, " return !returnedException;\n");
- push(@implContent, "}\n");
</del><ins>+ push(@$contentRef, " if (returnedException)\n");
+ push(@$contentRef, " reportException(state, returnedException);\n");
+ push(@$contentRef, " return !returnedException;\n");
+ push(@$contentRef, "}\n\n");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # toJS() implementation.
</span><del>- push(@implContent, "\nJSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName& impl)\n");
- push(@implContent, "{\n");
- push(@implContent, " if (!static_cast<${className}&>(impl).callbackData())\n");
- push(@implContent, " return jsNull();\n\n");
- push(@implContent, " return static_cast<${className}&>(impl).callbackData()->callback();\n\n");
- push(@implContent, "}\n");
-
- push(@implContent, "\n}\n");
- my $conditionalString = $codeGenerator->GenerateConditionalString($interface);
- push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
-
- push(@implContent, split("\r", $endAppleCopyright)) if $interface->extendedAttributes->{AppleCopyright};
</del><ins>+ push(@$contentRef, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, ${name}& impl)\n");
+ push(@$contentRef, "{\n");
+ push(@$contentRef, " if (!static_cast<${className}&>(impl).callbackData())\n");
+ push(@$contentRef, " return jsNull();\n\n");
+ push(@$contentRef, " return static_cast<${className}&>(impl).callbackData()->callback();\n\n");
+ push(@$contentRef, "}\n\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GenerateImplementationFunctionCall()
</span><span class="lines">@@ -5282,7 +5353,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($parameter, $interface) = @_;
</span><span class="cx">
</span><del>- return 0 if $codeGenerator->IsCallbackInterface($parameter->type);
</del><ins>+ return 0 if $codeGenerator->IsCallbackInterface($parameter->type) || $codeGenerator->IsCallbackFunction($parameter->type);
</ins><span class="cx">
</span><span class="cx"> my $nativeType = GetNativeType($interface, $parameter->type);
</span><span class="cx"> return $codeGenerator->ShouldPassWrapperByReference($parameter) && (substr($nativeType, -1) eq '*' || $nativeType =~ /^RefPtr/);
</span><span class="lines">@@ -5300,7 +5371,7 @@
</span><span class="cx">
</span><span class="cx"> sub GetNativeTypeForCallbacks
</span><span class="cx"> {
</span><del>- my ($interface, $type) = @_;
</del><ins>+ my ($type, $interface) = @_;
</ins><span class="cx">
</span><span class="cx"> return "RefPtr<SerializedScriptValue>&&" if $type->name eq "SerializedScriptValue";
</span><span class="cx"> return "const String&" if $codeGenerator->IsStringType($type);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> CEReactions
</span><span class="cx"> CachedAttribute
</span><span class="cx"> CallbackNeedsOperatorEqual
</span><del>-Callback=FunctionOnly
</del><span class="cx"> CallWith=Document|ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow|CallerDocument|CallerWindow
</span><span class="cx"> CheckSecurity
</span><span class="cx"> CheckSecurityForNode
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> interfaces => '@', # List of 'IDLInterface'
</span><span class="cx"> enumerations => '@', # List of 'IDLEnum'
</span><span class="cx"> dictionaries => '@', # List of 'IDLDictionary'
</span><ins>+ callbackFunctions => '@', # List of 'IDLCallbackFunction'
</ins><span class="cx"> fileName => '$',
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -135,7 +136,7 @@
</span><span class="cx"> extendedAttributes => '$',
</span><span class="cx"> });
</span><span class="cx">
</span><del>-
</del><ins>+# https://heycam.github.io/webidl/#dfn-dictionary-member
</ins><span class="cx"> struct( IDLDictionaryMember => {
</span><span class="cx"> name => '$',
</span><span class="cx"> type => 'IDLType',
</span><span class="lines">@@ -144,7 +145,6 @@
</span><span class="cx"> extendedAttributes => '$',
</span><span class="cx"> });
</span><span class="cx">
</span><del>-
</del><span class="cx"> # https://heycam.github.io/webidl/#idl-dictionaries
</span><span class="cx"> struct( IDLDictionary => {
</span><span class="cx"> type => 'IDLType',
</span><span class="lines">@@ -153,7 +153,14 @@
</span><span class="cx"> extendedAttributes => '$',
</span><span class="cx"> });
</span><span class="cx">
</span><del>-# https://heycam.github.io/webidl/#idl-enums
</del><ins>+# https://heycam.github.io/webidl/#idl-callback-functions
+struct( IDLCallbackFunction => {
+ type => '$',
+ operation => 'IDLOperation',
+ extendedAttributes => '$',
+});
+
+# https://heycam.github.io/webidl/#idl-typedefs
</ins><span class="cx"> struct( IDLTypedef => {
</span><span class="cx"> type => 'IDLType',
</span><span class="cx"> });
</span><span class="lines">@@ -276,6 +283,8 @@
</span><span class="cx"> push(@{$document->enumerations}, $definition);
</span><span class="cx"> } elsif (ref($definition) eq "IDLDictionary") {
</span><span class="cx"> push(@{$document->dictionaries}, $definition);
</span><ins>+ } elsif (ref($definition) eq "IDLCallbackFunction") {
+ push(@{$document->callbackFunctions}, $definition);
</ins><span class="cx"> } else {
</span><span class="cx"> die "Unrecognized IDL definition kind: \"" . ref($definition) . "\"";
</span><span class="cx"> }
</span><span class="lines">@@ -467,23 +476,33 @@
</span><span class="cx"> foreach my $attribute (@{$definition->attributes}) {
</span><span class="cx"> $attribute->type($self->typeByApplyingTypedefs($attribute->type));
</span><span class="cx"> }
</span><del>- foreach my $function (@{$definition->functions}, @{$definition->anonymousFunctions}, @{$definition->constructors}, @{$definition->customConstructors}) {
- if ($function->type) {
- $function->type($self->typeByApplyingTypedefs($function->type));
- }
-
- foreach my $argument (@{$function->arguments}) {
- $argument->type($self->typeByApplyingTypedefs($argument->type));
- }
</del><ins>+ foreach my $operation (@{$definition->functions}, @{$definition->anonymousFunctions}, @{$definition->constructors}, @{$definition->customConstructors}) {
+ $self->applyTypedefsToOperation($operation);
</ins><span class="cx"> }
</span><span class="cx"> } elsif (ref($definition) eq "IDLDictionary") {
</span><span class="cx"> foreach my $member (@{$definition->members}) {
</span><span class="cx"> $member->type($self->typeByApplyingTypedefs($member->type));
</span><span class="cx"> }
</span><ins>+ } elsif (ref($definition) eq "IDLCallbackFunction") {
+ $self->applyTypedefsToOperation($definition->operation);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub applyTypedefsToOperation
+{
+ my $self = shift;
+ my $operation = shift;
+
+ if ($operation->type) {
+ $operation->type($self->typeByApplyingTypedefs($operation->type));
+ }
+
+ foreach my $argument (@{$operation->arguments}) {
+ $argument->type($self->typeByApplyingTypedefs($argument->type));
+ }
+}
+
</ins><span class="cx"> sub typeByApplyingTypedefs
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="lines">@@ -950,14 +969,30 @@
</span><span class="cx">
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->type() == IdentifierToken) {
</span><del>- $self->assertTokenType($self->getToken(), IdentifierToken);
</del><ins>+ my $callback = IDLCallbackFunction->new();
+
+ my $nameToken = $self->getToken();
+ $self->assertTokenType($nameToken, IdentifierToken);
+
+ $callback->type(makeSimpleType($nameToken->value()));
+
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), "=", __LINE__);
</span><del>- $self->parseReturnType();
</del><ins>+
+ my $operation = IDLOperation->new();
+ $operation->type($self->parseReturnType());
+ $operation->extendedAttributes($extendedAttributeList);
+
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), "(", __LINE__);
</span><del>- $self->parseArgumentList();
</del><ins>+
+ push(@{$operation->arguments}, @{$self->parseArgumentList()});
+
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), ")", __LINE__);
</span><span class="cx"> $self->assertTokenValue($self->getToken(), ";", __LINE__);
</span><del>- return;
</del><ins>+
+ $callback->operation($operation);
+ $callback->extendedAttributes($extendedAttributeList);
+
+ return $callback;
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,230 +0,0 @@
</span><del>-/*
- This file is part of the WebKit open source project.
- This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SPEECH_SYNTHESIS)
-
-#include "JSTestCallback.h"
-
-#include "JSDOMConstructor.h"
-#include "JSDOMConvert.h"
-#include "JSDOMStringList.h"
-#include "JSTestNode.h"
-#include "ScriptExecutionContext.h"
-#include "SerializedScriptValue.h"
-#include <runtime/JSLock.h>
-#include <runtime/ObjectPrototype.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSTestCallback::JSTestCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
- : TestCallback()
- , ActiveDOMCallback(globalObject->scriptExecutionContext())
- , m_data(new JSCallbackDataStrong(callback, this))
-{
-}
-
-JSTestCallback::~JSTestCallback()
-{
- ScriptExecutionContext* context = scriptExecutionContext();
- // When the context is destroyed, all tasks with a reference to a callback
- // should be deleted. So if the context is 0, we are on the context thread.
- if (!context || context->isContextThread())
- delete m_data;
- else
- context->postTask(DeleteCallbackDataTask(m_data));
-#ifndef NDEBUG
- m_data = nullptr;
-#endif
-}
-
-using JSTestCallbackConstructor = JSDOMConstructorNotConstructable<JSTestCallback>;
-
-/* Hash table for constructor */
-
-static const HashTableValue JSTestCallbackConstructorTableValues[] =
-{
- { "CONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
- { "CONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
-};
-
-static_assert(TestCallback::CONSTANT1 == 1, "CONSTANT1 in TestCallback does not match value from IDL");
-static_assert(TestCallback::CONSTANT2 == 2, "CONSTANT2 in TestCallback does not match value from IDL");
-
-template<> JSValue JSTestCallbackConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
-{
- UNUSED_PARAM(vm);
- return globalObject.objectPrototype();
-}
-
-template<> void JSTestCallbackConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
-{
- UNUSED_PARAM(globalObject);
- putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestCallback"))), ReadOnly | DontEnum);
- putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
- reifyStaticProperties(vm, JSTestCallbackConstructorTableValues, *this);
-}
-
-template<> const ClassInfo JSTestCallbackConstructor::s_info = { "TestCallback", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCallbackConstructor) };
-
-JSValue JSTestCallback::getConstructor(VM& vm, const JSGlobalObject* globalObject)
-{
- return getDOMConstructor<JSTestCallbackConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
-}
-
-
-// Functions
-
-bool JSTestCallback::callbackWithNoParam()
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallback> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
-
- NakedPtr<JSC::Exception> returnedException;
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithNoParam"), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallback::callbackWithArrayParam(RefPtr<Float32Array> arrayParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallback> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
- args.append(toJS<IDLInterface<Float32Array>>(*state, *m_data->globalObject(), arrayParam));
-
- NakedPtr<JSC::Exception> returnedException;
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithArrayParam"), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallback::callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strArg)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallback> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
- args.append(srzParam ? srzParam->deserialize(*state, m_data->globalObject()) : jsNull());
- args.append(toJS<IDLDOMString>(*state, strArg));
-
- NakedPtr<JSC::Exception> returnedException;
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithSerializedScriptValueParam"), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallback::callbackWithStringList(DOMStringList* listParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallback> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
- args.append(toJS<IDLInterface<DOMStringList>>(*state, *m_data->globalObject(), listParam));
-
- NakedPtr<JSC::Exception> returnedException;
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithStringList"), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallback::callbackWithBoolean(bool boolParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallback> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
- args.append(toJS<IDLBoolean>(boolParam));
-
- NakedPtr<JSC::Exception> returnedException;
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithBoolean"), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallback::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallback> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
- args.append(toJS<IDLLong>(longParam));
- args.append(toJS<IDLInterface<TestNode>>(*state, *m_data->globalObject(), testNodeParam));
-
- NakedPtr<JSC::Exception> returnedException;
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackRequiresThisToPass"), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallback& impl)
-{
- if (!static_cast<JSTestCallback&>(impl).callbackData())
- return jsNull();
-
- return static_cast<JSTestCallback&>(impl).callbackData()->callback();
-
-}
-
-}
-
-#endif // ENABLE(SPEECH_SYNTHESIS)
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- This file is part of the WebKit open source project.
- This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#pragma once
-
-#if ENABLE(SPEECH_SYNTHESIS)
-
-#include "ActiveDOMCallback.h"
-#include "JSCallbackData.h"
-#include "TestCallback.h"
-#include <wtf/Forward.h>
-
-namespace WebCore {
-
-class JSTestCallback : public TestCallback, public ActiveDOMCallback {
-public:
- static Ref<JSTestCallback> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
- {
- return adoptRef(*new JSTestCallback(callback, globalObject));
- }
-
- virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
-
- virtual ~JSTestCallback();
- JSCallbackDataStrong* callbackData() { return m_data; }
- static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
-
- // Functions
- virtual bool callbackWithNoParam();
- virtual bool callbackWithArrayParam(RefPtr<Float32Array> arrayParam);
- virtual bool callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strArg);
- virtual int32_t callbackWithNonBoolReturnType(const String& strArg);
- virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
- virtual bool callbackWithStringList(DOMStringList* listParam);
- virtual bool callbackWithBoolean(bool boolParam);
- virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
-
-private:
- JSTestCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
-
- JSCallbackDataStrong* m_data;
-};
-
-JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallback&);
-inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallback* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
-
-} // namespace WebCore
-
-#endif // ENABLE(SPEECH_SYNTHESIS)
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> #include "JSTestCallbackFunction.h"
</span><span class="cx">
</span><span class="cx"> #include "JSDOMConvert.h"
</span><del>-#include "JSDOMStringList.h"
</del><span class="cx"> #include "JSTestNode.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="cx"> #include "SerializedScriptValue.h"
</span><span class="lines">@@ -56,10 +55,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-
-// Functions
-
-bool JSTestCallbackFunction::callbackWithNoParam()
</del><ins>+bool JSTestCallbackFunction::handleEvent(RefPtr<Float32Array> arrayParam, RefPtr<SerializedScriptValue>&& srzParam, const String& strArg, bool boolParam, int32_t longParam, TestNode* testNodeParam)
</ins><span class="cx"> {
</span><span class="cx"> if (!canInvokeCallback())
</span><span class="cx"> return true;
</span><span class="lines">@@ -70,116 +66,14 @@
</span><span class="cx">
</span><span class="cx"> ExecState* state = m_data->globalObject()->globalExec();
</span><span class="cx"> MarkedArgumentBuffer args;
</span><del>-
- NakedPtr<JSC::Exception> returnedException;
- UNUSED_PARAM(state);
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithArrayParam(RefPtr<Float32Array> arrayParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallbackFunction> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
</del><span class="cx"> args.append(toJS<IDLInterface<Float32Array>>(*state, *m_data->globalObject(), arrayParam));
</span><del>-
- NakedPtr<JSC::Exception> returnedException;
- UNUSED_PARAM(state);
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strArg)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallbackFunction> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
</del><span class="cx"> args.append(srzParam ? srzParam->deserialize(*state, m_data->globalObject()) : jsNull());
</span><span class="cx"> args.append(toJS<IDLDOMString>(*state, strArg));
</span><del>-
- NakedPtr<JSC::Exception> returnedException;
- UNUSED_PARAM(state);
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithStringList(DOMStringList* listParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallbackFunction> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
- args.append(toJS<IDLInterface<DOMStringList>>(*state, *m_data->globalObject(), listParam));
-
- NakedPtr<JSC::Exception> returnedException;
- UNUSED_PARAM(state);
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithBoolean(bool boolParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallbackFunction> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
</del><span class="cx"> args.append(toJS<IDLBoolean>(boolParam));
</span><del>-
- NakedPtr<JSC::Exception> returnedException;
- UNUSED_PARAM(state);
- m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
- if (returnedException)
- reportException(state, returnedException);
- return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
-{
- if (!canInvokeCallback())
- return true;
-
- Ref<JSTestCallbackFunction> protectedThis(*this);
-
- JSLockHolder lock(m_data->globalObject()->vm());
-
- ExecState* state = m_data->globalObject()->globalExec();
- MarkedArgumentBuffer args;
</del><span class="cx"> args.append(toJS<IDLLong>(longParam));
</span><span class="cx"> args.append(toJS<IDLInterface<TestNode>>(*state, *m_data->globalObject(), testNodeParam));
</span><span class="cx">
</span><span class="cx"> NakedPtr<JSC::Exception> returnedException;
</span><del>- UNUSED_PARAM(state);
</del><span class="cx"> m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
</span><span class="cx"> if (returnedException)
</span><span class="cx"> reportException(state, returnedException);
</span><span class="lines">@@ -195,6 +89,6 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><del>-}
</del><ins>+} // namespace WebCore
</ins><span class="cx">
</span><span class="cx"> #endif // ENABLE(SPEECH_SYNTHESIS)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -42,14 +42,7 @@
</span><span class="cx"> JSCallbackDataStrong* callbackData() { return m_data; }
</span><span class="cx">
</span><span class="cx"> // Functions
</span><del>- virtual bool callbackWithNoParam();
- virtual bool callbackWithArrayParam(RefPtr<Float32Array> arrayParam);
- virtual bool callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strArg);
- virtual int32_t callbackWithNonBoolReturnType(const String& strArg);
- virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
- virtual bool callbackWithStringList(DOMStringList* listParam);
- virtual bool callbackWithBoolean(bool boolParam);
- virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
</del><ins>+ virtual bool handleEvent(RefPtr<Float32Array> arrayParam, RefPtr<SerializedScriptValue>&& srzParam, const String& strArg, bool boolParam, int32_t longParam, TestNode* testNodeParam);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> JSTestCallbackFunction(JSC::JSObject* callback, JSDOMGlobalObject*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestCallbackFunctionWithTypedefs.h"
+
+#include "JSDOMConvert.h"
+#include "JSLONG.h"
+#include "ScriptExecutionContext.h"
+#include <runtime/JSArray.h>
+#include <runtime/JSLock.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSTestCallbackFunctionWithTypedefs::JSTestCallbackFunctionWithTypedefs(JSObject* callback, JSDOMGlobalObject* globalObject)
+ : TestCallbackFunctionWithTypedefs()
+ , ActiveDOMCallback(globalObject->scriptExecutionContext())
+ , m_data(new JSCallbackDataStrong(callback, this))
+{
+}
+
+JSTestCallbackFunctionWithTypedefs::~JSTestCallbackFunctionWithTypedefs()
+{
+ ScriptExecutionContext* context = scriptExecutionContext();
+ // When the context is destroyed, all tasks with a reference to a callback
+ // should be deleted. So if the context is 0, we are on the context thread.
+ if (!context || context->isContextThread())
+ delete m_data;
+ else
+ context->postTask(DeleteCallbackDataTask(m_data));
+#ifndef NDEBUG
+ m_data = nullptr;
+#endif
+}
+
+bool JSTestCallbackFunctionWithTypedefs::handleEvent(Vector<RefPtr<LONG>> sequenceArg, int32_t longArg)
+{
+ if (!canInvokeCallback())
+ return true;
+
+ Ref<JSTestCallbackFunctionWithTypedefs> protectedThis(*this);
+
+ JSLockHolder lock(m_data->globalObject()->vm());
+
+ ExecState* state = m_data->globalObject()->globalExec();
+ MarkedArgumentBuffer args;
+ args.append(toJS<IDLSequence<IDLNullable<IDLInterface<LONG>>>>(*state, *m_data->globalObject(), sequenceArg));
+ args.append(toJS<IDLLong>(longArg));
+
+ NakedPtr<JSC::Exception> returnedException;
+ m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+ if (returnedException)
+ reportException(state, returnedException);
+ return !returnedException;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackFunctionWithTypedefs& impl)
+{
+ if (!static_cast<JSTestCallbackFunctionWithTypedefs&>(impl).callbackData())
+ return jsNull();
+
+ return static_cast<JSTestCallbackFunctionWithTypedefs&>(impl).callbackData()->callback();
+
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefshfromrev208407trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h (from rev 208407, trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "ActiveDOMCallback.h"
+#include "JSCallbackData.h"
+#include "TestCallbackFunctionWithTypedefs.h"
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class JSTestCallbackFunctionWithTypedefs : public TestCallbackFunctionWithTypedefs, public ActiveDOMCallback {
+public:
+ static Ref<JSTestCallbackFunctionWithTypedefs> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
+ {
+ return adoptRef(*new JSTestCallbackFunctionWithTypedefs(callback, globalObject));
+ }
+
+ virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
+
+ virtual ~JSTestCallbackFunctionWithTypedefs();
+ JSCallbackDataStrong* callbackData() { return m_data; }
+
+ // Functions
+ virtual bool handleEvent(Vector<RefPtr<LONG>> sequenceArg, int32_t longArg);
+
+private:
+ JSTestCallbackFunctionWithTypedefs(JSC::JSObject* callback, JSDOMGlobalObject*);
+
+ JSCallbackDataStrong* m_data;
+};
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackFunctionWithTypedefs&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallbackFunctionWithTypedefs* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfacecppfromrev208407trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp (from rev 208407, trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,227 @@
</span><ins>+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include "JSTestCallbackInterface.h"
+
+#include "JSDOMConstructor.h"
+#include "JSDOMConvert.h"
+#include "JSDOMStringList.h"
+#include "JSTestNode.h"
+#include "ScriptExecutionContext.h"
+#include "SerializedScriptValue.h"
+#include <runtime/JSLock.h>
+#include <runtime/ObjectPrototype.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSTestCallbackInterface::JSTestCallbackInterface(JSObject* callback, JSDOMGlobalObject* globalObject)
+ : TestCallbackInterface()
+ , ActiveDOMCallback(globalObject->scriptExecutionContext())
+ , m_data(new JSCallbackDataStrong(callback, this))
+{
+}
+
+JSTestCallbackInterface::~JSTestCallbackInterface()
+{
+ ScriptExecutionContext* context = scriptExecutionContext();
+ // When the context is destroyed, all tasks with a reference to a callback
+ // should be deleted. So if the context is 0, we are on the context thread.
+ if (!context || context->isContextThread())
+ delete m_data;
+ else
+ context->postTask(DeleteCallbackDataTask(m_data));
+#ifndef NDEBUG
+ m_data = nullptr;
+#endif
+}
+
+using JSTestCallbackInterfaceConstructor = JSDOMConstructorNotConstructable<JSTestCallbackInterface>;
+
+/* Hash table for constructor */
+
+static const HashTableValue JSTestCallbackInterfaceConstructorTableValues[] =
+{
+ { "CONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
+ { "CONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
+};
+
+static_assert(TestCallbackInterface::CONSTANT1 == 1, "CONSTANT1 in TestCallbackInterface does not match value from IDL");
+static_assert(TestCallbackInterface::CONSTANT2 == 2, "CONSTANT2 in TestCallbackInterface does not match value from IDL");
+
+template<> JSValue JSTestCallbackInterfaceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+ UNUSED_PARAM(vm);
+ return globalObject.objectPrototype();
+}
+
+template<> void JSTestCallbackInterfaceConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+ UNUSED_PARAM(globalObject);
+ putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestCallbackInterface"))), ReadOnly | DontEnum);
+ putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+ reifyStaticProperties(vm, JSTestCallbackInterfaceConstructorTableValues, *this);
+}
+
+template<> const ClassInfo JSTestCallbackInterfaceConstructor::s_info = { "TestCallbackInterface", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCallbackInterfaceConstructor) };
+
+JSValue JSTestCallbackInterface::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestCallbackInterfaceConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+bool JSTestCallbackInterface::callbackWithNoParam()
+{
+ if (!canInvokeCallback())
+ return true;
+
+ Ref<JSTestCallbackInterface> protectedThis(*this);
+
+ JSLockHolder lock(m_data->globalObject()->vm());
+
+ ExecState* state = m_data->globalObject()->globalExec();
+ MarkedArgumentBuffer args;
+
+ NakedPtr<JSC::Exception> returnedException;
+ m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithNoParam"), returnedException);
+ if (returnedException)
+ reportException(state, returnedException);
+ return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithArrayParam(RefPtr<Float32Array> arrayParam)
+{
+ if (!canInvokeCallback())
+ return true;
+
+ Ref<JSTestCallbackInterface> protectedThis(*this);
+
+ JSLockHolder lock(m_data->globalObject()->vm());
+
+ ExecState* state = m_data->globalObject()->globalExec();
+ MarkedArgumentBuffer args;
+ args.append(toJS<IDLInterface<Float32Array>>(*state, *m_data->globalObject(), arrayParam));
+
+ NakedPtr<JSC::Exception> returnedException;
+ m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithArrayParam"), returnedException);
+ if (returnedException)
+ reportException(state, returnedException);
+ return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strParam)
+{
+ if (!canInvokeCallback())
+ return true;
+
+ Ref<JSTestCallbackInterface> protectedThis(*this);
+
+ JSLockHolder lock(m_data->globalObject()->vm());
+
+ ExecState* state = m_data->globalObject()->globalExec();
+ MarkedArgumentBuffer args;
+ args.append(srzParam ? srzParam->deserialize(*state, m_data->globalObject()) : jsNull());
+ args.append(toJS<IDLDOMString>(*state, strParam));
+
+ NakedPtr<JSC::Exception> returnedException;
+ m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithSerializedScriptValueParam"), returnedException);
+ if (returnedException)
+ reportException(state, returnedException);
+ return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithStringList(DOMStringList* listParam)
+{
+ if (!canInvokeCallback())
+ return true;
+
+ Ref<JSTestCallbackInterface> protectedThis(*this);
+
+ JSLockHolder lock(m_data->globalObject()->vm());
+
+ ExecState* state = m_data->globalObject()->globalExec();
+ MarkedArgumentBuffer args;
+ args.append(toJS<IDLInterface<DOMStringList>>(*state, *m_data->globalObject(), listParam));
+
+ NakedPtr<JSC::Exception> returnedException;
+ m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithStringList"), returnedException);
+ if (returnedException)
+ reportException(state, returnedException);
+ return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithBoolean(bool boolParam)
+{
+ if (!canInvokeCallback())
+ return true;
+
+ Ref<JSTestCallbackInterface> protectedThis(*this);
+
+ JSLockHolder lock(m_data->globalObject()->vm());
+
+ ExecState* state = m_data->globalObject()->globalExec();
+ MarkedArgumentBuffer args;
+ args.append(toJS<IDLBoolean>(boolParam));
+
+ NakedPtr<JSC::Exception> returnedException;
+ m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithBoolean"), returnedException);
+ if (returnedException)
+ reportException(state, returnedException);
+ return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
+{
+ if (!canInvokeCallback())
+ return true;
+
+ Ref<JSTestCallbackInterface> protectedThis(*this);
+
+ JSLockHolder lock(m_data->globalObject()->vm());
+
+ ExecState* state = m_data->globalObject()->globalExec();
+ MarkedArgumentBuffer args;
+ args.append(toJS<IDLLong>(longParam));
+ args.append(toJS<IDLInterface<TestNode>>(*state, *m_data->globalObject(), testNodeParam));
+
+ NakedPtr<JSC::Exception> returnedException;
+ m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackRequiresThisToPass"), returnedException);
+ if (returnedException)
+ reportException(state, returnedException);
+ return !returnedException;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackInterface& impl)
+{
+ if (!static_cast<JSTestCallbackInterface&>(impl).callbackData())
+ return jsNull();
+
+ return static_cast<JSTestCallbackInterface&>(impl).callbackData()->callback();
+
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SPEECH_SYNTHESIS)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfacehfromrev208407trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h (from rev 208407, trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include "ActiveDOMCallback.h"
+#include "JSCallbackData.h"
+#include "TestCallbackInterface.h"
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class JSTestCallbackInterface : public TestCallbackInterface, public ActiveDOMCallback {
+public:
+ static Ref<JSTestCallbackInterface> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
+ {
+ return adoptRef(*new JSTestCallbackInterface(callback, globalObject));
+ }
+
+ virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
+
+ virtual ~JSTestCallbackInterface();
+ JSCallbackDataStrong* callbackData() { return m_data; }
+ static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+
+ // Functions
+ virtual bool callbackWithNoParam();
+ virtual bool callbackWithArrayParam(RefPtr<Float32Array> arrayParam);
+ virtual bool callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strParam);
+ virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
+ virtual bool callbackWithStringList(DOMStringList* listParam);
+ virtual bool callbackWithBoolean(bool boolParam);
+ virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
+
+private:
+ JSTestCallbackInterface(JSC::JSObject* callback, JSDOMGlobalObject*);
+
+ JSCallbackDataStrong* m_data;
+};
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackInterface&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallbackInterface* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+
+} // namespace WebCore
+
+#endif // ENABLE(SPEECH_SYNTHESIS)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx"> #include "JSPromise.h"
</span><span class="cx"> #include "JSSVGDocument.h"
</span><span class="cx"> #include "JSSVGPoint.h"
</span><del>-#include "JSTestCallback.h"
</del><span class="cx"> #include "JSTestCallbackFunction.h"
</span><ins>+#include "JSTestCallbackInterface.h"
</ins><span class="cx"> #include "JSTestInterface.h"
</span><span class="cx"> #include "JSTestNode.h"
</span><span class="cx"> #include "JSTestObj.h"
</span><span class="lines">@@ -1407,7 +1407,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(0).isObject()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 0, "testCallback", "TestObject", nullptr);
</span><del>- auto testCallback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</del><ins>+ auto testCallback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</ins><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(1).isFunction()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 1, "testCallbackFunction", "TestObject", nullptr);
</span><span class="cx"> auto testCallbackFunction = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
</span><span class="lines">@@ -6292,7 +6292,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(0).isObject()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "methodWithCallbackArg");
</span><del>- auto callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</del><ins>+ auto callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</ins><span class="cx"> impl.methodWithCallbackArg(WTFMove(callback));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6315,7 +6315,7 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(1).isObject()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackArg");
</span><del>- auto callback = JSTestCallback::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
</del><ins>+ auto callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
</ins><span class="cx"> impl.methodWithNonCallbackArgAndCallbackArg(WTFMove(nonCallback), WTFMove(callback));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6332,11 +6332,11 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- RefPtr<TestCallback> callback;
</del><ins>+ RefPtr<TestCallbackInterface> callback;
</ins><span class="cx"> if (!state->argument(0).isUndefinedOrNull()) {
</span><span class="cx"> if (!state->uncheckedArgument(0).isObject())
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "methodWithCallbackAndOptionalArg");
</span><del>- callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</del><ins>+ callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</ins><span class="cx"> }
</span><span class="cx"> impl.methodWithCallbackAndOptionalArg(WTFMove(callback));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6413,11 +6413,11 @@
</span><span class="cx"> VM& vm = state->vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><del>- RefPtr<TestCallback> callback;
</del><ins>+ RefPtr<TestCallbackInterface> callback;
</ins><span class="cx"> if (!state->argument(0).isUndefinedOrNull()) {
</span><span class="cx"> if (!state->uncheckedArgument(0).isObject())
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "staticMethodWithCallbackAndOptionalArg");
</span><del>- callback = createFunctionOnlyCallback<JSTestCallback>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0));
</del><ins>+ callback = createFunctionOnlyCallback<JSTestCallbackInterface>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0));
</ins><span class="cx"> }
</span><span class="cx"> TestObj::staticMethodWithCallbackAndOptionalArg(WTFMove(callback));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6432,7 +6432,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(0).isObject()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "staticMethodWithCallbackArg");
</span><del>- auto callback = createFunctionOnlyCallback<JSTestCallback>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0));
</del><ins>+ auto callback = createFunctionOnlyCallback<JSTestCallbackInterface>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0));
</ins><span class="cx"> TestObj::staticMethodWithCallbackArg(WTFMove(callback));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6594,7 +6594,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(0).isObject()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "overloadedMethod");
</span><del>- auto callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</del><ins>+ auto callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
</ins><span class="cx"> impl.overloadedMethod(WTFMove(callback));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6772,7 +6772,7 @@
</span><span class="cx"> return jsTestObjPrototypeFunctionOverloadedMethod2(state);
</span><span class="cx"> if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestObj::info()))
</span><span class="cx"> return jsTestObjPrototypeFunctionOverloadedMethod2(state);
</span><del>- if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestCallback::info()))
</del><ins>+ if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestCallbackInterface::info()))
</ins><span class="cx"> return jsTestObjPrototypeFunctionOverloadedMethod5(state);
</span><span class="cx"> if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSDOMStringList::info()))
</span><span class="cx"> return jsTestObjPrototypeFunctionOverloadedMethod6(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,7 +26,8 @@
</span><span class="cx"> #include "JSDOMConstructor.h"
</span><span class="cx"> #include "JSDOMConvert.h"
</span><span class="cx"> #include "JSSVGPoint.h"
</span><del>-#include "JSTestCallback.h"
</del><ins>+#include "JSTestCallbackFunction.h"
+#include "JSTestCallbackInterface.h"
</ins><span class="cx"> #include "JSTestEventTarget.h"
</span><span class="cx"> #include "JSTestSubObj.h"
</span><span class="cx"> #include "SerializedScriptValue.h"
</span><span class="lines">@@ -130,14 +131,17 @@
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto* castedThis = jsCast<JSTestTypedefsConstructor*>(state->callee());
</span><span class="cx"> ASSERT(castedThis);
</span><del>- if (UNLIKELY(state->argumentCount() < 2))
</del><ins>+ if (UNLIKELY(state->argumentCount() < 3))
</ins><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto hello = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- if (UNLIKELY(!state->uncheckedArgument(1).isObject()))
- return throwArgumentMustBeFunctionError(*state, throwScope, 1, "testCallback", "TestTypedefs", nullptr);
- auto testCallback = JSTestCallback::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
- auto object = TestTypedefs::create(WTFMove(hello), WTFMove(testCallback));
</del><ins>+ if (UNLIKELY(!state->uncheckedArgument(1).isFunction()))
+ return throwArgumentMustBeFunctionError(*state, throwScope, 1, "testCallbackFunction", "TestTypedefs", nullptr);
+ auto testCallbackFunction = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
+ if (UNLIKELY(!state->uncheckedArgument(2).isObject()))
+ return throwArgumentMustBeFunctionError(*state, throwScope, 2, "testCallbackInterface", "TestTypedefs", nullptr);
+ auto testCallbackInterface = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(2)), castedThis->globalObject());
+ auto object = TestTypedefs::create(WTFMove(hello), WTFMove(testCallbackFunction), WTFMove(testCallbackInterface));
</ins><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -151,7 +155,7 @@
</span><span class="cx"> {
</span><span class="cx"> putDirect(vm, vm.propertyNames->prototype, JSTestTypedefs::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
</span><span class="cx"> putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestTypedefs"))), ReadOnly | DontEnum);
</span><del>- putDirect(vm, vm.propertyNames->length, jsNumber(2), ReadOnly | DontEnum);
</del><ins>+ putDirect(vm, vm.propertyNames->length, jsNumber(3), ReadOnly | DontEnum);
</ins><span class="cx"> reifyStaticProperties(vm, JSTestTypedefsConstructorTableValues, *this);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary formstrArg, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// This IDL file is for testing the bindings code generator with a callback
-// interface and for tracking changes in its ouput.
-[
- Conditional=SPEECH_SYNTHESIS,
-] callback interface TestCallback {
- // Constants
- const unsigned short CONSTANT1 = 1;
- const unsigned short CONSTANT2 = 2;
-
- // Operations.
- boolean callbackWithNoParam();
- boolean callbackWithArrayParam(Float32Array arrayParam);
- boolean callbackWithSerializedScriptValueParam(SerializedScriptValue srzParam, DOMString strArg);
- long callbackWithNonBoolReturnType(DOMString strArg);
- [Custom] long customCallback(Class5 class5Param, Class6 class6Param);
- boolean callbackWithStringList(DOMStringList listParam);
- boolean callbackWithBoolean(boolean boolParam);
- boolean callbackRequiresThisToPass(long longParam, TestNode testNodeParam);
-};
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackFunctionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,18 +26,6 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-// This IDL file is for testing the bindings code generator with function only callback
-// interface and for tracking changes in its ouput.
</del><span class="cx"> [
</span><span class="cx"> Conditional=SPEECH_SYNTHESIS,
</span><del>- Callback=FunctionOnly,
-] callback interface TestCallbackFunction {
- boolean callbackWithNoParam();
- boolean callbackWithArrayParam(Float32Array arrayParam);
- boolean callbackWithSerializedScriptValueParam(SerializedScriptValue srzParam, DOMString strArg);
- long callbackWithNonBoolReturnType(DOMString strArg);
- [Custom] long customCallback(Class5 class5Param, Class6 class6Param);
- boolean callbackWithStringList(DOMStringList listParam);
- boolean callbackWithBoolean(boolean boolParam);
- boolean callbackRequiresThisToPass(long longParam, TestNode testNodeParam);
-};
</del><ins>+] callback TestCallbackFunction = void (Float32Array arrayParam, SerializedScriptValue srzParam, DOMString strArg, boolean boolParam, long longParam, TestNode testNodeParam);
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackFunctionWithTypedefsidlfromrev208407trunkSourceWebCorepageIntersectionObserverCallbackidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl (from rev 208407, trunk/Source/WebCore/page/IntersectionObserverCallback.idl) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef long LONG;
+typedef sequence<LONG?> SEQUENCE_OF_NULLABLE_LONGS;
+typedef void VOID;
+
+callback TestCallbackFunctionWithTypedefs = VOID (SEQUENCE_OF_NULLABLE_LONGS sequenceArg, LONG longArg);
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackInterfaceidlfromrev208407trunkSourceWebCoreModuleswebdatabaseDatabaseCallbackidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl (from rev 208407, trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ Conditional=SPEECH_SYNTHESIS,
+] callback interface TestCallbackInterface {
+ // Constants
+ const unsigned short CONSTANT1 = 1;
+ const unsigned short CONSTANT2 = 2;
+
+ // Operations.
+ void callbackWithNoParam();
+ void callbackWithArrayParam(Float32Array arrayParam);
+ void callbackWithSerializedScriptValueParam(SerializedScriptValue srzParam, DOMString strParam);
+ [Custom] long customCallback(Class5 class5Param, Class6 class6Param);
+ void callbackWithStringList(DOMStringList listParam);
+ void callbackWithBoolean(boolean boolParam);
+ void callbackRequiresThisToPass(long longParam, TestNode testNodeParam);
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> ConstructorCallWith=Document,
</span><del>- Constructor(TestCallback testCallback, TestCallbackFunction testCallbackFunction),
</del><ins>+ Constructor(TestCallbackInterface testCallback, TestCallbackFunction testCallbackFunction),
</ins><span class="cx"> InterfaceName=TestObject
</span><span class="cx"> ] interface TestObj {
</span><span class="cx"> // Attributes
</span><span class="lines">@@ -242,9 +242,9 @@
</span><span class="cx">
</span><span class="cx"> #if defined(TESTING_JS)
</span><span class="cx"> // Callback interface parameters.
</span><del>- void methodWithCallbackArg(TestCallback callback);
- void methodWithNonCallbackArgAndCallbackArg(long nonCallback, TestCallback callback);
- void methodWithCallbackAndOptionalArg(optional TestCallback? callback);
</del><ins>+ void methodWithCallbackArg(TestCallbackInterface callback);
+ void methodWithNonCallbackArgAndCallbackArg(long nonCallback, TestCallbackInterface callback);
+ void methodWithCallbackAndOptionalArg(optional TestCallbackInterface? callback);
</ins><span class="cx">
</span><span class="cx"> // Callback function parameters.
</span><span class="cx"> void methodWithCallbackFunctionArg(TestCallbackFunction callback);
</span><span class="lines">@@ -252,8 +252,8 @@
</span><span class="cx"> void methodWithCallbackFunctionAndOptionalArg(optional TestCallbackFunction? callback);
</span><span class="cx">
</span><span class="cx"> // static methods with 'Callback' extended attribute
</span><del>- static void staticMethodWithCallbackAndOptionalArg(optional TestCallback? callback);
- static void staticMethodWithCallbackArg(TestCallback callback);
</del><ins>+ static void staticMethodWithCallbackAndOptionalArg(optional TestCallbackInterface? callback);
+ static void staticMethodWithCallbackArg(TestCallbackInterface callback);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // 'Conditional' extended attribute
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx"> void overloadedMethod(TestObj? objArg, optional long longArg);
</span><span class="cx"> void overloadedMethod(DOMString strArg);
</span><span class="cx"> void overloadedMethod(long longArg);
</span><del>- void overloadedMethod(TestCallback callback);
</del><ins>+ void overloadedMethod(TestCallbackInterface callback);
</ins><span class="cx"> void overloadedMethod(DOMStringList? listArg);
</span><span class="cx"> void overloadedMethod(sequence<DOMString>? arrayArg);
</span><span class="cx"> void overloadedMethod(TestObj objArg);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestTypedefsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> // changes in its output.
</span><span class="cx">
</span><span class="cx"> [
</span><del>- Constructor(STRING hello, TEST_CALLBACK testCallback),
</del><ins>+ Constructor(STRING hello, TEST_CALLBACK_FUNCTION testCallbackFunction, TEST_CALLBACK_INTERFACE testCallbackInterface),
</ins><span class="cx"> ] interface TestTypedefs {
</span><span class="cx"> attribute ULONGLONG unsignedLongLongAttr;
</span><span class="cx">
</span><span class="lines">@@ -79,7 +79,8 @@
</span><span class="cx"> typedef DOMString STRING;
</span><span class="cx"> typedef sequence<DOMString> SEQUENCE_OF_STRINGS;
</span><span class="cx"> typedef sequence<DOMString?> SEQUENCE_OF_NULLABLE_STRINGS;
</span><del>-typedef TestCallback TEST_CALLBACK;
</del><ins>+typedef TestCallbackFunction TEST_CALLBACK_FUNCTION;
+typedef TestCallbackInterface TEST_CALLBACK_INTERFACE;
</ins><span class="cx"> typedef TestSubObjConstructor T;
</span><span class="cx"> typedef Int32Array ARRAY;
</span><span class="cx"> typedef DOMException E;
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryListListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryListListener.h (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryListListener.h        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/css/MediaQueryListListener.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> JSMediaQueryListListenerType
</span><span class="cx"> };
</span><span class="cx">
</span><del>- virtual bool queryChanged(MediaQueryList*) = 0;
</del><ins>+ virtual bool handleEvent(MediaQueryList*) = 0;
</ins><span class="cx"> virtual bool operator==(const MediaQueryListListener&) const = 0;
</span><span class="cx"> virtual ~MediaQueryListListener() { }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryListListeneridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryListListener.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryListListener.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/css/MediaQueryListListener.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -18,8 +18,6 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> [
</span><del>- CallbackNeedsOperatorEqual,
- Callback=FunctionOnly,
-] callback interface MediaQueryListListener {
- boolean queryChanged(optional MediaQueryList? list = null);
-};
</del><ins>+ CallbackNeedsOperatorEqual
+] callback MediaQueryListListener = void (optional MediaQueryList? list = null);
+
</ins></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryMatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryMatcher.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryMatcher.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/css/MediaQueryMatcher.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx"> bool notify;
</span><span class="cx"> listener.query->evaluate(evaluator, notify);
</span><span class="cx"> if (notify)
</span><del>- listener.listener->queryChanged(listener.query.ptr());
</del><ins>+ listener.listener->handleEvent(listener.query.ptr());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomRequestAnimationFrameCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -28,11 +28,9 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+// highResTime is passed as high resolution timestamp, see
+// http://www.w3.org/TR/hr-time/ for details.
+
</ins><span class="cx"> [
</span><span class="cx"> Conditional=REQUEST_ANIMATION_FRAME,
</span><del>- Callback=FunctionOnly,
-] callback interface RequestAnimationFrameCallback {
- // highResTime is passed as high resolution timestamp, see
- // http://www.w3.org/TR/hr-time/ for details.
- boolean handleEvent(unrestricted double highResTime);
-};
</del><ins>+] callback RequestAnimationFrameCallback = void (unrestricted double highResTime);
</ins></span></pre></div>
<a id="trunkSourceWebCoredomStringCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StringCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StringCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/dom/StringCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -28,8 +28,4 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-[
- Callback=FunctionOnly,
-] callback interface StringCallback {
- boolean handleEvent(DOMString data);
-};
</del><ins>+callback StringCallback = void (DOMString data);
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlVoidCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/VoidCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/VoidCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/html/VoidCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -22,8 +22,5 @@
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><del>-[
- Callback=FunctionOnly,
-] callback interface VoidCallback {
- boolean handleEvent();
-};
</del><ins>+
+callback VoidCallback = void ();
</ins></span></pre></div>
<a id="trunkSourceWebCorepageIntersectionObserverCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/IntersectionObserverCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/IntersectionObserverCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/page/IntersectionObserverCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,8 +26,5 @@
</span><span class="cx"> // https://wicg.github.io/IntersectionObserver/
</span><span class="cx">
</span><span class="cx"> [
</span><del>- Conditional=INTERSECTION_OBSERVER,
- Callback=FunctionOnly,
-] callback interface IntersectionObserverCallback {
- boolean handleEvent(sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
-};
</del><ins>+ Conditional=INTERSECTION_OBSERVER
+] callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
</ins></span></pre>
</div>
</div>
</body>
</html>