[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

paroga at webkit.org paroga at webkit.org
Wed Dec 22 13:41:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fba5427d9a43ed6d5af321f50c3698e46bec7e2f
Author: paroga at webkit.org <paroga at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 23 15:39:22 2010 +0000

    2010-09-23  Patrick Gansterer  <paroga at webkit.org>
    
            Reviewed by Adam Roben.
    
            Add internetStatusCallback to ResourceHandleWin.
            https://bugs.webkit.org/show_bug.cgi?id=46187
    
            Add callback for asynchronous network transfer.
    
            * platform/network/ResourceHandle.h:
            * platform/network/ResourceHandleInternal.h:
            * platform/network/win/ResourceHandleWin.cpp:
            (WebCore::callOnRedirect):
            (WebCore::callOnRequestComplete):
            (WebCore::ResourceHandle::internetStatusCallback):
            (WebCore::ResourceHandle::onRedirect):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b4f1d9f..8f00923 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-23  Patrick Gansterer  <paroga at webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Add internetStatusCallback to ResourceHandleWin.
+        https://bugs.webkit.org/show_bug.cgi?id=46187
+
+        Add callback for asynchronous network transfer.
+
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceHandleInternal.h:
+        * platform/network/win/ResourceHandleWin.cpp:
+        (WebCore::callOnRedirect):
+        (WebCore::callOnRequestComplete):
+        (WebCore::ResourceHandle::internetStatusCallback):
+        (WebCore::ResourceHandle::onRedirect):
+
 2010-09-23  Andrei Popescu  <andreip at google.com>
 
         Reviewed by Jeremy Orlow.
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index 17d1472..7b28570 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -172,8 +172,9 @@ public:
     bool hasReceivedResponse() const;
     void fileLoadTimer(Timer<ResourceHandle>*);
     void onHandleCreated(LPARAM);
-    void onRequestRedirected(LPARAM);
+    void onRedirect();
     void onRequestComplete(LPARAM);
+    static void CALLBACK internetStatusCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
     friend void __stdcall transferJobStatusCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
     friend LRESULT __stdcall ResourceHandleWndProc(HWND, unsigned message, WPARAM, LPARAM);
 #endif
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index 1f2cff9..1424b50 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -175,6 +175,7 @@ namespace WebCore {
         String m_postReferrer;
         bool m_hasReceivedResponse;
         bool m_resend;
+        String m_redirectUrl;
 #endif
 #if USE(CURL)
         CURL* m_handle;
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 946a0f7..d99bd6d 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -278,15 +278,47 @@ void ResourceHandle::onHandleCreated(LPARAM lParam)
     }
 }
 
-void ResourceHandle::onRequestRedirected(LPARAM lParam)
+static void callOnRedirect(void* context)
 {
-    // If already canceled, then ignore this event.
-    if (d->status != 0)
-        return;
+    ResourceHandle* handle = static_cast<ResourceHandle*>(context);
+    handle->onRedirect();
+}
+
+static void callOnRequestComplete(void* context)
+{
+    ResourceHandle* handle = static_cast<ResourceHandle*>(context);
+    handle->onRequestComplete();
+}
+
+void ResourceHandle::internetStatusCallback(HINTERNET internetHandle, DWORD_PTR context, DWORD internetStatus,
+                                                     LPVOID statusInformation, DWORD statusInformationLength)
+{
+    ResourceHandle* handle = reinterpret_cast<ResourceHandle*>(context);
+
+    switch (internetStatus) {
+    case INTERNET_STATUS_REDIRECT:
+        handle->d->m_redirectUrl = String(static_cast<UChar*>(statusInformation), statusInformationLength);
+        callOnMainThread(callOnRedirect, handle);
+        break;
+
+    case INTERNET_STATUS_REQUEST_COMPLETE:
+        callOnMainThread(callOnRequestComplete, handle);
+        break;
+
+    default:
+        break;
+    }
+}
+
+void ResourceHandle::onRedirect()
+{
+    ResourceRequest newRequest = firstRequest();
+    newRequest.setURL(KURL(ParsedURLString, d->m_redirectUrl));
+
+    ResourceResponse response(firstRequest().url(), String(), 0, String(), String());
 
-    ResourceRequest request((StringImpl*) lParam);
-    ResourceResponse redirectResponse;
-    client()->willSendRequest(this, request, redirectResponse);
+    if (ResourceHandleClient* resourceHandleClient = client())
+        resourceHandleClient->willSendRequest(this, newRequest, response);
 }
 
 void ResourceHandle::onRequestComplete(LPARAM lParam)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list