WebCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2003 23:27:33 +0000 (23:27 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2003 23:27:33 +0000 (23:27 +0000)
commit5f94bfb3f4ec5b79097f2160c4a2512b6f54d270
tree41d4b75c7722cef5e5ea7e6b6183e661f0558a17
parentd637b3958d9057aac9c2ed171aaf3b13c6a39ac7
WebCore:

        Reviewed by Ken.

WebCore part of fix for:

<rdar://problem/3487134>: Implement http request/response status and headers for XMLHttpRequest

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty): Call appropriate methods for
status and statusText.
        (KJS::XMLHttpRequest::send): Set request headers as "customHeaders"
metadata property.
        (KJS::XMLHttpRequest::setRequestHeader): Simply append to header
string.
        (KJS::XMLHttpRequest::getAllResponseHeaders): Return the header string
except for the first line.
(KJS::XMLHttpRequest::getResponseHeader): Scan the response header
string for the header field. Not sure if it's worth being more
efficient.
        (KJS::XMLHttpRequest::getStatus): Try to pull a code out
of the status line.
        (KJS::XMLHttpRequest::getStatusText): Pull the first line
off the headers (if any), otherwise return undefined.
        (KJS::XMLHttpRequest::slotData): The first time through, save
the response headers, retrieved from "HTTP-Headers" metadata
property.
        (KJS::XMLHttpRequestProtoFunc::tryCall): Make setRequestHeader,
getResponseHeader, getAllResponseHeaders call the right thing.
        * khtml/ecma/xmlhttprequest.h:
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate): Added header
support.
        (KIO::TransferJobPrivate::~TransferJobPrivate):
        (KIO::TransferJob::assembleResponseHeaders): Get a header string
out of the response if needed.
        (KIO::TransferJob::queryMetaData): Special-case "HTTP-Headers".
        (KIO::TransferJob::emitReceivedResponse): Save response.
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (-[NSDictionary _webcore_initWithHeaderString:]): Helper method to
turn a string of header fields into a dictionary.
        (KWQServeRequest): Pass custom headers through.
        (KWQResponseMIMEType): Admit it's an NSURLResponse *.
        (KWQResponseHeaderString): Assembled status code and response
header fields into response header. Cheat a little on the status
line.
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader receivedResponse:]): Admit it's an
NSURLResponse *.
        * kwq/WebCoreResourceLoader.h: Ditto.
* kwq/WebCoreBridge.h: Add customHeader: arguments.

WebKit:

        Reviewed by Ken.

WebKit part of fix for:

<rdar://problem/3487134>: Implement http request/response status and headers for XMLHttpRequest

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge startLoadingResource:withURL:customHeaders:]): Added customHeaders
parameter.
        (-[WebBridge startLoadingResource:withURL:customHeaders:postData:]): Ditto.
        * WebCoreSupport.subproj/WebSubresourceClient.h:
        * WebCoreSupport.subproj/WebSubresourceClient.m:
        (+[WebSubresourceClient startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): Add the custom headers.
        (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:referrer:forDataSource:]): Pass along the custom headers.
        (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:postData:referrer:forDataSource:]): Pass along the custom headers.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@5625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/khtml/ecma/xmlhttprequest.cpp
WebCore/khtml/ecma/xmlhttprequest.h
WebCore/kwq/KWQKJobClasses.h
WebCore/kwq/KWQKJobClasses.mm
WebCore/kwq/KWQLoader.h
WebCore/kwq/KWQLoader.mm
WebCore/kwq/KWQResourceLoader.mm
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreResourceLoader.h
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m