[Cocoa] WebData has a generic wrapper
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Dec 2013 05:23:29 +0000 (05:23 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Dec 2013 05:23:29 +0000 (05:23 +0000)
commit9da6f2e6045e8c3237edf2550adbd3f5369eafcc
tree352a8b5831c176776a095527f22069653c0d8836
parent026b25fd10be8fb397c68d24cd7c84d5e5e41196
[Cocoa] WebData has a generic wrapper
https://bugs.webkit.org/show_bug.cgi?id=125402

Reviewed by Sam Weinig.

Added WKNSData, an NSData subclass that confroms to WKObject and wraps a WebData.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Allocate a WKNSData if the API::Object is data.
* Shared/Cocoa/WKNSData.h: Added.
(WebKit::wrapper): Added. Returns a WebData’s wrapper as an NSData.
* Shared/Cocoa/WKNSData.mm: Added.
(-[WKNSData dealloc]): Calls the WebData destructor.
(-[WKNSData length]): Added.
(-[WKNSData bytes]): Added.
(-[WKNSData copyWithZone:]): Retains self.
(-[WKNSData _apiObject]): Returns the wrapped WebData.
* WebKit2.xcodeproj/project.pbxproj: Added references to new files.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Cocoa/APIObject.mm
Source/WebKit2/Shared/Cocoa/WKNSData.h [new file with mode: 0644]
Source/WebKit2/Shared/Cocoa/WKNSData.mm [new file with mode: 0644]
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj