<!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>[207378] 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/207378">207378</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2016-10-15 14:15:17 -0700 (Sat, 15 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466
Reviewed by Darin Adler.
Fix the code generator to generate code for serializer = { attribute }.
In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
to detect these; it needs to create the domSerializable() now. Basic support
for isSerializableAttribute() is added (primitive types only).
GenerateSerializerFunction is fixed to output code for the serializable attributes
in the order specified in "serializer = {}", as specified in WebIDL.
Removed custom serialization for ClientRect and PerformanceTiming.
Other minor cleanup to always get $interfaceName from $interface->name, and to fix
ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSClientRectCustom.cpp: Removed.
* bindings/js/JSPerformanceTimingCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateSerializerFunction):
* bindings/scripts/IDLParser.pm:
(parseSerializerRest):
(parseSerializationPattern):
(parseSerializationAttributes):
(isSerializableAttribute):
(applyMemberList):
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
* bindings/scripts/test/JS/JSTestSerialization.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
* dom/ClientRect.idl:
* page/PerformanceTiming.idl:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCoredomClientRectidl">trunk/Source/WebCore/dom/ClientRect.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceTimingidl">trunk/Source/WebCore/page/PerformanceTiming.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializationcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializationh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestSerializationidl">trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSClientRectCustomcpp">trunk/Source/WebCore/bindings/js/JSClientRectCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPerformanceTimingCustomcpp">trunk/Source/WebCore/bindings/js/JSPerformanceTimingCustom.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -1075,7 +1075,6 @@
</span><span class="cx"> bindings/js/JSCSSValueCustom.cpp
</span><span class="cx"> bindings/js/JSCallbackData.cpp
</span><span class="cx"> bindings/js/JSCanvasRenderingContext2DCustom.cpp
</span><del>- bindings/js/JSClientRectCustom.cpp
</del><span class="cx"> bindings/js/JSCommandLineAPIHostCustom.cpp
</span><span class="cx"> bindings/js/JSCryptoAlgorithmBuilder.cpp
</span><span class="cx"> bindings/js/JSCryptoAlgorithmDictionary.cpp
</span><span class="lines">@@ -1165,7 +1164,6 @@
</span><span class="cx"> bindings/js/JSNodeIteratorCustom.cpp
</span><span class="cx"> bindings/js/JSNodeListCustom.cpp
</span><span class="cx"> bindings/js/JSPerformanceEntryCustom.cpp
</span><del>- bindings/js/JSPerformanceTimingCustom.cpp
</del><span class="cx"> bindings/js/JSPluginElementFunctions.cpp
</span><span class="cx"> bindings/js/JSPopStateEventCustom.cpp
</span><span class="cx"> bindings/js/JSReadableStreamPrivateConstructors.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/ChangeLog        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-10-15 Simon Fraser <simon.fraser@apple.com>
+
+ Implement serializer = { attribute }
+ https://bugs.webkit.org/show_bug.cgi?id=163466
+
+ Reviewed by Darin Adler.
+
+ Fix the code generator to generate code for serializer = { attribute }.
+ In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
+ 'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
+ to detect these; it needs to create the domSerializable() now. Basic support
+ for isSerializableAttribute() is added (primitive types only).
+
+ GenerateSerializerFunction is fixed to output code for the serializable attributes
+ in the order specified in "serializer = {}", as specified in WebIDL.
+
+ Removed custom serialization for ClientRect and PerformanceTiming.
+
+ Other minor cleanup to always get $interfaceName from $interface->name, and to fix
+ ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSClientRectCustom.cpp: Removed.
+ * bindings/js/JSPerformanceTimingCustom.cpp: Removed.
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ (GenerateSerializerFunction):
+ * bindings/scripts/IDLParser.pm:
+ (parseSerializerRest):
+ (parseSerializationPattern):
+ (parseSerializationAttributes):
+ (isSerializableAttribute):
+ (applyMemberList):
+ * bindings/scripts/test/JS/JSTestNode.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
+ * bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
+ * bindings/scripts/test/JS/JSTestSerialization.h: Added.
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
+ * dom/ClientRect.idl:
+ * page/PerformanceTiming.idl:
+
</ins><span class="cx"> 2016-10-15 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Restore user agent quirk for Yahoo
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -1379,7 +1379,6 @@
</span><span class="cx">                 31C0FF3E0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */; };
</span><span class="cx">                 31C0FF3F0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */; };
</span><span class="cx">                 31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */; };
</span><del>-                31C422461D74EB9A00F12342 /* JSPerformanceTimingCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C422451D74EB9A00F12342 /* JSPerformanceTimingCustom.cpp */; };
</del><span class="cx">                 31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D591B116697A6C00E6BF02 /* PlugInClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 31DCDF431DA1C45400EA5B93 /* ExtendedColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31DCDF411DA1C45400EA5B93 /* ExtendedColor.cpp */; };
</span><span class="lines">@@ -1739,7 +1738,6 @@
</span><span class="cx">                 4671E0661D67A59600C6B497 /* CanvasPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 4671E0641D67A57B00C6B497 /* CanvasPath.h */; };
</span><span class="cx">                 467302021C4EFE7800BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */; };
</span><span class="cx">                 4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; };
</span><del>-                46A58AC51D46B3FA00432036 /* JSClientRectCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A58AC41D46B3FA00432036 /* JSClientRectCustom.cpp */; };
</del><span class="cx">                 46B63F6C1C6E8D19002E914B /* JSEventTargetCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 46C83EFD1A9BBE2900A79A41 /* GeoNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */; };
</span><span class="cx">                 46C83EFE1A9BBE2900A79A41 /* GeoNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 46C83EFC1A9BBE2900A79A41 /* GeoNotifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8347,7 +8345,6 @@
</span><span class="cx">                 31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitAnimationEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitTransitionEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitTransitionEvent.h; sourceTree = "<group>"; };
</span><del>-                31C422451D74EB9A00F12342 /* JSPerformanceTimingCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceTimingCustom.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 31D591B116697A6C00E6BF02 /* PlugInClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationTrigger.h; sourceTree = "<group>"; };
</span><span class="cx">                 31DCDF411DA1C45400EA5B93 /* ExtendedColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtendedColor.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8755,7 +8752,6 @@
</span><span class="cx">                 4671E0641D67A57B00C6B497 /* CanvasPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasPath.h; sourceTree = "<group>"; };
</span><span class="cx">                 467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IgnoreOpensDuringUnloadCountIncrementer.h; sourceTree = "<group>"; };
</span><span class="cx">                 4689F1AE1267BAE100E8D380 /* FileMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMetadata.h; sourceTree = "<group>"; };
</span><del>-                46A58AC41D46B3FA00432036 /* JSClientRectCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClientRectCustom.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventTargetCustom.h; sourceTree = "<group>"; };
</span><span class="cx">                 46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeoNotifier.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 46C83EFC1A9BBE2900A79A41 /* GeoNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeoNotifier.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -21201,7 +21197,6 @@
</span><span class="cx">                                 BE6DF710171CA2DA00DD52B8 /* JSAudioTrackListCustom.cpp */,
</span><span class="cx">                                 8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */,
</span><span class="cx">                                 49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
</span><del>-                                46A58AC41D46B3FA00432036 /* JSClientRectCustom.cpp */,
</del><span class="cx">                                 A584FE371864DAC100843B10 /* JSCommandLineAPIHostCustom.cpp */,
</span><span class="cx">                                 7CEF26181D6A92E300BE905D /* JSCryptoCustom.cpp */,
</span><span class="cx">                                 E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */,
</span><span class="lines">@@ -21282,7 +21277,6 @@
</span><span class="cx">                                 83F1206A1B8C103600D75F63 /* JSNodeFilterCustom.cpp */,
</span><span class="cx">                                 1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
</span><span class="cx">                                 BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */,
</span><del>-                                31C422451D74EB9A00F12342 /* JSPerformanceTimingCustom.cpp */,
</del><span class="cx">                                 AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */,
</span><span class="cx">                                 A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
</span><span class="cx">                                 418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
</span><span class="lines">@@ -27729,7 +27723,6 @@
</span><span class="cx">                                 FD3160BC12B0272A00C1A359 /* AudioDestinationMac.cpp in Sources */,
</span><span class="cx">                                 FD31600712B0267600C1A359 /* AudioDestinationNode.cpp in Sources */,
</span><span class="cx">                                 FD31608112B026F700C1A359 /* AudioDSPKernelProcessor.cpp in Sources */,
</span><del>-                                31C422461D74EB9A00F12342 /* JSPerformanceTimingCustom.cpp in Sources */,
</del><span class="cx">                                 CD5596911475B678001D0BD0 /* AudioFileReaderIOS.cpp in Sources */,
</span><span class="cx">                                 FD3160BE12B0272A00C1A359 /* AudioFileReaderMac.cpp in Sources */,
</span><span class="cx">                                 CD2F4A2318D89F700063746D /* AudioHardwareListener.cpp in Sources */,
</span><span class="lines">@@ -28717,7 +28710,6 @@
</span><span class="cx">                                 FDA15EA312B03EE1003A583A /* JSChannelSplitterNode.cpp in Sources */,
</span><span class="cx">                                 65DF31F309D1CC60000BE325 /* JSCharacterData.cpp in Sources */,
</span><span class="cx">                                 BCC065870F3CE2A700CD2D87 /* JSClientRect.cpp in Sources */,
</span><del>-                                46A58AC51D46B3FA00432036 /* JSClientRectCustom.cpp in Sources */,
</del><span class="cx">                                 BCC065890F3CE2A700CD2D87 /* JSClientRectList.cpp in Sources */,
</span><span class="cx">                                 E3150EA61DA7219000194012 /* JSNodeDOMJIT.cpp in Sources */,
</span><span class="cx">                                 51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include "JSCSSValueCustom.cpp"
</span><span class="cx"> #include "JSCallbackData.cpp"
</span><span class="cx"> #include "JSCanvasRenderingContext2DCustom.cpp"
</span><del>-#include "JSClientRectCustom.cpp"
</del><span class="cx"> #include "JSCommandLineAPIHostCustom.cpp"
</span><span class="cx"> #include "JSCryptoCustom.cpp"
</span><span class="cx"> #include "JSCustomEventCustom.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSClientRectCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSClientRectCustom.cpp (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSClientRectCustom.cpp        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/js/JSClientRectCustom.cpp        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-#include "config.h"
-#include "JSClientRect.h"
-
-#include "ClientRect.h"
-#include <bytecode/CodeBlock.h>
-#include <heap/HeapInlines.h>
-#include <runtime/AuxiliaryBarrierInlines.h>
-#include <runtime/IdentifierInlines.h>
-#include <runtime/JSObject.h>
-#include <runtime/ObjectConstructor.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-JSC::JSValue JSClientRect::toJSON(ExecState& state)
-{
- ClientRect& rect = wrapped();
- VM& vm = state.vm();
-
- JSValue object = constructEmptyObject(&state);
- CodeBlock* codeBlock = state.codeBlock();
- PutPropertySlot slot(object, codeBlock ? codeBlock->isStrictMode() : false);
- object.put(&state, Identifier::fromString(&vm, ASCIILiteral("top")), jsNumber(rect.top()), slot);
- object.put(&state, Identifier::fromString(&vm, ASCIILiteral("right")), jsNumber(rect.right()), slot);
- object.put(&state, Identifier::fromString(&vm, ASCIILiteral("bottom")), jsNumber(rect.bottom()), slot);
- object.put(&state, Identifier::fromString(&vm, ASCIILiteral("left")), jsNumber(rect.left()), slot);
- object.put(&state, Identifier::fromString(&vm, ASCIILiteral("width")), jsNumber(rect.width()), slot);
- object.put(&state, Identifier::fromString(&vm, ASCIILiteral("height")), jsNumber(rect.height()), slot);
-
- return object;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPerformanceTimingCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSPerformanceTimingCustom.cpp (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPerformanceTimingCustom.cpp        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/js/JSPerformanceTimingCustom.cpp        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -1,76 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-#include "config.h"
-#include "JSPerformanceTiming.h"
-
-#if ENABLE(WEB_TIMING)
-
-#include "DOMWrapperWorld.h"
-#include <heap/HeapInlines.h>
-#include <runtime/AuxiliaryBarrierInlines.h>
-#include <runtime/IdentifierInlines.h>
-#include <runtime/JSObject.h>
-#include <runtime/ObjectConstructor.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-JSC::JSValue JSPerformanceTiming::toJSON(ExecState& state)
-{
- PerformanceTiming& timing = wrapped();
- VM& vm = state.vm();
-
- auto object = constructEmptyObject(&state);
-
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("navigationStart")), jsNumber(timing.navigationStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("unloadEventStart")), jsNumber(timing.unloadEventStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("unloadEventEnd")), jsNumber(timing.unloadEventEnd()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("redirectStart")), jsNumber(timing.redirectStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("redirectEnd")), jsNumber(timing.redirectEnd()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("fetchStart")), jsNumber(timing.fetchStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("domainLookupStart")), jsNumber(timing.domainLookupStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("domainLookupEnd")), jsNumber(timing.domainLookupEnd()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("connectStart")), jsNumber(timing.connectStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("connectEnd")), jsNumber(timing.connectEnd()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("secureConnectionStart")), jsNumber(timing.secureConnectionStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("requestStart")), jsNumber(timing.requestStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("responseStart")), jsNumber(timing.responseStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("responseEnd")), jsNumber(timing.responseEnd()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("domLoading")), jsNumber(timing.domLoading()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("domInteractive")), jsNumber(timing.domInteractive()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("domContentLoadedEventStart")), jsNumber(timing.domContentLoadedEventStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("domContentLoadedEventEnd")), jsNumber(timing.domContentLoadedEventEnd()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("domComplete")), jsNumber(timing.domComplete()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("loadEventStart")), jsNumber(timing.loadEventStart()));
- object->putDirect(vm, Identifier::fromString(&vm, ASCIILiteral("loadEventEnd")), jsNumber(timing.loadEventEnd()));
-
- return object;
-}
-
-}
-
-#endif // ENABLE(WEB_TIMING)
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -3745,7 +3745,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> GenerateImplementationIterableFunctions($interface) if $interface->iterable;
</span><del>- GenerateSerializerFunction($interface, $interfaceName, $className) if $interface->serializable;
</del><ins>+ GenerateSerializerFunction($interface, $className) if $interface->serializable;
</ins><span class="cx">
</span><span class="cx"> if ($needsVisitChildren) {
</span><span class="cx"> push(@implContent, "void ${className}::visitChildren(JSCell* cell, SlotVisitor& visitor)\n");
</span><span class="lines">@@ -3968,26 +3968,40 @@
</span><span class="cx">
</span><span class="cx"> sub GenerateSerializerFunction
</span><span class="cx"> {
</span><del>- my ($interface, $interfaceName, $className) = @_;
</del><ins>+ my ($interface, $className) = @_;
+
+ my $interfaceName = $interface->name;
+
</ins><span class="cx"> my $serializerFunctionName = "toJSON";
</span><span class="cx"> my $serializerNativeFunctionName = $codeGenerator->WK_lcfirst($className) . "PrototypeFunction" . $codeGenerator->WK_ucfirst($serializerFunctionName);
</span><span class="cx">
</span><del>- AddToImplIncludes("ObjectConstructor.h");
</del><ins>+ AddToImplIncludes("<runtime/ObjectConstructor.h>");
</ins><span class="cx"> push(@implContent, "static inline EncodedJSValue ${serializerNativeFunctionName}Caller(ExecState* state, JS$interfaceName* thisObject, JSC::ThrowScope& throwScope)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="cx"> push(@implContent, " auto& vm = state->vm();\n");
</span><span class="cx"> push(@implContent, " auto* result = constructEmptyObject(state);\n");
</span><span class="cx"> push(@implContent, "\n");
</span><del>- foreach my $attribute (@{$interface->attributes}) {
- my $name = $attribute->signature->name;
- if (grep $_ eq $name, @{$interface->serializable->attributes}) {
- my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
- push(@implContent, " auto ${name}Value = ${getFunctionName}Getter(*state, *thisObject, throwScope);\n");
- push(@implContent, " ASSERT(!throwScope.exception());\n");
- push(@implContent, " result->putDirect(vm, Identifier::fromString(&vm, \"${name}\"), ${name}Value);\n");
- push(@implContent, "\n");
</del><ins>+
+ my @serializedAttributes = ();
+ foreach my $attribute_name (@{$interface->serializable->attributes}) {
+ foreach my $attribute (@{$interface->attributes}) {
+ if ($attribute_name eq $attribute->signature->name) {
+ push @serializedAttributes, $attribute;
+ last;
+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+ foreach my $attribute (@serializedAttributes) {
+ my $name = $attribute->signature->name;
+
+ my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
+ push(@implContent, " auto ${name}Value = ${getFunctionName}Getter(*state, *thisObject, throwScope);\n");
+ push(@implContent, " ASSERT(!throwScope.exception());\n");
+ push(@implContent, " result->putDirect(vm, Identifier::fromString(&vm, \"${name}\"), ${name}Value);\n");
+ push(@implContent, "\n");
+ }
+
</ins><span class="cx"> push(@implContent, " return JSValue::encode(result);\n");
</span><span class="cx"> push(@implContent, "}\n");
</span><span class="cx"> push(@implContent, "\n");
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -112,6 +112,9 @@
</span><span class="cx"> # Used to represent serializable interface
</span><span class="cx"> struct( domSerializable => {
</span><span class="cx"> attributes => '@', # List of attributes to serialize
</span><ins>+ hasAttribute => '$', # serializer = { attribute }
+ hasInherit => '$', # serializer = { inherit }
+ hasGetter => '$', # serializer = { getter }
</ins><span class="cx"> functions => '@', # toJSON function
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -1148,12 +1151,9 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "=") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "=", __LINE__);
</span><del>- my $attributes = $self->parseSerializationPattern();
</del><span class="cx">
</span><del>- my $newDataNode = domSerializable->new();
- $newDataNode->attributes($attributes);
</del><ins>+ return $self->parseSerializationPattern();
</ins><span class="cx">
</span><del>- return $newDataNode;
</del><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() eq "(") {
</span><span class="cx"> return $self->parseOperationRest($extendedAttributeList);
</span><span class="lines">@@ -1167,9 +1167,10 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "{") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "{", __LINE__);
</span><del>- my $attributes = $self->parseSerializationAttributes();
</del><ins>+ my $newDataNode = domSerializable->new();
+ $self->parseSerializationAttributes($newDataNode);
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), "}", __LINE__);
</span><del>- return \@{$attributes};
</del><ins>+ return $newDataNode;
</ins><span class="cx"> }
</span><span class="cx"> if ($next->value() eq "[") {
</span><span class="cx"> die "Serialization of lists pattern is not currently supported.";
</span><span class="lines">@@ -1179,7 +1180,11 @@
</span><span class="cx"> my $token = $self->getToken();
</span><span class="cx"> $self->assertTokenType($token, IdentifierToken);
</span><span class="cx"> push(@attributes, $token->value());
</span><del>- return \@attributes;
</del><ins>+
+ my $newDataNode = domSerializable->new();
+ $newDataNode->attributes(\@attributes);
+
+ return $newDataNode;
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -1187,21 +1192,30 @@
</span><span class="cx"> sub parseSerializationAttributes
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><ins>+ my $domSerializable = shift;
</ins><span class="cx"> my $token = $self->getToken();
</span><span class="cx">
</span><span class="cx"> if ($token->value() eq "getter") {
</span><ins>+ $domSerializable->hasGetter(1);
</ins><span class="cx"> die "Serializer getter keyword is not currently supported.";
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx"> if ($token->value() eq "inherit") {
</span><ins>+ $domSerializable->hasInherit(1);
</ins><span class="cx"> die "Serializer inherit keyword is not currently supported.";
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if ($token->value() eq "attribute") {
+ $domSerializable->hasAttribute(1);
+ # Attributes will be filled in via applyMemberList()
+ return;
+ }
+
</ins><span class="cx"> my @attributes = ();
</span><span class="cx"> $self->assertTokenType($token, IdentifierToken);
</span><span class="cx"> push(@attributes, $token->value());
</span><span class="cx"> push(@attributes, @{$self->parseIdentifiers()});
</span><del>- return \@attributes;
</del><ins>+ $domSerializable->attributes(\@attributes);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub parseIdentifierList
</span><span class="lines">@@ -2316,7 +2330,17 @@
</span><span class="cx"> $self->assertUnexpectedToken($next->value());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub isSerializableAttribute
+{
+ my $attribute = shift;
</ins><span class="cx">
</span><ins>+ # FIXME: Need to support more than primitive serializable types.
+ # This check may have to move to the code generator, if we don't have enough information
+ # here to determine serializability: https://heycam.github.io/webidl/#idl-serializers
+ my $serializable_types = '^(\(byte|octet|short|unsigned short|long|unsigned long|long long|unsigned long long|float|unrestricted float|double|unrestricted double|boolean|DOMString|ByteString|USVString)$';
+ return $attribute->signature->type =~ /$serializable_types/;
+}
+
</ins><span class="cx"> sub applyMemberList
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><span class="lines">@@ -2351,8 +2375,14 @@
</span><span class="cx">
</span><span class="cx"> if ($interface->serializable) {
</span><span class="cx"> my $numSerializerAttributes = @{$interface->serializable->attributes};
</span><del>- if ($numSerializerAttributes == 0) {
</del><ins>+ if ($interface->serializable->hasAttribute) {
</ins><span class="cx"> foreach my $attribute (@{$interface->attributes}) {
</span><ins>+ if (isSerializableAttribute($attribute)) {
+ push(@{$interface->serializable->attributes}, $attribute->signature->name);
+ }
+ }
+ } elsif ($numSerializerAttributes == 0) {
+ foreach my $attribute (@{$interface->attributes}) {
</ins><span class="cx"> push(@{$interface->serializable->attributes}, $attribute->signature->name);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -26,11 +26,11 @@
</span><span class="cx"> #include "JSDOMConstructor.h"
</span><span class="cx"> #include "JSDOMIterator.h"
</span><span class="cx"> #include "JSDOMPromise.h"
</span><del>-#include "ObjectConstructor.h"
</del><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="cx"> #include "URL.h"
</span><span class="cx"> #include <runtime/Error.h>
</span><span class="cx"> #include <runtime/JSString.h>
</span><ins>+#include <runtime/ObjectConstructor.h>
</ins><span class="cx"> #include <wtf/GetPtr.h>
</span><span class="cx">
</span><span class="cx"> using namespace JSC;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx"> #include "JSTestStandaloneDictionary.h"
</span><span class="cx"> #include "JSTestSubObj.h"
</span><span class="cx"> #include "JSXPathNSResolver.h"
</span><del>-#include "ObjectConstructor.h"
</del><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="cx"> #include "SVGDocument.h"
</span><span class="cx"> #include "SVGPoint.h"
</span><span class="lines">@@ -7740,6 +7739,10 @@
</span><span class="cx"> auto& vm = state->vm();
</span><span class="cx"> auto* result = constructEmptyObject(state);
</span><span class="cx">
</span><ins>+ auto createValue = jsTestObjCreateGetter(*state, *thisObject, throwScope);
+ ASSERT(!throwScope.exception());
+ result->putDirect(vm, Identifier::fromString(&vm, "create"), createValue);
+
</ins><span class="cx"> auto readOnlyStringAttrValue = jsTestObjReadOnlyStringAttrGetter(*state, *thisObject, throwScope);
</span><span class="cx"> ASSERT(!throwScope.exception());
</span><span class="cx"> result->putDirect(vm, Identifier::fromString(&vm, "readOnlyStringAttr"), readOnlyStringAttrValue);
</span><span class="lines">@@ -7752,10 +7755,6 @@
</span><span class="cx"> ASSERT(!throwScope.exception());
</span><span class="cx"> result->putDirect(vm, Identifier::fromString(&vm, "longAttr"), longAttrValue);
</span><span class="cx">
</span><del>- auto createValue = jsTestObjCreateGetter(*state, *thisObject, throwScope);
- ASSERT(!throwScope.exception());
- result->putDirect(vm, Identifier::fromString(&vm, "create"), createValue);
-
</del><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp (0 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -0,0 +1,448 @@
</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 "JSTestSerialization.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructor.h"
+#include "JSDOMConvert.h"
+#include "JSTestNode.h"
+#include "URL.h"
+#include <runtime/FunctionPrototype.h>
+#include <runtime/JSString.h>
+#include <runtime/ObjectConstructor.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestSerializationPrototypeFunctionToJSON(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestSerializationFirstStringAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationFirstStringAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationSecondLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationSecondLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationThirdUnserializableAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationThirdUnserializableAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationFourthUnrestrictedDoubleAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationFourthUnrestrictedDoubleAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationFifthLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationFifthLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestSerializationPrototype : public JSC::JSNonFinalObject {
+public:
+ using Base = JSC::JSNonFinalObject;
+ static JSTestSerializationPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSTestSerializationPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestSerializationPrototype>(vm.heap)) JSTestSerializationPrototype(vm, globalObject, structure);
+ ptr->finishCreation(vm);
+ return ptr;
+ }
+
+ DECLARE_INFO;
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
+private:
+ JSTestSerializationPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+ : JSC::JSNonFinalObject(vm, structure)
+ {
+ }
+
+ void finishCreation(JSC::VM&);
+};
+
+using JSTestSerializationConstructor = JSDOMConstructorNotConstructable<JSTestSerialization>;
+
+template<> JSValue JSTestSerializationConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+ UNUSED_PARAM(vm);
+ return globalObject.functionPrototype();
+}
+
+template<> void JSTestSerializationConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+ putDirect(vm, vm.propertyNames->prototype, JSTestSerialization::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
+ putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestSerialization"))), ReadOnly | DontEnum);
+ putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestSerializationConstructor::s_info = { "TestSerialization", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestSerializationPrototypeTableValues[] =
+{
+ { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationConstructor) } },
+ { "firstStringAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFirstStringAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFirstStringAttribute) } },
+ { "secondLongAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationSecondLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationSecondLongAttribute) } },
+ { "thirdUnserializableAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationThirdUnserializableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationThirdUnserializableAttribute) } },
+ { "fourthUnrestrictedDoubleAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFourthUnrestrictedDoubleAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFourthUnrestrictedDoubleAttribute) } },
+ { "fifthLongAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFifthLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFifthLongAttribute) } },
+ { "toJSON", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestSerializationPrototypeFunctionToJSON), (intptr_t) (0) } },
+};
+
+const ClassInfo JSTestSerializationPrototype::s_info = { "TestSerializationPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationPrototype) };
+
+void JSTestSerializationPrototype::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ reifyStaticProperties(vm, JSTestSerializationPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestSerialization::s_info = { "TestSerialization", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerialization) };
+
+JSTestSerialization::JSTestSerialization(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestSerialization>&& impl)
+ : JSDOMWrapper<TestSerialization>(structure, globalObject, WTFMove(impl))
+{
+}
+
+JSObject* JSTestSerialization::createPrototype(VM& vm, JSGlobalObject* globalObject)
+{
+ return JSTestSerializationPrototype::create(vm, globalObject, JSTestSerializationPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+}
+
+JSObject* JSTestSerialization::prototype(VM& vm, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSTestSerialization>(vm, globalObject);
+}
+
+void JSTestSerialization::destroy(JSC::JSCell* cell)
+{
+ JSTestSerialization* thisObject = static_cast<JSTestSerialization*>(cell);
+ thisObject->JSTestSerialization::~JSTestSerialization();
+}
+
+template<> inline JSTestSerialization* BindingCaller<JSTestSerialization>::castForAttribute(ExecState&, EncodedJSValue thisValue)
+{
+ return jsDynamicCast<JSTestSerialization*>(JSValue::decode(thisValue));
+}
+
+template<> inline JSTestSerialization* BindingCaller<JSTestSerialization>::castForOperation(ExecState& state)
+{
+ return jsDynamicCast<JSTestSerialization*>(state.thisValue());
+}
+
+static inline JSValue jsTestSerializationFirstStringAttributeGetter(ExecState&, JSTestSerialization&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationFirstStringAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ return BindingCaller<JSTestSerialization>::attribute<jsTestSerializationFirstStringAttributeGetter>(state, thisValue, "firstStringAttribute");
+}
+
+static inline JSValue jsTestSerializationFirstStringAttributeGetter(ExecState& state, JSTestSerialization& thisObject, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(state);
+ auto& impl = thisObject.wrapped();
+ JSValue result = jsStringWithCache(&state, impl.firstStringAttribute());
+ return result;
+}
+
+static inline JSValue jsTestSerializationSecondLongAttributeGetter(ExecState&, JSTestSerialization&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationSecondLongAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ return BindingCaller<JSTestSerialization>::attribute<jsTestSerializationSecondLongAttributeGetter>(state, thisValue, "secondLongAttribute");
+}
+
+static inline JSValue jsTestSerializationSecondLongAttributeGetter(ExecState& state, JSTestSerialization& thisObject, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(state);
+ auto& impl = thisObject.wrapped();
+ JSValue result = jsNumber(impl.secondLongAttribute());
+ return result;
+}
+
+static inline JSValue jsTestSerializationThirdUnserializableAttributeGetter(ExecState&, JSTestSerialization&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationThirdUnserializableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ return BindingCaller<JSTestSerialization>::attribute<jsTestSerializationThirdUnserializableAttributeGetter>(state, thisValue, "thirdUnserializableAttribute");
+}
+
+static inline JSValue jsTestSerializationThirdUnserializableAttributeGetter(ExecState& state, JSTestSerialization& thisObject, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(state);
+ auto& impl = thisObject.wrapped();
+ JSValue result = toJS(&state, thisObject.globalObject(), impl.thirdUnserializableAttribute());
+ return result;
+}
+
+static inline JSValue jsTestSerializationFourthUnrestrictedDoubleAttributeGetter(ExecState&, JSTestSerialization&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationFourthUnrestrictedDoubleAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ return BindingCaller<JSTestSerialization>::attribute<jsTestSerializationFourthUnrestrictedDoubleAttributeGetter>(state, thisValue, "fourthUnrestrictedDoubleAttribute");
+}
+
+static inline JSValue jsTestSerializationFourthUnrestrictedDoubleAttributeGetter(ExecState& state, JSTestSerialization& thisObject, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(state);
+ auto& impl = thisObject.wrapped();
+ JSValue result = jsNumber(impl.fourthUnrestrictedDoubleAttribute());
+ return result;
+}
+
+static inline JSValue jsTestSerializationFifthLongAttributeGetter(ExecState&, JSTestSerialization&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationFifthLongAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ return BindingCaller<JSTestSerialization>::attribute<jsTestSerializationFifthLongAttributeGetter>(state, thisValue, "fifthLongAttribute");
+}
+
+static inline JSValue jsTestSerializationFifthLongAttributeGetter(ExecState& state, JSTestSerialization& thisObject, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(state);
+ auto& impl = thisObject.wrapped();
+ JSValue result = jsNumber(impl.fifthLongAttribute());
+ return result;
+}
+
+EncodedJSValue jsTestSerializationConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSTestSerializationPrototype* domObject = jsDynamicCast<JSTestSerializationPrototype*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!domObject))
+ return throwVMTypeError(state, throwScope);
+ return JSValue::encode(JSTestSerialization::getConstructor(state->vm(), domObject->globalObject()));
+}
+
+bool setJSTestSerializationConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSValue value = JSValue::decode(encodedValue);
+ JSTestSerializationPrototype* domObject = jsDynamicCast<JSTestSerializationPrototype*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!domObject)) {
+ throwVMTypeError(state, throwScope);
+ return false;
+ }
+ // Shadowing a built-in constructor
+ return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
+}
+
+static inline bool setJSTestSerializationFirstStringAttributeFunction(ExecState&, JSTestSerialization&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationFirstStringAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ return BindingCaller<JSTestSerialization>::setAttribute<setJSTestSerializationFirstStringAttributeFunction>(state, thisValue, encodedValue, "firstStringAttribute");
+}
+
+static inline bool setJSTestSerializationFirstStringAttributeFunction(ExecState& state, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(throwScope);
+ auto& impl = thisObject.wrapped();
+ auto nativeValue = value.toWTFString(&state);
+ RETURN_IF_EXCEPTION(throwScope, false);
+ impl.setFirstStringAttribute(WTFMove(nativeValue));
+ return true;
+}
+
+
+static inline bool setJSTestSerializationSecondLongAttributeFunction(ExecState&, JSTestSerialization&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationSecondLongAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ return BindingCaller<JSTestSerialization>::setAttribute<setJSTestSerializationSecondLongAttributeFunction>(state, thisValue, encodedValue, "secondLongAttribute");
+}
+
+static inline bool setJSTestSerializationSecondLongAttributeFunction(ExecState& state, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(throwScope);
+ auto& impl = thisObject.wrapped();
+ auto nativeValue = convert<IDLLong>(state, value, NormalConversion);
+ RETURN_IF_EXCEPTION(throwScope, false);
+ impl.setSecondLongAttribute(WTFMove(nativeValue));
+ return true;
+}
+
+
+static inline bool setJSTestSerializationThirdUnserializableAttributeFunction(ExecState&, JSTestSerialization&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationThirdUnserializableAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ return BindingCaller<JSTestSerialization>::setAttribute<setJSTestSerializationThirdUnserializableAttributeFunction>(state, thisValue, encodedValue, "thirdUnserializableAttribute");
+}
+
+static inline bool setJSTestSerializationThirdUnserializableAttributeFunction(ExecState& state, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(throwScope);
+ auto& impl = thisObject.wrapped();
+ auto nativeValue = JSTestNode::toWrapped(value);
+ if (UNLIKELY(!nativeValue)) {
+ throwAttributeTypeError(state, throwScope, "TestSerialization", "thirdUnserializableAttribute", "TestNode");
+ return false;
+ }
+ impl.setThirdUnserializableAttribute(*nativeValue);
+ return true;
+}
+
+
+static inline bool setJSTestSerializationFourthUnrestrictedDoubleAttributeFunction(ExecState&, JSTestSerialization&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationFourthUnrestrictedDoubleAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ return BindingCaller<JSTestSerialization>::setAttribute<setJSTestSerializationFourthUnrestrictedDoubleAttributeFunction>(state, thisValue, encodedValue, "fourthUnrestrictedDoubleAttribute");
+}
+
+static inline bool setJSTestSerializationFourthUnrestrictedDoubleAttributeFunction(ExecState& state, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(throwScope);
+ auto& impl = thisObject.wrapped();
+ auto nativeValue = convert<IDLUnrestrictedDouble>(state, value);
+ RETURN_IF_EXCEPTION(throwScope, false);
+ impl.setFourthUnrestrictedDoubleAttribute(WTFMove(nativeValue));
+ return true;
+}
+
+
+static inline bool setJSTestSerializationFifthLongAttributeFunction(ExecState&, JSTestSerialization&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationFifthLongAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ return BindingCaller<JSTestSerialization>::setAttribute<setJSTestSerializationFifthLongAttributeFunction>(state, thisValue, encodedValue, "fifthLongAttribute");
+}
+
+static inline bool setJSTestSerializationFifthLongAttributeFunction(ExecState& state, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(throwScope);
+ auto& impl = thisObject.wrapped();
+ auto nativeValue = convert<IDLLong>(state, value, NormalConversion);
+ RETURN_IF_EXCEPTION(throwScope, false);
+ impl.setFifthLongAttribute(WTFMove(nativeValue));
+ return true;
+}
+
+
+JSValue JSTestSerialization::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestSerializationConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+static inline EncodedJSValue jsTestSerializationPrototypeFunctionToJSONCaller(ExecState* state, JSTestSerialization* thisObject, JSC::ThrowScope& throwScope)
+{
+ auto& vm = state->vm();
+ auto* result = constructEmptyObject(state);
+
+ auto firstStringAttributeValue = jsTestSerializationFirstStringAttributeGetter(*state, *thisObject, throwScope);
+ ASSERT(!throwScope.exception());
+ result->putDirect(vm, Identifier::fromString(&vm, "firstStringAttribute"), firstStringAttributeValue);
+
+ auto secondLongAttributeValue = jsTestSerializationSecondLongAttributeGetter(*state, *thisObject, throwScope);
+ ASSERT(!throwScope.exception());
+ result->putDirect(vm, Identifier::fromString(&vm, "secondLongAttribute"), secondLongAttributeValue);
+
+ auto fourthUnrestrictedDoubleAttributeValue = jsTestSerializationFourthUnrestrictedDoubleAttributeGetter(*state, *thisObject, throwScope);
+ ASSERT(!throwScope.exception());
+ result->putDirect(vm, Identifier::fromString(&vm, "fourthUnrestrictedDoubleAttribute"), fourthUnrestrictedDoubleAttributeValue);
+
+ auto fifthLongAttributeValue = jsTestSerializationFifthLongAttributeGetter(*state, *thisObject, throwScope);
+ ASSERT(!throwScope.exception());
+ result->putDirect(vm, Identifier::fromString(&vm, "fifthLongAttribute"), fifthLongAttributeValue);
+
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestSerializationPrototypeFunctionToJSON(ExecState* state)
+{
+ return BindingCaller<JSTestSerialization>::callOperation<jsTestSerializationPrototypeFunctionToJSONCaller>(state, "toJSON");
+}
+
+bool JSTestSerializationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+ UNUSED_PARAM(handle);
+ UNUSED_PARAM(visitor);
+ return false;
+}
+
+void JSTestSerializationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+ auto* jsTestSerialization = jsCast<JSTestSerialization*>(handle.slot()->asCell());
+ auto& world = *static_cast<DOMWrapperWorld*>(context);
+ uncacheWrapper(world, &jsTestSerialization->wrapped(), jsTestSerialization);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestSerialization@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore17TestSerializationE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestSerialization>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+ void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+ void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestSerialization@WebCore@@6B@"));
+#else
+ void* expectedVTablePointer = &_ZTVN7WebCore17TestSerializationE[2];
+#if COMPILER(CLANG)
+ // If this fails TestSerialization does not have a vtable, so you need to add the
+ // ImplementationLacksVTable attribute to the interface definition
+ static_assert(__is_polymorphic(TestSerialization), "TestSerialization is not polymorphic");
+#endif
+#endif
+ // If you hit this assertion you either have a use after free bug, or
+ // TestSerialization has subclasses. If TestSerialization has subclasses that get passed
+ // to toJS() we currently require TestSerialization you to opt out of binding hardening
+ // by adding the SkipVTableValidation attribute to the interface IDL definition
+ RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+ return createWrapper<TestSerialization>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestSerialization& impl)
+{
+ return wrap(state, globalObject, impl);
+}
+
+TestSerialization* JSTestSerialization::toWrapped(JSC::JSValue value)
+{
+ if (auto* wrapper = jsDynamicCast<JSTestSerialization*>(value))
+ return &wrapper->wrapped();
+ return nullptr;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializationh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.h (0 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.h         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.h        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -0,0 +1,89 @@
</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 "JSDOMWrapper.h"
+#include "TestSerialization.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestSerialization : public JSDOMWrapper<TestSerialization> {
+public:
+ using Base = JSDOMWrapper<TestSerialization>;
+ static JSTestSerialization* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestSerialization>&& impl)
+ {
+ JSTestSerialization* ptr = new (NotNull, JSC::allocateCell<JSTestSerialization>(globalObject->vm().heap)) JSTestSerialization(structure, *globalObject, WTFMove(impl));
+ ptr->finishCreation(globalObject->vm());
+ return ptr;
+ }
+
+ static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
+ static JSC::JSObject* prototype(JSC::VM&, JSC::JSGlobalObject*);
+ static TestSerialization* toWrapped(JSC::JSValue);
+ static void destroy(JSC::JSCell*);
+
+ DECLARE_INFO;
+
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
+ static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+protected:
+ JSTestSerialization(JSC::Structure*, JSDOMGlobalObject&, Ref<TestSerialization>&&);
+
+ void finishCreation(JSC::VM& vm)
+ {
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+ }
+
+};
+
+class JSTestSerializationOwner : public JSC::WeakHandleOwner {
+public:
+ virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+ virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestSerialization*)
+{
+ static NeverDestroyed<JSTestSerializationOwner> owner;
+ return &owner.get();
+}
+
+inline void* wrapperKey(TestSerialization* wrappableObject)
+{
+ return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerialization&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestSerialization* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestSerialization>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestSerialization>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestSerialization> {
+ using WrapperClass = JSTestSerialization;
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -414,8 +414,7 @@
</span><span class="cx">
</span><span class="cx"> stringifier attribute USVString stringifierAttribute;
</span><span class="cx">
</span><del>-
- serializer = {readOnlyStringAttr, create, enumAttr, longAttr};
</del><ins>+ serializer = {create, readOnlyStringAttr, enumAttr, longAttr};
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // The following comment should not generate any code.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestSerializationidlfromrev207377trunkSourceWebCoredomClientRectidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl (from rev 207377, trunk/Source/WebCore/dom/ClientRect.idl) (0 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl         (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -0,0 +1,34 @@
</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. ``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
+ * 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.
+ */
+
+interface TestSerialization {
+ attribute DOMString firstStringAttribute;
+ attribute long secondLongAttribute;
+ attribute TestNode thirdUnserializableAttribute;
+ attribute unrestricted double fourthUnrestrictedDoubleAttribute;
+ attribute long fifthLongAttribute;
+
+ serializer = { attribute };
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoredomClientRectidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ClientRect.idl (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ClientRect.idl        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/dom/ClientRect.idl        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -35,7 +35,5 @@
</span><span class="cx"> readonly attribute unrestricted float width;
</span><span class="cx"> readonly attribute unrestricted float height;
</span><span class="cx">
</span><del>- // FIXME: should be serializer = { attribute };
- [Custom] Object toJSON();
</del><ins>+ serializer = { attribute };
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceTimingidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceTiming.idl (207377 => 207378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceTiming.idl        2016-10-15 20:56:24 UTC (rev 207377)
+++ trunk/Source/WebCore/page/PerformanceTiming.idl        2016-10-15 21:15:17 UTC (rev 207378)
</span><span class="lines">@@ -54,7 +54,5 @@
</span><span class="cx"> readonly attribute unsigned long long loadEventStart;
</span><span class="cx"> readonly attribute unsigned long long loadEventEnd;
</span><span class="cx">
</span><del>- // FIXME: Should be serializer = { attribute };
- [Custom] Object toJSON();
</del><ins>+ serializer = { attribute };
</ins><span class="cx"> };
</span><del>-
</del></span></pre>
</div>
</div>
</body>
</html>