| Summary: | Add a version of API::Data::createWithoutCopying that takes an NSData | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||||
| Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | joepeck | ||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Anders Carlsson
2014-11-19 15:47:14 PST
Created attachment 241898 [details]
Patch
Created attachment 241900 [details]
Patch
Comment on attachment 241900 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241900&action=review > Source/WebKit2/Shared/Cocoa/APIDataCocoa.mm:32 > +PassRefPtr<Data> Data::createWithoutCopying(RetainPtr<NSData> data) > +{ I think you should first check if data is a WKNSData and if so unwrap it :-| Committed r176362: <http://trac.webkit.org/changeset/176362> Comment on attachment 241900 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241900&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm:245 > [data retain]; > - apiData = API::Data::createWithoutCopying((const unsigned char*)[data bytes], [data length], releaseNSData, data); > + apiData = API::Data::createWithoutCopying(data); Given that the createWithoutCopying now takes a RetainPtr<NSData> and leakRef's its contents, is the [data retain] line here necessary? It seems this would be an unbalanced +1. |