<!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>[192839] 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/192839">192839</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2015-11-30 15:57:31 -0800 (Mon, 30 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use Optional instead of isNull out argument for nullable getters
https://bugs.webkit.org/show_bug.cgi?id=151676

Reviewed by Anders Carlsson.

No behavior change, just cleaner code.

* Modules/geolocation/Coordinates.cpp:
(WebCore::Coordinates::altitude): Return an Optional.
(WebCore::Coordinates::altitudeAccuracy): Ditto.
(WebCore::Coordinates::heading): Ditto.
(WebCore::Coordinates::speed): Ditto.
* Modules/geolocation/Coordinates.h: Ditto.

* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::create): Added. The code before was calling
through to Event::create, which is clearly not what was wanted. Also removed
unneeded explicit destructor.
* Modules/indexeddb/IDBVersionChangeEvent.h: Changed return type of newVersion
to Optional and updated for above change.

* Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
(WebCore::IDBClient::IDBVersionChangeEvent::newVersion): Changed to return
an Optional.
* Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed unused
default argument values; the event type one, at least, was clearly incorrect.
Made more things private, got rid of unneeded destructor, marked class final
instead of marking all functions final.

* Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp:
(WebCore::LegacyVersionChangeEvent::newVersion): Same as above.
* Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Ditto.

* Modules/mediastream/MediaTrackConstraints.cpp:
(WebCore::MediaTrackConstraints::optional): Removed bogus bool value. If we
come back to finish later we will have to implement optional return values
for arrays in the JavaScript bindings generator, which should be straightforward.
* Modules/mediastream/MediaTrackConstraints.h: Ditto.

* bindings/js/JSDOMBinding.h:
(WebCore::toNullableJSNumber): Added. This function template is used for
return values that are nullable numbers.

* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateFunction): Replaced some existing bogus code to handle nullables with
new equally-bogus code that should be no worse and will compile.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed old support for nullables.
(NativeToJSValue): Added new support for nullable numbers.

* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateImplementation): Removed support for nullables. We almost certainly
won't need it for Objective-C bindings.

* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Updated.
* bindings/scripts/test/JS/JSTestObj.cpp: Updated.
* bindings/scripts/test/ObjC/DOMTestObj.mm: Updated.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationCoordinatescpp">trunk/Source/WebCore/Modules/geolocation/Coordinates.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationCoordinatesh">trunk/Source/WebCore/Modules/geolocation/Coordinates.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBVersionChangeEventcpp">trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBVersionChangeEventh">trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBVersionChangeEventImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBVersionChangeEventImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddblegacyLegacyVersionChangeEventcpp">trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddblegacyLegacyVersionChangeEventh">trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaTrackConstraintscpp">trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaTrackConstraintsh">trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorGObjectpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorObjCpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/ChangeLog        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -1,3 +1,64 @@
</span><ins>+2015-11-30  Darin Adler  &lt;darin@apple.com&gt;
+
+        Use Optional instead of isNull out argument for nullable getters
+        https://bugs.webkit.org/show_bug.cgi?id=151676
+
+        Reviewed by Anders Carlsson.
+
+        No behavior change, just cleaner code.
+
+        * Modules/geolocation/Coordinates.cpp:
+        (WebCore::Coordinates::altitude): Return an Optional.
+        (WebCore::Coordinates::altitudeAccuracy): Ditto.
+        (WebCore::Coordinates::heading): Ditto.
+        (WebCore::Coordinates::speed): Ditto.
+        * Modules/geolocation/Coordinates.h: Ditto.
+
+        * Modules/indexeddb/IDBVersionChangeEvent.cpp:
+        (WebCore::IDBVersionChangeEvent::create): Added. The code before was calling
+        through to Event::create, which is clearly not what was wanted. Also removed
+        unneeded explicit destructor.
+        * Modules/indexeddb/IDBVersionChangeEvent.h: Changed return type of newVersion
+        to Optional and updated for above change.
+
+        * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
+        (WebCore::IDBClient::IDBVersionChangeEvent::newVersion): Changed to return
+        an Optional.
+        * Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed unused
+        default argument values; the event type one, at least, was clearly incorrect.
+        Made more things private, got rid of unneeded destructor, marked class final
+        instead of marking all functions final.
+
+        * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp:
+        (WebCore::LegacyVersionChangeEvent::newVersion): Same as above.
+        * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Ditto.
+
+        * Modules/mediastream/MediaTrackConstraints.cpp:
+        (WebCore::MediaTrackConstraints::optional): Removed bogus bool value. If we
+        come back to finish later we will have to implement optional return values
+        for arrays in the JavaScript bindings generator, which should be straightforward.
+        * Modules/mediastream/MediaTrackConstraints.h: Ditto.
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::toNullableJSNumber): Added. This function template is used for
+        return values that are nullable numbers.
+
+        * bindings/scripts/CodeGeneratorGObject.pm:
+        (GenerateFunction): Replaced some existing bogus code to handle nullables with
+        new equally-bogus code that should be no worse and will compile.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation): Removed old support for nullables.
+        (NativeToJSValue): Added new support for nullable numbers.
+
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        (GenerateImplementation): Removed support for nullables. We almost certainly
+        won't need it for Objective-C bindings.
+
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Updated.
+        * bindings/scripts/test/JS/JSTestObj.cpp: Updated.
+        * bindings/scripts/test/ObjC/DOMTestObj.mm: Updated.
+
</ins><span class="cx"> 2015-11-30  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Split platform-independent logic in AVCaptureDeviceManager out into a new class
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationCoordinatescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Coordinates.cpp (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Coordinates.cpp        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/geolocation/Coordinates.cpp        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -28,40 +28,32 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-double Coordinates::altitude(bool&amp; isNull) const
</del><ins>+Optional&lt;double&gt; Coordinates::altitude() const
</ins><span class="cx"> {
</span><del>-    if (m_canProvideAltitude)
-        return m_altitude;
-
-    isNull = true;
-    return 0;
</del><ins>+    if (!m_canProvideAltitude)
+        return Nullopt;
+    return m_altitude;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-double Coordinates::altitudeAccuracy(bool&amp; isNull) const
</del><ins>+Optional&lt;double&gt; Coordinates::altitudeAccuracy() const
</ins><span class="cx"> {
</span><del>-    if (m_canProvideAltitudeAccuracy)
-        return m_altitudeAccuracy;
-
-    isNull = true;
-    return 0;
</del><ins>+    if (!m_canProvideAltitudeAccuracy)
+        return Nullopt;
+    return m_altitudeAccuracy;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-double Coordinates::heading(bool&amp; isNull) const
</del><ins>+Optional&lt;double&gt; Coordinates::heading() const
</ins><span class="cx"> {
</span><del>-    if (m_canProvideHeading)
-        return m_heading;
-
-    isNull = true;
-    return 0;
</del><ins>+    if (!m_canProvideHeading)
+        return Nullopt;
+    return m_heading;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-double Coordinates::speed(bool&amp; isNull) const
</del><ins>+Optional&lt;double&gt; Coordinates::speed() const
</ins><span class="cx"> {
</span><del>-    if (m_canProvideSpeed)
-        return m_speed;
-
-    isNull = true;
-    return 0;
</del><ins>+    if (!m_canProvideSpeed)
+        return Nullopt;
+    return m_speed;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationCoordinatesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Coordinates.h (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Coordinates.h        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/geolocation/Coordinates.h        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define Coordinates_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Event.h&quot;
</span><ins>+#include &lt;wtf/Optional.h&gt;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -42,11 +43,11 @@
</span><span class="cx"> 
</span><span class="cx">     double latitude() const { return m_latitude; }
</span><span class="cx">     double longitude() const { return m_longitude; }
</span><del>-    double altitude(bool&amp; isNull) const;
</del><ins>+    Optional&lt;double&gt; altitude() const;
</ins><span class="cx">     double accuracy() const { return m_accuracy; }
</span><del>-    double altitudeAccuracy(bool&amp; isNull) const;
-    double heading(bool&amp; isNull) const;
-    double speed(bool&amp; isNull) const;
</del><ins>+    Optional&lt;double&gt; altitudeAccuracy() const;
+    Optional&lt;double&gt; heading() const;
+    Optional&lt;double&gt; speed() const;
</ins><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     Coordinates(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBVersionChangeEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -28,6 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;EventNames.h&quot;
+#include &quot;IDBVersionChangeEventImpl.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString&amp; name)
</span><span class="lines">@@ -35,6 +38,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBVersionChangeEvent&gt; IDBVersionChangeEvent::create()
+{
+    // FIXME: This is called only by document.createEvent. I don't see how it's valuable to create an event with
+    // read-only oldVersion attribute of 0 and newVersion of null; preserving that behavior for now.
+    return IDBClient::IDBVersionChangeEvent::create(0, 0, eventNames().versionchangeEvent);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBVersionChangeEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -29,21 +29,19 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Event.h&quot;
</span><del>-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
</del><ins>+#include &lt;wtf/Optional.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class IDBVersionChangeEvent : public Event {
</span><span class="cx"> public:
</span><del>-    virtual ~IDBVersionChangeEvent() { }
</del><ins>+    static Ref&lt;IDBVersionChangeEvent&gt; create();
</ins><span class="cx"> 
</span><span class="cx">     virtual uint64_t oldVersion() const = 0;
</span><del>-    virtual uint64_t newVersion(bool&amp; isNull) const = 0;
</del><ins>+    virtual Optional&lt;uint64_t&gt; newVersion() const = 0;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    IDBVersionChangeEvent(const AtomicString&amp;);
</del><ins>+    explicit IDBVersionChangeEvent(const AtomicString&amp; type);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBVersionChangeEventImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -38,9 +38,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-uint64_t IDBVersionChangeEvent::newVersion(bool&amp; isNull) const
</del><ins>+Optional&lt;uint64_t&gt; IDBVersionChangeEvent::newVersion() const
</ins><span class="cx"> {
</span><del>-    isNull = !m_newVersion;
</del><ins>+    if (!m_newVersion)
+        return Nullopt;
</ins><span class="cx">     return m_newVersion;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBVersionChangeEventImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -33,23 +33,22 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBClient {
</span><span class="cx"> 
</span><del>-class IDBVersionChangeEvent : public WebCore::IDBVersionChangeEvent {
</del><ins>+class IDBVersionChangeEvent final : public WebCore::IDBVersionChangeEvent {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;IDBVersionChangeEvent&gt; create(uint64_t oldVersion = 0, uint64_t newVersion = 0, const AtomicString&amp; eventType = AtomicString())
</del><ins>+    static Ref&lt;IDBVersionChangeEvent&gt; create(uint64_t oldVersion, uint64_t newVersion, const AtomicString&amp; eventType)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(*new IDBVersionChangeEvent(oldVersion, newVersion, eventType));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual uint64_t oldVersion() const override final { return m_oldVersion; }
-    virtual uint64_t newVersion(bool&amp; isNull) const override final;
-
-    virtual EventInterface eventInterface() const override final;
-
</del><span class="cx"> private:
</span><span class="cx">     IDBVersionChangeEvent(uint64_t oldVersion, uint64_t newVersion, const AtomicString&amp; eventType);
</span><span class="cx"> 
</span><del>-    uint64_t m_oldVersion { 0 };
-    uint64_t m_newVersion { 0 };
</del><ins>+    virtual uint64_t oldVersion() const override { return m_oldVersion; }
+    virtual Optional&lt;uint64_t&gt; newVersion() const override;
+    virtual EventInterface eventInterface() const override;
+
+    uint64_t m_oldVersion;
+    uint64_t m_newVersion;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddblegacyLegacyVersionChangeEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -37,13 +37,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LegacyVersionChangeEvent::~LegacyVersionChangeEvent()
</del><ins>+Optional&lt;uint64_t&gt; LegacyVersionChangeEvent::newVersion() const
</ins><span class="cx"> {
</span><del>-}
-
-uint64_t LegacyVersionChangeEvent::newVersion(bool&amp; isNull) const
-{
-    isNull = false;
</del><span class="cx">     return m_newVersion;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddblegacyLegacyVersionChangeEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -33,23 +33,20 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class LegacyVersionChangeEvent : public IDBVersionChangeEvent {
</del><ins>+class LegacyVersionChangeEvent final : public IDBVersionChangeEvent {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;LegacyVersionChangeEvent&gt; create(unsigned long long oldVersion = 0, unsigned long long newVersion = 0, const AtomicString&amp; eventType = AtomicString())
</del><ins>+    static Ref&lt;LegacyVersionChangeEvent&gt; create(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString&amp; eventType)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(*new LegacyVersionChangeEvent(oldVersion, newVersion, eventType));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual ~LegacyVersionChangeEvent();
-
-    virtual uint64_t oldVersion() const override final { return m_oldVersion; }
-    virtual uint64_t newVersion(bool&amp; isNull) const override final;
-
-    virtual EventInterface eventInterface() const override final;
-
</del><span class="cx"> private:
</span><span class="cx">     LegacyVersionChangeEvent(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString&amp; eventType);
</span><span class="cx"> 
</span><ins>+    virtual uint64_t oldVersion() const override { return m_oldVersion; }
+    virtual Optional&lt;uint64_t&gt; newVersion() const override;
+    virtual EventInterface eventInterface() const override;
+
</ins><span class="cx">     uint64_t m_oldVersion;
</span><span class="cx">     uint64_t m_newVersion;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaTrackConstraintscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;PassRefPtr&lt;MediaTrackConstraint&gt;&gt; MediaTrackConstraints::optional(bool) const
</del><ins>+Vector&lt;PassRefPtr&lt;MediaTrackConstraint&gt;&gt; MediaTrackConstraints::optional() const
</ins><span class="cx"> {
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=121954
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaTrackConstraintsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;MediaTrackConstraints&gt; create(PassRefPtr&lt;MediaConstraintsImpl&gt;);
</span><span class="cx"> 
</span><del>-    Vector&lt;PassRefPtr&lt;MediaTrackConstraint&gt;&gt; optional(bool) const;
</del><ins>+    Vector&lt;PassRefPtr&lt;MediaTrackConstraint&gt;&gt; optional() const;
</ins><span class="cx">     MediaTrackConstraintSet* mandatory() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -51,6 +51,9 @@
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+// FIXME: We could make this file a lot easier to read by putting all function declarations at the top,
+// and function definitions below, even for template and inline functions.
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx"> class HashEntry;
</span><span class="cx"> class JSFunction;
</span><span class="lines">@@ -283,6 +286,7 @@
</span><span class="cx"> void reportCurrentException(JSC::ExecState*);
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue createDOMException(JSC::ExecState*, ExceptionCode);
</span><ins>+
</ins><span class="cx"> // Convert a DOM implementation exception code into a JavaScript exception in the execution state.
</span><span class="cx"> WEBCORE_EXPORT void setDOMException(JSC::ExecState*, ExceptionCode);
</span><span class="cx"> 
</span><span class="lines">@@ -305,6 +309,8 @@
</span><span class="cx"> String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null
</span><span class="cx"> String valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt; JSC::JSValue toNullableJSNumber(Optional&lt;T&gt;); // null if the optional is null
+
</ins><span class="cx"> inline int32_t finiteInt32Value(JSC::JSValue value, JSC::ExecState* exec, bool&amp; okay)
</span><span class="cx"> {
</span><span class="cx">     double number = value.toNumber(exec);
</span><span class="lines">@@ -350,10 +356,12 @@
</span><span class="cx"> WEBCORE_EXPORT int64_t toInt64(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
</span><span class="cx"> WEBCORE_EXPORT uint64_t toUInt64(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
</span><span class="cx"> 
</span><del>-// Returns a Date instnace for the specified value, or NaN if the date is not a number.
</del><ins>+// Returns a Date instance for the specified value, or NaN if the date is not a number.
</ins><span class="cx"> JSC::JSValue jsDateOrNaN(JSC::ExecState*, double);
</span><ins>+
</ins><span class="cx"> // Returns a Date instance for the specified value, or null if the value is NaN or infinity.
</span><span class="cx"> JSC::JSValue jsDateOrNull(JSC::ExecState*, double);
</span><ins>+
</ins><span class="cx"> // NaN if the value can't be converted to a date.
</span><span class="cx"> double valueToDate(JSC::ExecState*, JSC::JSValue);
</span><span class="cx"> 
</span><span class="lines">@@ -685,7 +693,12 @@
</span><span class="cx">     JSC::PutPropertySlot propertySlot(&amp;object);
</span><span class="cx">     JSC::JSObject::put(&amp;object, &amp;exec, JSC::Identifier::fromString(&amp;exec, name), value, propertySlot);
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+template&lt;typename T&gt; inline JSC::JSValue toNullableJSNumber(Optional&lt;T&gt; optionalNumber)
+{
+    return optionalNumber ? JSC::jsNumber(optionalNumber.value()) : JSC::jsNull();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // JSDOMBinding_h
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorGObjectpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -575,8 +575,6 @@
</span><span class="cx"> 
</span><span class="cx">     push(@txtGetProps, &quot;    case ${propEnum}:\n&quot;);
</span><span class="cx"> 
</span><del>-    # FIXME: Should we return a default value when isNull == true?
-
</del><span class="cx">     my $postConvertFunction = &quot;&quot;;
</span><span class="cx">     if ($gtype eq &quot;string&quot;) {
</span><span class="cx">         push(@txtGetProps, &quot;        g_value_take_string(value, &quot; . $getterFunctionName . &quot;(&quot; . join(&quot;, &quot;, @getterArguments) . &quot;));\n&quot;);
</span><span class="lines">@@ -1239,6 +1237,12 @@
</span><span class="cx">             $assignPost = &quot;)&quot;;
</span><span class="cx">         } else {
</span><span class="cx">             $assign = &quot;${returnType} result = &quot;;
</span><ins>+            if ($function-&gt;signature-&gt;isNullable) {
+                # FIXME: Returning 0 is probably not right for all nullable attribute values.
+                # We may want to handle this the way we do in the Objective-C bindings: not
+                # handle it at all, and not expose any nullables.
+                $assignPost = &quot;.valueOr(0)&quot;;
+            }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ($functionSigType eq &quot;SerializedScriptValue&quot;) {
</span><span class="lines">@@ -1247,12 +1251,6 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    # FIXME: Should we return a default value when isNull == true?
-    if ($function-&gt;signature-&gt;isNullable) {
-        push(@cBody, &quot;    bool isNull = false;\n&quot;);
-        push(@callImplParams, &quot;isNull&quot;);
-    }
-
</del><span class="cx">     if ($raisesException) {
</span><span class="cx">         push(@cBody, &quot;    WebCore::ExceptionCode ec = 0;\n&quot;);
</span><span class="cx">         push(@callImplParams, &quot;ec&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -2278,8 +2278,6 @@
</span><span class="cx"> 
</span><span class="cx">             my $name = $attribute-&gt;signature-&gt;name;
</span><span class="cx">             my $type = $attribute-&gt;signature-&gt;type;
</span><del>-            # Nullable wrapper types do not need any special handling as the implementation can return a null pointer.
-            my $isNullable = $attribute-&gt;signature-&gt;isNullable &amp;&amp; !$codeGenerator-&gt;IsWrapperType($type);
</del><span class="cx">             $codeGenerator-&gt;AssertNotSequenceType($type);
</span><span class="cx">             my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $interface, $attribute);
</span><span class="cx">             my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;} || $name);
</span><span class="lines">@@ -2411,8 +2409,6 @@
</span><span class="cx">                     push(@implContent, &quot;    return JSValue::encode(JS&quot; . $constructorType . &quot;::getConstructor(state-&gt;vm(), castedThis-&gt;globalObject()));\n&quot;);
</span><span class="cx">                 }
</span><span class="cx">             } elsif (!$attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;GetterRaisesException&quot;}) {
</span><del>-                push(@implContent, &quot;    bool isNull = false;\n&quot;) if $isNullable;
-
</del><span class="cx">                 my $cacheIndex = 0;
</span><span class="cx">                 if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CachedAttribute&quot;}) {
</span><span class="cx">                     $cacheIndex = $currentCachedAttribute;
</span><span class="lines">@@ -2435,7 +2431,6 @@
</span><span class="cx">                     }
</span><span class="cx">                 } else {
</span><span class="cx">                     my ($functionName, @arguments) = $codeGenerator-&gt;GetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><del>-                    push(@arguments, &quot;isNull&quot;) if $isNullable;
</del><span class="cx">                     if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;}) {
</span><span class="cx">                         my $implementedBy = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;};
</span><span class="cx">                         $implIncludes{&quot;${implementedBy}.h&quot;} = 1;
</span><span class="lines">@@ -2456,22 +2451,12 @@
</span><span class="cx">                     } else {
</span><span class="cx">                         push(@implContent, &quot;    JSValue result = $jsType;\n&quot;);
</span><span class="cx">                     }
</span><del>-
-                    if ($isNullable) {
-                        push(@implContent, &quot;    if (isNull)\n&quot;);
-                        push(@implContent, &quot;        return JSValue::encode(jsNull());\n&quot;);
-                    }
</del><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 push(@implContent, &quot;    castedThis-&gt;m_&quot; . $attribute-&gt;signature-&gt;name . &quot;.set(state-&gt;vm(), castedThis, result);\n&quot;) if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CachedAttribute&quot;});
</span><span class="cx">                 push(@implContent, &quot;    return JSValue::encode(result);\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             } else {
</span><del>-                if ($isNullable) {
-                    push(@implContent, &quot;    bool isNull = false;\n&quot;);
-                    unshift(@arguments, &quot;isNull&quot;);
-                }
-
</del><span class="cx">                 unshift(@arguments, GenerateCallWith($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CallWith&quot;}, \@implContent, &quot;JSValue::encode(jsUndefined())&quot;));
</span><span class="cx"> 
</span><span class="cx">                 if ($svgPropertyOrListPropertyType) {
</span><span class="lines">@@ -2484,11 +2469,6 @@
</span><span class="cx"> 
</span><span class="cx">                 push(@implContent, &quot;    setDOMException(state, ec);\n&quot;);
</span><span class="cx"> 
</span><del>-                if ($isNullable) {
-                    push(@implContent, &quot;    if (isNull)\n&quot;);
-                    push(@implContent, &quot;        return JSValue::encode(jsNull());\n&quot;);
-                }
-
</del><span class="cx">                 push(@implContent, &quot;    return JSValue::encode(result);\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -4161,13 +4141,15 @@
</span><span class="cx">         return &quot;Symbol::create(state-&gt;vm(), *($value).uid())&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ($signature-&gt;extendedAttributes-&gt;{&quot;Reflect&quot;} and ($type eq &quot;unsigned long&quot; or $type eq &quot;unsigned short&quot;)) {
-        $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
-        return &quot;jsNumber(std::max(0, &quot; . $value . &quot;))&quot;;
-    }
-
</del><span class="cx">     if ($codeGenerator-&gt;IsPrimitiveType($type) or $type eq &quot;DOMTimeStamp&quot;) {
</span><del>-        return &quot;jsNumber($value)&quot;;
</del><ins>+        # We could instead overload a function to work with optional as well as non-optional numbers, but this
+        # is slightly better because it guarantees we will fail to compile if the IDL file doesn't match the C++.
+        my $function = $signature-&gt;isNullable ? &quot;toNullableJSNumber&quot; : &quot;jsNumber&quot;;
+        if ($signature-&gt;extendedAttributes-&gt;{&quot;Reflect&quot;} and ($type eq &quot;unsigned long&quot; or $type eq &quot;unsigned short&quot;)) {
+            $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
+            return &quot;$function(std::max(0, &quot; . $value . &quot;))&quot;;
+        }
+        return &quot;$function($value)&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;IsEnumType($type)) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorObjCpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -105,7 +105,6 @@
</span><span class="cx"> 
</span><span class="cx"> # Constants
</span><span class="cx"> my $shouldUseCGColor = defined $ENV{PLATFORM_NAME} &amp;&amp; $ENV{PLATFORM_NAME} ne &quot;macosx&quot;;
</span><del>-my $nullableInit = &quot;bool isNull = false;&quot;;
</del><span class="cx"> my $exceptionInit = &quot;WebCore::ExceptionCode ec = 0;&quot;;
</span><span class="cx"> my $jsContextSetter = &quot;WebCore::JSMainThreadNullState state;&quot;;
</span><span class="cx"> my $exceptionRaiseOnError = &quot;WebCore::raiseOnDOMError(ec);&quot;;
</span><span class="lines">@@ -1360,14 +1359,14 @@
</span><span class="cx">                 $getterContentTail .= &quot;))&quot;;
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            # It would be easy to add nullable support here if we ever need it, but we probably never
+            # will since we are unlikely to add Objective-C bindings that require it in the future.
+            # In particular, we'd have to decide what return type to use for &quot;number or null&quot;.
+
</ins><span class="cx">             my $getterContent;
</span><del>-            if ($hasGetterException || $attribute-&gt;signature-&gt;isNullable) {
</del><ins>+            if ($hasGetterException) {
</ins><span class="cx">                 $getterContent = $getterContentHead;
</span><span class="cx">                 my $getterWithoutAttributes = $getterContentHead =~ /\($|, $/ ? &quot;ec&quot; : &quot;, ec&quot;;
</span><del>-                if ($attribute-&gt;signature-&gt;isNullable) {
-                    $getterContent .= $getterWithoutAttributes ? &quot;isNull&quot; : &quot;, isNull&quot;;
-                    $getterWithoutAttributes = 0;
-                }
</del><span class="cx">                 if ($hasGetterException) {
</span><span class="cx">                     $getterContent .= $getterWithoutAttributes ? &quot;ec&quot; : &quot;, ec&quot;;
</span><span class="cx">                 }
</span><span class="lines">@@ -1383,11 +1382,6 @@
</span><span class="cx">             push(@implContent, &quot;    $jsContextSetter\n&quot;);
</span><span class="cx">             push(@implContent, @customGetterContent);
</span><span class="cx"> 
</span><del>-            # FIXME: Should we return a default value when isNull == true?
-            if ($attribute-&gt;signature-&gt;isNullable) {
-                push(@implContents, &quot;    $nullableInit\n&quot;);
-            }
-
</del><span class="cx">             if ($hasGetterException) {
</span><span class="cx">                 # Differentiated between when the return type is a pointer and
</span><span class="cx">                 # not for white space issue (ie. Foo *result vs. int result).
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -2415,8 +2415,7 @@
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
</span><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    bool isNull = false;
-    gdouble result = item-&gt;nullableDoubleAttribute(isNull);
</del><ins>+    gdouble result = item-&gt;nullableDoubleAttribute().valueOr(0);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2425,8 +2424,7 @@
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
</span><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    bool isNull = false;
-    glong result = item-&gt;nullableLongAttribute(isNull);
</del><ins>+    glong result = item-&gt;nullableLongAttribute().valueOr(0);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2435,8 +2433,7 @@
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), FALSE);
</span><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    bool isNull = false;
-    gboolean result = item-&gt;nullableBooleanAttribute(isNull);
</del><ins>+    gboolean result = item-&gt;nullableBooleanAttribute().valueOr(0);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2445,8 +2442,7 @@
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
</span><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    bool isNull = false;
-    gchar* result = convertToUTF8String(item-&gt;nullableStringAttribute(isNull));
</del><ins>+    gchar* result = convertToUTF8String(item-&gt;nullableStringAttribute());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2455,8 +2451,7 @@
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
</span><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    bool isNull = false;
-    glong result = item-&gt;nullableLongSettableAttribute(isNull);
</del><ins>+    glong result = item-&gt;nullableLongSettableAttribute().valueOr(0);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2474,9 +2469,8 @@
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
</span><span class="cx">     g_return_val_if_fail(!error || !*error, 0);
</span><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    bool isNull = false;
</del><span class="cx">     WebCore::ExceptionCode ec = 0;
</span><del>-    glong result = item-&gt;nullableStringValue(isNull, ec);
</del><ins>+    glong result = item-&gt;nullableStringValue(ec).valueOr(0);
</ins><span class="cx">     if (ec) {
</span><span class="cx">         WebCore::ExceptionCodeDescription ecdesc(ec);
</span><span class="cx">         g_set_error_literal(error, g_quark_from_string(&quot;WEBKIT_DOM&quot;), ecdesc.code, ecdesc.name);
</span><span class="lines">@@ -2515,8 +2509,7 @@
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
</span><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    bool isNull = false;
-    RefPtr&lt;WebCore::TestNode&gt; gobjectResult = WTF::getPtr(item-&gt;putForwardsNullableAttribute(isNull));
</del><ins>+    RefPtr&lt;WebCore::TestNode&gt; gobjectResult = WTF::getPtr(item-&gt;putForwardsNullableAttribute());
</ins><span class="cx">     return WebKit::kit(gobjectResult.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -1824,11 +1824,8 @@
</span><span class="cx">             return reportDeprecatedGetterError(*state, &quot;TestObj&quot;, &quot;nullableDoubleAttribute&quot;);
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableDoubleAttribute&quot;);
</span><span class="cx">     }
</span><del>-    bool isNull = false;
</del><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsNumber(impl.nullableDoubleAttribute(isNull));
-    if (isNull)
-        return JSValue::encode(jsNull());
</del><ins>+    JSValue result = toNullableJSNumber(impl.nullableDoubleAttribute());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1844,11 +1841,8 @@
</span><span class="cx">             return reportDeprecatedGetterError(*state, &quot;TestObj&quot;, &quot;nullableLongAttribute&quot;);
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableLongAttribute&quot;);
</span><span class="cx">     }
</span><del>-    bool isNull = false;
</del><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsNumber(impl.nullableLongAttribute(isNull));
-    if (isNull)
-        return JSValue::encode(jsNull());
</del><ins>+    JSValue result = toNullableJSNumber(impl.nullableLongAttribute());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1864,11 +1858,8 @@
</span><span class="cx">             return reportDeprecatedGetterError(*state, &quot;TestObj&quot;, &quot;nullableBooleanAttribute&quot;);
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableBooleanAttribute&quot;);
</span><span class="cx">     }
</span><del>-    bool isNull = false;
</del><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsBoolean(impl.nullableBooleanAttribute(isNull));
-    if (isNull)
-        return JSValue::encode(jsNull());
</del><ins>+    JSValue result = jsBoolean(impl.nullableBooleanAttribute());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1884,11 +1875,8 @@
</span><span class="cx">             return reportDeprecatedGetterError(*state, &quot;TestObj&quot;, &quot;nullableStringAttribute&quot;);
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableStringAttribute&quot;);
</span><span class="cx">     }
</span><del>-    bool isNull = false;
</del><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsStringWithCache(state, impl.nullableStringAttribute(isNull));
-    if (isNull)
-        return JSValue::encode(jsNull());
</del><ins>+    JSValue result = jsStringWithCache(state, impl.nullableStringAttribute());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1904,11 +1892,8 @@
</span><span class="cx">             return reportDeprecatedGetterError(*state, &quot;TestObj&quot;, &quot;nullableLongSettableAttribute&quot;);
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableLongSettableAttribute&quot;);
</span><span class="cx">     }
</span><del>-    bool isNull = false;
</del><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsNumber(impl.nullableLongSettableAttribute(isNull));
-    if (isNull)
-        return JSValue::encode(jsNull());
</del><ins>+    JSValue result = toNullableJSNumber(impl.nullableLongSettableAttribute());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1925,12 +1910,9 @@
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableStringValue&quot;);
</span><span class="cx">     }
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    bool isNull = false;
</del><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsNumber(impl.nullableStringValue(isNull, ec));
</del><ins>+    JSValue result = toNullableJSNumber(impl.nullableStringValue(ec));
</ins><span class="cx">     setDOMException(state, ec);
</span><del>-    if (isNull)
-        return JSValue::encode(jsNull());
</del><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (192838 => 192839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2015-11-30 23:48:42 UTC (rev 192838)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2015-11-30 23:57:31 UTC (rev 192839)
</span><span class="lines">@@ -800,31 +800,31 @@
</span><span class="cx"> - (double)nullableDoubleAttribute
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    return IMPL-&gt;nullableDoubleAttribute(isNull);
</del><ins>+    return IMPL-&gt;nullableDoubleAttribute();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (int)nullableLongAttribute
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    return IMPL-&gt;nullableLongAttribute(isNull);
</del><ins>+    return IMPL-&gt;nullableLongAttribute();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)nullableBooleanAttribute
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    return IMPL-&gt;nullableBooleanAttribute(isNull);
</del><ins>+    return IMPL-&gt;nullableBooleanAttribute();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSString *)nullableStringAttribute
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    return IMPL-&gt;nullableStringAttribute(isNull);
</del><ins>+    return IMPL-&gt;nullableStringAttribute();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (int)nullableLongSettableAttribute
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    return IMPL-&gt;nullableLongSettableAttribute(isNull);
</del><ins>+    return IMPL-&gt;nullableLongSettableAttribute();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setNullableLongSettableAttribute:(int)newNullableLongSettableAttribute
</span><span class="lines">@@ -837,7 +837,7 @@
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     WebCore::ExceptionCode ec = 0;
</span><del>-    int result = IMPL-&gt;nullableStringValue(isNull, ec);
</del><ins>+    int result = IMPL-&gt;nullableStringValue(ec);
</ins><span class="cx">     WebCore::raiseOnDOMError(ec);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -863,7 +863,7 @@
</span><span class="cx"> - (DOMTestNode *)putForwardsNullableAttribute
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    return kit(WTF::getPtr(IMPL-&gt;putForwardsNullableAttribute(isNull)));
</del><ins>+    return kit(WTF::getPtr(IMPL-&gt;putForwardsNullableAttribute()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)voidMethod
</span></span></pre>
</div>
</div>

</body>
</html>