[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 12:27:34 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ce533ed3c16f07d522d6ec00e0a44e8f50e854f2
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 24 03:25:48 2010 +0000
2010-08-23 Patrick Gansterer <paroga at paroga.com>
Reviewed by Adam Roben.
Set the ResourceResponse HTTP headers in RessourceHandleWin
https://bugs.webkit.org/show_bug.cgi?id=44444
* platform/network/win/ResourceHandleWin.cpp:
(WebCore::queryHTTPHeader):
(WebCore::ResourceHandle::onRequestComplete):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 98fcbbb..e25dbef 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,17 @@
Reviewed by Adam Roben.
+ Set the ResourceResponse HTTP headers in RessourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=44444
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::queryHTTPHeader):
+ (WebCore::ResourceHandle::onRequestComplete):
+
+2010-08-23 Patrick Gansterer <paroga at paroga.com>
+
+ Reviewed by Adam Roben.
+
Support all available biBitCount values in BitmapInfo
https://bugs.webkit.org/show_bug.cgi?id=43724
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 5cc42b1..a81abd7 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -64,6 +64,20 @@ static const ResourceHandleEventHandler messageHandlers[] = {
&ResourceHandle::onRequestComplete
};
+static String queryHTTPHeader(HINTERNET requestHandle, DWORD infoLevel)
+{
+ DWORD bufferSize = 0;
+ HttpQueryInfoW(requestHandle, infoLevel, 0, &bufferSize, 0);
+
+ Vector<UChar> characters(bufferSize / sizeof(UChar));
+
+ if (!HttpQueryInfoW(requestHandle, infoLevel, characters.data(), &bufferSize, 0))
+ return String();
+
+ characters.removeLast(); // Remove NullTermination.
+ return String::adopt(characters);
+}
+
static int addToOutstandingJobs(ResourceHandle* job)
{
if (!jobIdMap)
@@ -226,7 +240,6 @@ void ResourceHandle::onRequestComplete(LPARAM lParam)
}
HINTERNET handle = (request().httpMethod() == "POST") ? d->m_secondaryHandle : d->m_resourceHandle;
- BOOL ok = FALSE;
static const int bufferSize = 32768;
char buffer[bufferSize];
@@ -235,11 +248,31 @@ void ResourceHandle::onRequestComplete(LPARAM lParam)
buffers.lpvBuffer = buffer;
buffers.dwBufferLength = bufferSize;
- bool receivedAnyData = false;
+ BOOL ok = FALSE;
while ((ok = InternetReadFileExA(handle, &buffers, IRF_NO_WAIT, (DWORD_PTR)this)) && buffers.dwBufferLength) {
if (!hasReceivedResponse()) {
setHasReceivedResponse();
ResourceResponse response;
+ response.setURL(firstRequest().url());
+
+ String httpStatusText = queryHTTPHeader(d->m_requestHandle, HTTP_QUERY_STATUS_TEXT);
+ if (!httpStatusText.isNull())
+ response.setHTTPStatusText(httpStatusText);
+
+ String httpStatusCode = queryHTTPHeader(d->m_requestHandle, HTTP_QUERY_STATUS_CODE);
+ if (!httpStatusCode.isNull())
+ response.setHTTPStatusCode(httpStatusCode.toInt());
+
+ String httpContentLength = queryHTTPHeader(d->m_requestHandle, HTTP_QUERY_CONTENT_LENGTH);
+ if (!httpContentLength.isNull())
+ response.setExpectedContentLength(httpContentLength.toInt());
+
+ String httpContentType = queryHTTPHeader(d->m_requestHandle, HTTP_QUERY_CONTENT_TYPE);
+ if (!httpContentType.isNull()) {
+ response.setMimeType(extractMIMETypeFromMediaType(httpContentType));
+ response.setTextEncodingName(extractCharsetFromMediaType(httpContentType));
+ }
+
client()->didReceiveResponse(this, response);
}
client()->didReceiveData(this, buffer, buffers.dwBufferLength, 0);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list