<!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 <darin@apple.com>
+
+ 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 <wenson_hsieh@apple.com>
</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& isNull) const
</del><ins>+Optional<double> 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& isNull) const
</del><ins>+Optional<double> 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& isNull) const
</del><ins>+Optional<double> 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& isNull) const
</del><ins>+Optional<double> 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 "Event.h"
</span><ins>+#include <wtf/Optional.h>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</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& isNull) const;
</del><ins>+ Optional<double> altitude() const;
</ins><span class="cx"> double accuracy() const { return m_accuracy; }
</span><del>- double altitudeAccuracy(bool& isNull) const;
- double heading(bool& isNull) const;
- double speed(bool& isNull) const;
</del><ins>+ Optional<double> altitudeAccuracy() const;
+ Optional<double> heading() const;
+ Optional<double> 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 "EventNames.h"
+#include "IDBVersionChangeEventImpl.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& name)
</span><span class="lines">@@ -35,6 +38,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Ref<IDBVersionChangeEvent> 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 "Event.h"
</span><del>-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
</del><ins>+#include <wtf/Optional.h>
</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<IDBVersionChangeEvent> create();
</ins><span class="cx">
</span><span class="cx"> virtual uint64_t oldVersion() const = 0;
</span><del>- virtual uint64_t newVersion(bool& isNull) const = 0;
</del><ins>+ virtual Optional<uint64_t> newVersion() const = 0;
</ins><span class="cx">
</span><span class="cx"> protected:
</span><del>- IDBVersionChangeEvent(const AtomicString&);
</del><ins>+ explicit IDBVersionChangeEvent(const AtomicString& 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& isNull) const
</del><ins>+Optional<uint64_t> 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<IDBVersionChangeEvent> create(uint64_t oldVersion = 0, uint64_t newVersion = 0, const AtomicString& eventType = AtomicString())
</del><ins>+ static Ref<IDBVersionChangeEvent> create(uint64_t oldVersion, uint64_t newVersion, const AtomicString& 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& 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& 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<uint64_t> 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<uint64_t> LegacyVersionChangeEvent::newVersion() const
</ins><span class="cx"> {
</span><del>-}
-
-uint64_t LegacyVersionChangeEvent::newVersion(bool& 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<LegacyVersionChangeEvent> create(unsigned long long oldVersion = 0, unsigned long long newVersion = 0, const AtomicString& eventType = AtomicString())
</del><ins>+ static Ref<LegacyVersionChangeEvent> create(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& 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& 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& eventType);
</span><span class="cx">
</span><ins>+ virtual uint64_t oldVersion() const override { return m_oldVersion; }
+ virtual Optional<uint64_t> 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<PassRefPtr<MediaTrackConstraint>> MediaTrackConstraints::optional(bool) const
</del><ins>+Vector<PassRefPtr<MediaTrackConstraint>> 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<MediaTrackConstraints> create(PassRefPtr<MediaConstraintsImpl>);
</span><span class="cx">
</span><del>- Vector<PassRefPtr<MediaTrackConstraint>> optional(bool) const;
</del><ins>+ Vector<PassRefPtr<MediaTrackConstraint>> 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 <wtf/Noncopyable.h>
</span><span class="cx"> #include <wtf/Vector.h>
</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<typename T> JSC::JSValue toNullableJSNumber(Optional<T>); // null if the optional is null
+
</ins><span class="cx"> inline int32_t finiteInt32Value(JSC::JSValue value, JSC::ExecState* exec, bool& 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(&object);
</span><span class="cx"> JSC::JSObject::put(&object, &exec, JSC::Identifier::fromString(&exec, name), value, propertySlot);
</span><span class="cx"> }
</span><del>-
</del><ins>+
+template<typename T> inline JSC::JSValue toNullableJSNumber(Optional<T> 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, " case ${propEnum}:\n");
</span><span class="cx">
</span><del>- # FIXME: Should we return a default value when isNull == true?
-
</del><span class="cx"> my $postConvertFunction = "";
</span><span class="cx"> if ($gtype eq "string") {
</span><span class="cx"> push(@txtGetProps, " g_value_take_string(value, " . $getterFunctionName . "(" . join(", ", @getterArguments) . "));\n");
</span><span class="lines">@@ -1239,6 +1237,12 @@
</span><span class="cx"> $assignPost = ")";
</span><span class="cx"> } else {
</span><span class="cx"> $assign = "${returnType} result = ";
</span><ins>+ if ($function->signature->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 = ".valueOr(0)";
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($functionSigType eq "SerializedScriptValue") {
</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->signature->isNullable) {
- push(@cBody, " bool isNull = false;\n");
- push(@callImplParams, "isNull");
- }
-
</del><span class="cx"> if ($raisesException) {
</span><span class="cx"> push(@cBody, " WebCore::ExceptionCode ec = 0;\n");
</span><span class="cx"> push(@callImplParams, "ec");
</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->signature->name;
</span><span class="cx"> my $type = $attribute->signature->type;
</span><del>- # Nullable wrapper types do not need any special handling as the implementation can return a null pointer.
- my $isNullable = $attribute->signature->isNullable && !$codeGenerator->IsWrapperType($type);
</del><span class="cx"> $codeGenerator->AssertNotSequenceType($type);
</span><span class="cx"> my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $interface, $attribute);
</span><span class="cx"> my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{"ImplementedAs"} || $name);
</span><span class="lines">@@ -2411,8 +2409,6 @@
</span><span class="cx"> push(@implContent, " return JSValue::encode(JS" . $constructorType . "::getConstructor(state->vm(), castedThis->globalObject()));\n");
</span><span class="cx"> }
</span><span class="cx"> } elsif (!$attribute->signature->extendedAttributes->{"GetterRaisesException"}) {
</span><del>- push(@implContent, " bool isNull = false;\n") if $isNullable;
-
</del><span class="cx"> my $cacheIndex = 0;
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
</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->GetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><del>- push(@arguments, "isNull") if $isNullable;
</del><span class="cx"> if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
</span><span class="cx"> my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
</span><span class="cx"> $implIncludes{"${implementedBy}.h"} = 1;
</span><span class="lines">@@ -2456,22 +2451,12 @@
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " JSValue result = $jsType;\n");
</span><span class="cx"> }
</span><del>-
- if ($isNullable) {
- push(@implContent, " if (isNull)\n");
- push(@implContent, " return JSValue::encode(jsNull());\n");
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> push(@implContent, " castedThis->m_" . $attribute->signature->name . ".set(state->vm(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
</span><span class="cx"> push(@implContent, " return JSValue::encode(result);\n");
</span><span class="cx">
</span><span class="cx"> } else {
</span><del>- if ($isNullable) {
- push(@implContent, " bool isNull = false;\n");
- unshift(@arguments, "isNull");
- }
-
</del><span class="cx"> unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "JSValue::encode(jsUndefined())"));
</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, " setDOMException(state, ec);\n");
</span><span class="cx">
</span><del>- if ($isNullable) {
- push(@implContent, " if (isNull)\n");
- push(@implContent, " return JSValue::encode(jsNull());\n");
- }
-
</del><span class="cx"> push(@implContent, " return JSValue::encode(result);\n");
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4161,13 +4141,15 @@
</span><span class="cx"> return "Symbol::create(state->vm(), *($value).uid())";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($signature->extendedAttributes->{"Reflect"} and ($type eq "unsigned long" or $type eq "unsigned short")) {
- $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
- return "jsNumber(std::max(0, " . $value . "))";
- }
-
</del><span class="cx"> if ($codeGenerator->IsPrimitiveType($type) or $type eq "DOMTimeStamp") {
</span><del>- return "jsNumber($value)";
</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->isNullable ? "toNullableJSNumber" : "jsNumber";
+ if ($signature->extendedAttributes->{"Reflect"} and ($type eq "unsigned long" or $type eq "unsigned short")) {
+ $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
+ return "$function(std::max(0, " . $value . "))";
+ }
+ return "$function($value)";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->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} && $ENV{PLATFORM_NAME} ne "macosx";
</span><del>-my $nullableInit = "bool isNull = false;";
</del><span class="cx"> my $exceptionInit = "WebCore::ExceptionCode ec = 0;";
</span><span class="cx"> my $jsContextSetter = "WebCore::JSMainThreadNullState state;";
</span><span class="cx"> my $exceptionRaiseOnError = "WebCore::raiseOnDOMError(ec);";
</span><span class="lines">@@ -1360,14 +1359,14 @@
</span><span class="cx"> $getterContentTail .= "))";
</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 "number or null".
+
</ins><span class="cx"> my $getterContent;
</span><del>- if ($hasGetterException || $attribute->signature->isNullable) {
</del><ins>+ if ($hasGetterException) {
</ins><span class="cx"> $getterContent = $getterContentHead;
</span><span class="cx"> my $getterWithoutAttributes = $getterContentHead =~ /\($|, $/ ? "ec" : ", ec";
</span><del>- if ($attribute->signature->isNullable) {
- $getterContent .= $getterWithoutAttributes ? "isNull" : ", isNull";
- $getterWithoutAttributes = 0;
- }
</del><span class="cx"> if ($hasGetterException) {
</span><span class="cx"> $getterContent .= $getterWithoutAttributes ? "ec" : ", ec";
</span><span class="cx"> }
</span><span class="lines">@@ -1383,11 +1382,6 @@
</span><span class="cx"> push(@implContent, " $jsContextSetter\n");
</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->signature->isNullable) {
- push(@implContents, " $nullableInit\n");
- }
-
</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->nullableDoubleAttribute(isNull);
</del><ins>+ gdouble result = item->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->nullableLongAttribute(isNull);
</del><ins>+ glong result = item->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->nullableBooleanAttribute(isNull);
</del><ins>+ gboolean result = item->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->nullableStringAttribute(isNull));
</del><ins>+ gchar* result = convertToUTF8String(item->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->nullableLongSettableAttribute(isNull);
</del><ins>+ glong result = item->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->nullableStringValue(isNull, ec);
</del><ins>+ glong result = item->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("WEBKIT_DOM"), 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<WebCore::TestNode> gobjectResult = WTF::getPtr(item->putForwardsNullableAttribute(isNull));
</del><ins>+ RefPtr<WebCore::TestNode> gobjectResult = WTF::getPtr(item->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, "TestObj", "nullableDoubleAttribute");
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "nullableDoubleAttribute");
</span><span class="cx"> }
</span><del>- bool isNull = false;
</del><span class="cx"> auto& impl = castedThis->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, "TestObj", "nullableLongAttribute");
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "nullableLongAttribute");
</span><span class="cx"> }
</span><del>- bool isNull = false;
</del><span class="cx"> auto& impl = castedThis->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, "TestObj", "nullableBooleanAttribute");
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "nullableBooleanAttribute");
</span><span class="cx"> }
</span><del>- bool isNull = false;
</del><span class="cx"> auto& impl = castedThis->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, "TestObj", "nullableStringAttribute");
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "nullableStringAttribute");
</span><span class="cx"> }
</span><del>- bool isNull = false;
</del><span class="cx"> auto& impl = castedThis->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, "TestObj", "nullableLongSettableAttribute");
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "nullableLongSettableAttribute");
</span><span class="cx"> }
</span><del>- bool isNull = false;
</del><span class="cx"> auto& impl = castedThis->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, "TestObj", "nullableStringValue");
</span><span class="cx"> }
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- bool isNull = false;
</del><span class="cx"> auto& impl = castedThis->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->nullableDoubleAttribute(isNull);
</del><ins>+ return IMPL->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->nullableLongAttribute(isNull);
</del><ins>+ return IMPL->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->nullableBooleanAttribute(isNull);
</del><ins>+ return IMPL->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->nullableStringAttribute(isNull);
</del><ins>+ return IMPL->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->nullableLongSettableAttribute(isNull);
</del><ins>+ return IMPL->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->nullableStringValue(isNull, ec);
</del><ins>+ int result = IMPL->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->putForwardsNullableAttribute(isNull)));
</del><ins>+ return kit(WTF::getPtr(IMPL->putForwardsNullableAttribute()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)voidMethod
</span></span></pre>
</div>
</div>
</body>
</html>