<!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>[204614] trunk</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/204614">204614</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2016-08-18 16:11:05 -0700 (Thu, 18 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Cocoa] API::Number needs to be wrapped by an NSNumber
https://bugs.webkit.org/show_bug.cgi?id=160977
<rdar://problem/27877735>
Reviewed by Anders Carlsson.
Source/WebKit2:
We introduce a single WKNSNumber class to wrap three distinct API::Number instantiations
corresponding to the Boolean, UInt64 and Double types.
Test: TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Create a WKNSNumber to contain any of the number types, and set
its _type ivar accordingly.
* Shared/Cocoa/WKNSNumber.h: Added.
(WebKit::wrapper):
* Shared/Cocoa/WKNSNumber.mm: Added.
(-[WKNSNumber dealloc]): Call the appropriate destructor.
(-[WKNSNumber objCType]): Implement this NSValue primitive method.
(-[WKNSNumber getValue:]): Ditto.
(-[WKNSNumber boolValue]): Implement this NSNumber method corresponding to one of our
possible types.
(-[WKNSNumber doubleValue]): Ditto.
(-[WKNSNumber unsignedLongLongValue]): Ditto.
(-[WKNSNumber copyWithZone:]): Implement this NSCopying method by retaining self.
(-[WKNSNumber _apiObject]): Implement this WKObject method by returning the appropriate
API object.
* WebKit2.xcodeproj/project.pbxproj: Added references to new files.
Tools:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm: Added.
(TestWebKitAPI::TEST):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedCocoaAPIObjectmm">trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedCocoaWKNSNumberh">trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.h</a></li>
<li><a href="#trunkSourceWebKit2SharedCocoaWKNSNumbermm">trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaWKNSNumbermm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (204613 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-08-18 23:03:47 UTC (rev 204613)
+++ trunk/Source/WebKit2/ChangeLog        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-08-18 Dan Bernstein <mitz@apple.com>
+
+ [Cocoa] API::Number needs to be wrapped by an NSNumber
+ https://bugs.webkit.org/show_bug.cgi?id=160977
+ <rdar://problem/27877735>
+
+ Reviewed by Anders Carlsson.
+
+ We introduce a single WKNSNumber class to wrap three distinct API::Number instantiations
+ corresponding to the Boolean, UInt64 and Double types.
+
+ Test: TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm
+
+ * Shared/Cocoa/APIObject.mm:
+ (API::Object::newObject): Create a WKNSNumber to contain any of the number types, and set
+ its _type ivar accordingly.
+ * Shared/Cocoa/WKNSNumber.h: Added.
+ (WebKit::wrapper):
+ * Shared/Cocoa/WKNSNumber.mm: Added.
+ (-[WKNSNumber dealloc]): Call the appropriate destructor.
+ (-[WKNSNumber objCType]): Implement this NSValue primitive method.
+ (-[WKNSNumber getValue:]): Ditto.
+ (-[WKNSNumber boolValue]): Implement this NSNumber method corresponding to one of our
+ possible types.
+ (-[WKNSNumber doubleValue]): Ditto.
+ (-[WKNSNumber unsignedLongLongValue]): Ditto.
+ (-[WKNSNumber copyWithZone:]): Implement this NSCopying method by retaining self.
+ (-[WKNSNumber _apiObject]): Implement this WKObject method by returning the appropriate
+ API object.
+
+ * WebKit2.xcodeproj/project.pbxproj: Added references to new files.
+
</ins><span class="cx"> 2016-08-18 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> [Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedCocoaAPIObjectmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm (204613 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm        2016-08-18 23:03:47 UTC (rev 204613)
+++ trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #import "WKNSData.h"
</span><span class="cx"> #import "WKNSDictionary.h"
</span><span class="cx"> #import "WKNSError.h"
</span><ins>+#import "WKNSNumber.h"
</ins><span class="cx"> #import "WKNSString.h"
</span><span class="cx"> #import "WKNSURL.h"
</span><span class="cx"> #import "WKNSURLAuthenticationChallenge.h"
</span><span class="lines">@@ -116,6 +117,13 @@
</span><span class="cx"> wrapper = [WKBackForwardListItem alloc];
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case Type::Boolean:
+ case Type::Double:
+ case Type::UInt64:
+ wrapper = [WKNSNumber alloc];
+ ((WKNSNumber *)wrapper)->_type = type;
+ break;
+
</ins><span class="cx"> case Type::Bundle:
</span><span class="cx"> wrapper = [WKWebProcessPlugInController alloc];
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedCocoaWKNSNumberh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.h (0 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.h         (rev 0)
+++ trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.h        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WKFoundation.h"
+
+#if WK_API_ENABLED
+
+#import "APINumber.h"
+#import "WKObject.h"
+
+namespace WebKit {
+template<typename NumberType, API::Object::Type APIObjectType>
+inline NSNumber *wrapper(API::Number<NumberType, APIObjectType>& number) { ASSERT([number.wrapper() isKindOfClass:[NSNumber class]]); return (NSNumber *)number.wrapper(); }
+}
+
+@interface WKNSNumber : NSNumber <WKObject> {
+@package
+ API::Object::Type _type;
+}
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedCocoaWKNSNumbermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.mm (0 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.mm         (rev 0)
+++ trunk/Source/WebKit2/Shared/Cocoa/WKNSNumber.mm        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -0,0 +1,166 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKNSNumber.h"
+
+#if WK_API_ENABLED
+
+using namespace WebKit;
+
+@implementation WKNSNumber {
+ union {
+ API::ObjectStorage<API::Boolean> _boolean;
+ API::ObjectStorage<API::Double> _double;
+ API::ObjectStorage<API::UInt64> _uint64;
+ } _number;
+}
+
+- (void)dealloc
+{
+ switch (_type) {
+ case API::Object::Type::Boolean:
+ _number._boolean->~Number<bool, API::Object::Type::Boolean>();
+ break;
+
+ case API::Object::Type::Double:
+ _number._double->~Number<double, API::Object::Type::Double>();
+ break;
+
+ case API::Object::Type::UInt64:
+ _number._uint64->~Number<uint64_t, API::Object::Type::UInt64>();
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ [super dealloc];
+}
+
+// MARK: NSValue primitive methods
+
+- (const char *)objCType
+{
+ switch (_type) {
+ case API::Object::Type::Boolean:
+ return @encode(bool);
+ break;
+
+ case API::Object::Type::Double:
+ return @encode(double);
+ break;
+
+ case API::Object::Type::UInt64:
+ return @encode(uint64_t);
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ return nullptr;
+}
+
+- (void)getValue:(void *)value
+{
+ switch (_type) {
+ case API::Object::Type::Boolean:
+ *reinterpret_cast<bool*>(value) = _number._boolean->value();
+ break;
+
+ case API::Object::Type::Double:
+ *reinterpret_cast<double*>(value) = _number._double->value();
+ break;
+
+ case API::Object::Type::UInt64:
+ *reinterpret_cast<uint64_t*>(value) = _number._uint64->value();
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+}
+
+// MARK: NSNumber primitive methods
+
+- (BOOL)boolValue
+{
+ if (_type == API::Object::Type::Boolean)
+ return _number._boolean->value();
+
+ return super.boolValue;
+}
+
+- (double)doubleValue
+{
+ if (_type == API::Object::Type::Double)
+ return _number._double->value();
+
+ return super.doubleValue;
+}
+
+- (unsigned long long)unsignedLongLongValue
+{
+ if (_type == API::Object::Type::UInt64)
+ return _number._uint64->value();
+
+ return super.unsignedLongLongValue;
+}
+
+// MARK: NSCopying protocol implementation
+
+- (id)copyWithZone:(NSZone *)zone
+{
+ return [self retain];
+}
+
+// MARK: WKObject protocol implementation
+
+- (API::Object&)_apiObject
+{
+ switch (_type) {
+ case API::Object::Type::Boolean:
+ return *_number._boolean;
+ break;
+
+ case API::Object::Type::Double:
+ return *_number._double;
+ break;
+
+ case API::Object::Type::UInt64:
+ return *_number._uint64;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ return *_number._boolean;
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (204613 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-08-18 23:03:47 UTC (rev 204613)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -792,6 +792,8 @@
</span><span class="cx">                 3743925818BC4C60001C8675 /* WKUIDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3743925718BC4C60001C8675 /* WKUIDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 374436881820E7240049579F /* WKObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 374436871820E7240049579F /* WKObject.mm */; };
</span><span class="cx">                 3754D5451B3A29FD003A4C7F /* NSInvocationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */; };
</span><ins>+                375E0E131D66432700EFEC2C /* WKNSNumber.mm in Sources */ = {isa = PBXBuildFile; fileRef = 375E0E111D66432700EFEC2C /* WKNSNumber.mm */; };
+                375E0E141D66432700EFEC2C /* WKNSNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 375E0E121D66432700EFEC2C /* WKNSNumber.h */; };
</ins><span class="cx">                 3760881E150413E900FC82C7 /* WebRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3760881C150413E900FC82C7 /* WebRenderObject.cpp */; };
</span><span class="cx">                 3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760881D150413E900FC82C7 /* WebRenderObject.h */; };
</span><span class="cx">                 37608822150414F700FC82C7 /* WKRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37608820150414F700FC82C7 /* WKRenderObject.cpp */; };
</span><span class="lines">@@ -2836,6 +2838,8 @@
</span><span class="cx">                 3743925718BC4C60001C8675 /* WKUIDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUIDelegatePrivate.h; sourceTree = "<group>"; };
</span><span class="cx">                 374436871820E7240049579F /* WKObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKObject.mm; sourceTree = "<group>"; };
</span><span class="cx">                 3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSInvocationSPI.h; sourceTree = "<group>"; };
</span><ins>+                375E0E111D66432700EFEC2C /* WKNSNumber.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNSNumber.mm; sourceTree = "<group>"; };
+                375E0E121D66432700EFEC2C /* WKNSNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNSNumber.h; sourceTree = "<group>"; };
</ins><span class="cx">                 375FB4731883415600BE34D4 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
</span><span class="cx">                 3760881C150413E900FC82C7 /* WebRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebRenderObject.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 3760881D150413E900FC82C7 /* WebRenderObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderObject.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -5301,6 +5305,8 @@
</span><span class="cx">                                 371A193F1824D29300F32A5E /* WKNSDictionary.mm */,
</span><span class="cx">                                 372CAF091833FD910040AC27 /* WKNSError.h */,
</span><span class="cx">                                 372CAF0A1833FD910040AC27 /* WKNSError.mm */,
</span><ins>+                                375E0E121D66432700EFEC2C /* WKNSNumber.h */,
+                                375E0E111D66432700EFEC2C /* WKNSNumber.mm */,
</ins><span class="cx">                                 378E1A4818208CD60031007A /* WKNSString.h */,
</span><span class="cx">                                 378E1A4718208CD60031007A /* WKNSString.mm */,
</span><span class="cx">                                 378E1A4C18208D700031007A /* WKNSURL.h */,
</span><span class="lines">@@ -7827,6 +7833,7 @@
</span><span class="cx">                                 1A60224D18C16B9F00C3E8C9 /* VisitedLinkStoreMessages.h in Headers */,
</span><span class="cx">                                 37B47E2D1D64DB76005F4EFF /* objcSPI.h in Headers */,
</span><span class="cx">                                 1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */,
</span><ins>+                                375E0E141D66432700EFEC2C /* WKNSNumber.h in Headers */,
</ins><span class="cx">                                 1AF4CEF018BC481800BC2D34 /* VisitedLinkTableController.h in Headers */,
</span><span class="cx">                                 1A8E7D3D18C15149005A702A /* VisitedLinkTableControllerMessages.h in Headers */,
</span><span class="cx">                                 1AA9BAE1184FFAC7003B6BC6 /* WeakObjCPtr.h in Headers */,
</span><span class="lines">@@ -9140,6 +9147,7 @@
</span><span class="cx">                                 831EEBBE1BD85C4300BB64C3 /* NetworkCacheSpeculativeLoad.cpp in Sources */,
</span><span class="cx">                                 832AE2531BE2E8CD00FAAE10 /* NetworkCacheSpeculativeLoadManager.cpp in Sources */,
</span><span class="cx">                                 83BDCCB91AC5FDB6003F6441 /* NetworkCacheStatistics.cpp in Sources */,
</span><ins>+                                375E0E131D66432700EFEC2C /* WKNSNumber.mm in Sources */,
</ins><span class="cx">                                 E4436ED01A0D040B00EAD204 /* NetworkCacheStorage.cpp in Sources */,
</span><span class="cx">                                 8310428C1BD6B66F00A715E4 /* NetworkCacheSubresourcesEntry.cpp in Sources */,
</span><span class="cx">                                 513A164C1630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (204613 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-08-18 23:03:47 UTC (rev 204613)
+++ trunk/Tools/ChangeLog        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-08-18 Dan Bernstein <mitz@apple.com>
+
+ [Cocoa] API::Number needs to be wrapped by an NSNumber
+ https://bugs.webkit.org/show_bug.cgi?id=160977
+ <rdar://problem/27877735>
+
+ Reviewed by Anders Carlsson.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm: Added.
+ (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2016-08-17 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> [Cocoa] Migrate off of deprecated CoreGraphics API CGContextSelectFont() and CGContextShowTextAtPoint()
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (204613 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-08-18 23:03:47 UTC (rev 204613)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx">                 33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 33DC890E1419539300747EF7 /* simple-iframe.html */; };
</span><span class="cx">                 33DC89141419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */; };
</span><span class="cx">                 33E79E06137B5FD900E32D99 /* mouse-move-listener.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */; };
</span><ins>+                375E0E171D66674400EFEC2C /* WKNSNumber.mm in Sources */ = {isa = PBXBuildFile; fileRef = 375E0E151D66674400EFEC2C /* WKNSNumber.mm */; };
</ins><span class="cx">                 378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */; };
</span><span class="cx">                 378E64791632707400B6C676 /* link-with-title.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 378E647816326FDF00B6C676 /* link-with-title.html */; };
</span><span class="cx">                 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */; };
</span><span class="lines">@@ -743,6 +744,7 @@
</span><span class="cx">                 33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "mouse-move-listener.html"; sourceTree = "<group>"; };
</span><span class="cx">                 3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMRange.mm; sourceTree = "<group>"; };
</span><span class="cx">                 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMNodeFromJSObject.mm; sourceTree = "<group>"; };
</span><ins>+                375E0E151D66674400EFEC2C /* WKNSNumber.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNSNumber.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceScaleFactorInDashboardRegions.mm; sourceTree = "<group>"; };
</span><span class="cx">                 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest_Bundle.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -1299,6 +1301,7 @@
</span><span class="cx">                                 93E943F11CD3E87E00AC08C2 /* VideoControlsManager.mm */,
</span><span class="cx">                                 51714EB61CF8C7A4004723C4 /* WebProcessKillIDBCleanup.mm */,
</span><span class="cx">                                 1F83571A1D3FFB0E00E3967B /* WKBackForwardList.mm */,
</span><ins>+                                375E0E151D66674400EFEC2C /* WKNSNumber.mm */,
</ins><span class="cx">                                 37B47E2E1D64E7CA005F4EFF /* WKObject.mm */,
</span><span class="cx">                                 2D00065D1C1F58940088E6A7 /* WKPDFViewResizeCrash.mm */,
</span><span class="cx">                                 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */,
</span><span class="lines">@@ -2211,6 +2214,7 @@
</span><span class="cx">                                 7CCE7EF11A411AE600447C4C /* FailedLoad.cpp in Sources */,
</span><span class="cx">                                 7C83E04F1D0A641800FEBCF3 /* FileSystem.cpp in Sources */,
</span><span class="cx">                                 7CCE7EF31A411AE600447C4C /* Find.cpp in Sources */,
</span><ins>+                                375E0E171D66674400EFEC2C /* WKNSNumber.mm in Sources */,
</ins><span class="cx">                                 7C83E0BB1D0A650000FEBCF3 /* FindInPage.mm in Sources */,
</span><span class="cx">                                 7CCE7EF41A411AE600447C4C /* FindMatches.mm in Sources */,
</span><span class="cx">                                 7C83E0401D0A63E300FEBCF3 /* FirstResponderScrollingPosition.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaWKNSNumbermm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm (0 => 204614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm         (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm        2016-08-18 23:11:05 UTC (rev 204614)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#import <WebKit/WKFoundation.h>
+
+#if WK_API_ENABLED && WK_HAVE_C_SPI
+
+#import <WebKit/WKNumber.h>
+#import <WebKit/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+TEST(WebKit2, WKNSNumber)
+{
+ auto booleanRef = adoptWK(WKBooleanCreate(true));
+ auto uint64Ref = adoptWK(WKUInt64Create(39));
+ auto doubleRef = adoptWK(WKDoubleCreate(-16.2));
+
+ NSNumber *booleanNumber = (NSNumber *)booleanRef.get();
+ NSNumber *uint64Number = (NSNumber *)uint64Ref.get();
+ NSNumber *doubleNumber = (NSNumber *)doubleRef.get();
+
+ EXPECT_EQ(YES, booleanNumber.boolValue);
+ EXPECT_EQ(39UL, uint64Number.unsignedLongLongValue);
+ EXPECT_EQ(39, uint64Number.intValue);
+ EXPECT_EQ(-16.2, doubleNumber.doubleValue);
+}
+
+} // namespace TestWebKitAPI
+
+#endif
</ins></span></pre>
</div>
</div>
</body>
</html>