Bug 111034

Summary: ResourceRequestCFNet.cpp won't compile after r144216
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Page LoadingAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, beidson, jberlin, roger_fong, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 110900    
Bug Blocks:    
Attachments:
Description Flags
Patch v1
none
Patch v2 none

Description David Kilzer (:ddkilzer) 2013-02-27 20:42:39 PST
ResourceRequestCFNet.cpp won't compile on iOS (or probably Windows) after r144216 for Bug 110900.
<http://trac.webkit.org/changeset/144216>

There was also a bad typo ("Contemt-Length") in ResourceRequestCFNet.cpp.

I'm working on testing a fix now.
Comment 1 David Kilzer (:ddkilzer) 2013-02-27 20:47:24 PST
Here are the compiler errors generated:

Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:200:30: error: use of undeclared identifier 'nsRequest'
        WebCore::setHTTPBody(nsRequest, formData);
                             ^
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:202:95: error: use of undeclared identifier 'request'
    if (RetainPtr<CFReadStreamRef> bodyStream = adoptCF(CFURLRequestCopyHTTPRequestBodyStream(request))) {
                                                                                              ^
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:206:84: error: too many arguments provided to function-like macro invocation
            CFURLRequestSetHTTPHeaderFieldValue(cfRequest, CFSTR("Contemt-Length", lengthString.get()));
                                                                                   ^
In file included from Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:1:
In file included from Source/WebCore/WebCorePrefix.h:136:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:44:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h:11:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h:13:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h:149:9: note: macro 'CFSTR' defined here
#define CFSTR(cStr)  ((CFStringRef) __builtin___CFStringMakeConstantString ("" cStr ""))
        ^
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:206:60: error: use of undeclared identifier 'CFSTR'
            CFURLRequestSetHTTPHeaderFieldValue(cfRequest, CFSTR("Contemt-Length", lengthString.get()));
                                                           ^
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:287:100: error: use of undeclared identifier 'request'
    else if (RetainPtr<CFReadStreamRef> bodyStream = adoptCF(CFURLRequestCopyHTTPRequestBodyStream(request))) {
                                                                                                   ^
In file included from Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:29:
In file included from Source/WebCore/platform/network/ResourceHandle.h:37:
In file included from Source/WebCore/platform/network/ios/QuickLook.h:13:
In file included from Source/WebCore/platform/network/cf/ResourceRequest.h:32:
WebKitBuild/Release-iphoneos/usr/local/include/wtf/RetainPtr.h:129:11: error: cannot initialize a member subobject of type 'PtrType' (aka 'const __CFString *') with an rvalue of type 'PtrType' (aka 'const void *')
        : m_ptr(o.get())
          ^     ~~~~~~~
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:204:47: note: in instantiation of function template specialization 'WTF::RetainPtr<const __CFString *>::RetainPtr<const void *>' requested here
        RetainPtr<CFStringRef> lengthString = adoptCF(CFReadStreamCopyProperty(bodyStream.get(), formDataStreamLengthPropertyName()));
                                              ^
6 errors generated.
Comment 2 Alexey Proskuryakov 2013-02-27 20:54:05 PST
Sorry about this - the plan was to fix errors after landing, but we couldn't do it this afternoon.

> There was also a bad typo ("Contemt-Length") in ResourceRequestCFNet.cpp.

Oops!
Comment 3 Alexey Proskuryakov 2013-02-27 20:54:50 PST
(note that the patch is _still_ #92 on Windows EWS)
Comment 4 David Kilzer (:ddkilzer) 2013-02-27 21:27:47 PST
And some linker failures:

Undefined symbols for architecture armv7:
  "__ZN7WebCore15ResourceRequest39updateFromDelegatePreservingOldHTTPBodyERKS0_", referenced from:
     -exported_symbol[s_list] command line option
  "__ZNK7WebCore15ResourceRequest12cfURLRequestEv", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 5 David Kilzer (:ddkilzer) 2013-02-27 21:34:29 PST
I also don't see where this method is implemented:

+        void updateFromDelegatePreservingOldHTTPBody(CFURLRequestRef);

Although it doesn't appear to be used, so maybe that doesn't matter.
Comment 6 Alexey Proskuryakov 2013-02-27 21:39:49 PST
Yes, updateFromDelegatePreservingOldHTTPBody is only needed for WebKit2 (and in fact, its signature is now different, I should have removed it from CF part).
Comment 7 David Kilzer (:ddkilzer) 2013-02-27 21:42:14 PST
Created attachment 190648 [details]
Patch v1

Fixes the compiler and linker errors for iOS.
Comment 8 David Kilzer (:ddkilzer) 2013-02-27 21:52:09 PST
Comment on attachment 190648 [details]
Patch v1

I have a better patch with a ChangeLog.
Comment 9 David Kilzer (:ddkilzer) 2013-02-27 21:56:22 PST
Created attachment 190651 [details]
Patch v2
Comment 10 WebKit Review Bot 2013-02-28 01:41:17 PST
Comment on attachment 190651 [details]
Patch v2

Clearing flags on attachment: 190651

Committed r144278: <http://trac.webkit.org/changeset/144278>
Comment 11 WebKit Review Bot 2013-02-28 01:41:21 PST
All reviewed patches have been landed.  Closing bug.