Bug 134454 - Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
Summary: Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-06-30 14:02 PDT by Pratik Solanki
Modified: 2014-07-01 17:58 PDT (History)
6 users (show)

See Also:


Attachments
Patch (231.85 KB, patch)
2014-06-30 14:12 PDT, Pratik Solanki
no flags Details | Formatted Diff | Diff
Patch (231.84 KB, patch)
2014-07-01 09:54 PDT, Pratik Solanki
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Solanki 2014-06-30 14:02:55 PDT
We current encode/decode NSURLRequest to send over the wire. We can just use CFURLRequestRef on iOS.
Comment 1 Pratik Solanki 2014-06-30 14:05:37 PDT
<rdar://problem/17510980>
Comment 2 Pratik Solanki 2014-06-30 14:12:24 PDT
Created attachment 234092 [details]
Patch
Comment 3 Sam Weinig 2014-06-30 16:27:05 PDT
Comment on attachment 234092 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=234092&action=review

> Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm:64
> +        CFURLRequestSetHTTPRequestBody((CFMutableURLRequestRef)(requestToSerialize.get()), nil);
> +        CFURLRequestSetHTTPRequestBodyStream((CFMutableURLRequestRef)(requestToSerialize.get()), nil);

These casts scare me.  Can we at least use the checked_cf_cast?
Comment 4 Pratik Solanki 2014-07-01 09:49:58 PDT
Comment on attachment 234092 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=234092&action=review

>> Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm:64
>> +        CFURLRequestSetHTTPRequestBodyStream((CFMutableURLRequestRef)(requestToSerialize.get()), nil);
> 
> These casts scare me.  Can we at least use the checked_cf_cast?

I resorted to plain old cast since static_cast didn't work and it seems dilemma I would have to combine it with const_cast. The NSURLRequest version of the code used C casts so I just used that. I didn't know about checked_cf_cast! I tried that but that also ran into const issues. Likely would have to use another const_cast along with it. I am going to try something different instead. New patch coming up.
Comment 5 Pratik Solanki 2014-07-01 09:54:31 PDT
Created attachment 234168 [details]
Patch
Comment 6 Andreas Kling 2014-07-01 13:03:38 PDT
Comment on attachment 234168 [details]
Patch

OK! r=me
Comment 7 Pratik Solanki 2014-07-01 17:58:23 PDT
Committed r170685: <http://trac.webkit.org/changeset/170685>