Bug 134454

Summary: Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
Product: WebKit Reporter: Pratik Solanki <psolanki>
Component: WebKit2Assignee: Pratik Solanki <psolanki>
Status: RESOLVED FIXED    
Severity: Normal CC: bunhere, cdumez, commit-queue, gyuyoung.kim, psolanki, sergio
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch kling: review+

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>