[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:47:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c13f9293bf82f533b0542be25e0d1ffd70435bb0
Author: paroga at webkit.org <paroga at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 27 06:05:06 2010 +0000

    2010-09-26  Patrick Gansterer  <paroga at webkit.org>
    
            Reviewed by Adam Barth.
    
            Remove dead code and fix header includes in ResourceHandleWin
            https://bugs.webkit.org/show_bug.cgi?id=46479
    
            Also add missing member varibale from r68167.
    
            * platform/network/ResourceHandle.h:
            * platform/network/ResourceHandleInternal.h:
            (WebCore::ResourceHandleInternal::ResourceHandleInternal):
            * platform/network/win/ResourceHandleWin.cpp:
            (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
            (WebCore::ResourceHandle::~ResourceHandle):
            (WebCore::ResourceHandle::onRequestComplete):
            * platform/network/win/ResourceHandleWin.h: Removed.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68371 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4b83c22..6fa29d9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,24 @@
 
         Reviewed by Adam Barth.
 
+        Remove dead code and fix header includes in ResourceHandleWin
+        https://bugs.webkit.org/show_bug.cgi?id=46479
+
+        Also add missing member varibale from r68167.
+
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceHandleInternal.h:
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        * platform/network/win/ResourceHandleWin.cpp:
+        (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
+        (WebCore::ResourceHandle::~ResourceHandle):
+        (WebCore::ResourceHandle::onRequestComplete):
+        * platform/network/win/ResourceHandleWin.h: Removed.
+
+2010-09-26  Patrick Gansterer  <paroga at webkit.org>
+
+        Reviewed by Adam Barth.
+
         Add WTF::StringHasher::createBlobHash
         https://bugs.webkit.org/show_bug.cgi?id=46514
 
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index ebb1ddb..65033bd 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -46,11 +46,6 @@ typedef unsigned long DWORD;
 typedef unsigned long DWORD_PTR;
 typedef void* LPVOID;
 typedef LPVOID HINTERNET;
-typedef unsigned WPARAM;
-typedef long LPARAM;
-typedef struct HWND__* HWND;
-typedef _W64 long LONG_PTR;
-typedef LONG_PTR LRESULT;
 #endif
 
 
@@ -170,12 +165,9 @@ public:
 #if USE(WININET)
     void setSynchronousInternetHandle(HINTERNET);
     void fileLoadTimer(Timer<ResourceHandle>*);
-    void onHandleCreated(LPARAM);
     void onRedirect();
     bool onRequestComplete();
     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
 
 #if PLATFORM(QT) || USE(CURL) || USE(SOUP) || PLATFORM(ANDROID)
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index 70a21b3..96fbf00 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -92,17 +92,13 @@ namespace WebCore {
 #endif
 #if USE(WININET)
             , m_fileLoadTimer(loader, &ResourceHandle::fileLoadTimer)
-            , m_resourceHandle(0)
-            , m_secondaryHandle(0)
-            , m_jobId(0)
-            , m_threadId(0)
             , m_internetHandle(0)
             , m_connectHandle(0)
             , m_requestHandle(0)
             , m_sentEndRequest(false)
             , m_bytesRemainingToWrite(0)
+            , m_loadSynchronously(false)
             , m_hasReceivedResponse(false)
-            , m_resend(false)
 #endif
 #if USE(CURL)
             , m_handle(0)
@@ -168,19 +164,14 @@ namespace WebCore {
 #endif
 #if USE(WININET)
         Timer<ResourceHandle> m_fileLoadTimer;
-        HINTERNET m_resourceHandle;
-        HINTERNET m_secondaryHandle;
-        unsigned m_jobId;
-        DWORD m_threadId;
         HINTERNET m_internetHandle;
         HINTERNET m_connectHandle;
         HINTERNET m_requestHandle;
         bool m_sentEndRequest;
         Vector<char> m_formData;
-        int m_bytesRemainingToWrite;
-        String m_postReferrer;
+        size_t m_bytesRemainingToWrite;
+        bool m_loadSynchronously;
         bool m_hasReceivedResponse;
-        bool m_resend;
         String m_redirectUrl;
 #endif
 #if USE(CURL)
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index b908672..5de2e1b 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -27,44 +27,22 @@
 #include "config.h"
 #include "ResourceHandle.h"
 
-#include "CachedResourceLoader.h"
-#include "Document.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "Page.h"
+#include "HTTPParsers.h"
+#include "MIMETypeRegistry.h"
+#include "MainThread.h"
+#include "NotImplemented.h"
 #include "ResourceError.h"
 #include "ResourceHandleClient.h"
 #include "ResourceHandleInternal.h"
-#include "ResourceHandleWin.h"
+#include "SharedBuffer.h"
 #include "Timer.h"
-#include "WebCoreInstanceHandle.h"
-
+#include "UnusedParam.h"
 #include <wtf/text/CString.h>
 #include <windows.h>
 #include <wininet.h>
 
 namespace WebCore {
 
-static unsigned transferJobId = 0;
-static HashMap<int, ResourceHandle*>* jobIdMap = 0;
-
-static HWND transferJobWindowHandle = 0;
-const LPCWSTR kResourceHandleWindowClassName = L"ResourceHandleWindowClass";
-
-// Message types for internal use (keep in sync with kMessageHandlers)
-enum {
-  handleCreatedMessage = WM_USER,
-  requestRedirectedMessage,
-  requestCompleteMessage
-};
-
-typedef void (ResourceHandle:: *ResourceHandleEventHandler)(LPARAM);
-static const ResourceHandleEventHandler messageHandlers[] = {
-    &ResourceHandle::onHandleCreated,
-    &ResourceHandle::onRequestRedirected,
-    &ResourceHandle::onRequestComplete
-};
-
 static inline HINTERNET createInternetHandle(const String& userAgent, bool asynchronous)
 {
     String userAgentString = userAgent;
@@ -96,65 +74,6 @@ static String queryHTTPHeader(HINTERNET requestHandle, DWORD infoLevel)
     return String::adopt(characters);
 }
 
-static int addToOutstandingJobs(ResourceHandle* job)
-{
-    if (!jobIdMap)
-        jobIdMap = new HashMap<int, ResourceHandle*>;
-    transferJobId++;
-    jobIdMap->set(transferJobId, job);
-    return transferJobId;
-}
-
-static void removeFromOutstandingJobs(int jobId)
-{
-    if (!jobIdMap)
-        return;
-    jobIdMap->remove(jobId);
-}
-
-static ResourceHandle* lookupResourceHandle(int jobId)
-{
-    if (!jobIdMap)
-        return 0;
-    return jobIdMap->get(jobId);
-}
-
-static LRESULT CALLBACK ResourceHandleWndProc(HWND hWnd, UINT message,
-                                              WPARAM wParam, LPARAM lParam)
-{
-    if (message >= handleCreatedMessage) {
-        UINT index = message - handleCreatedMessage;
-        if (index < _countof(messageHandlers)) {
-            unsigned jobId = (unsigned) wParam;
-            ResourceHandle* job = lookupResourceHandle(jobId);
-            if (job) {
-                ASSERT(job->d->m_jobId == jobId);
-                ASSERT(job->d->m_threadId == GetCurrentThreadId());
-                (job->*(messageHandlers[index]))(lParam);
-            }
-            return 0;
-        }
-    }
-    return DefWindowProc(hWnd, message, wParam, lParam);
-}
-
-static void initializeOffScreenResourceHandleWindow()
-{
-    if (transferJobWindowHandle)
-        return;
-
-    WNDCLASSEX wcex;
-    memset(&wcex, 0, sizeof(WNDCLASSEX));
-    wcex.cbSize = sizeof(WNDCLASSEX);
-    wcex.lpfnWndProc    = ResourceHandleWndProc;
-    wcex.hInstance      = WebCore::instanceHandle();
-    wcex.lpszClassName  = kResourceHandleWindowClassName;
-    RegisterClassEx(&wcex);
-
-    transferJobWindowHandle = CreateWindow(kResourceHandleWindowClassName, 0, 0, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
-        HWND_MESSAGE, 0, WebCore::instanceHandle(), 0);
-}
-
 
 class WebCoreSynchronousLoader : public ResourceHandleClient, public Noncopyable {
 public:
@@ -210,72 +129,10 @@ void WebCoreSynchronousLoader::didFail(ResourceHandle*, const ResourceError& err
 
 ResourceHandleInternal::~ResourceHandleInternal()
 {
-    if (m_fileHandle != INVALID_HANDLE_VALUE)
-        CloseHandle(m_fileHandle);
 }
 
 ResourceHandle::~ResourceHandle()
 {
-    if (d->m_jobId)
-        removeFromOutstandingJobs(d->m_jobId);
-}
-
-void ResourceHandle::onHandleCreated(LPARAM lParam)
-{
-    if (!d->m_resourceHandle) {
-        d->m_resourceHandle = HINTERNET(lParam);
-        if (d->status != 0) {
-            // We were canceled before Windows actually created a handle for us, close and delete now.
-            InternetCloseHandle(d->m_resourceHandle);
-            delete this;
-            return;
-        }
-
-        if (request().httpMethod() == "POST") {
-            // FIXME: Too late to set referrer properly.
-            String urlStr = request().url().path();
-            int fragmentIndex = urlStr.find('#');
-            if (fragmentIndex != -1)
-                urlStr = urlStr.left(fragmentIndex);
-            static LPCSTR accept[2]={"*/*", NULL};
-            HINTERNET urlHandle = HttpOpenRequestA(d->m_resourceHandle, 
-                                                   "POST", urlStr.latin1().data(), 0, 0, accept,
-                                                   INTERNET_FLAG_KEEP_CONNECTION | 
-                                                   INTERNET_FLAG_FORMS_SUBMIT |
-                                                   INTERNET_FLAG_RELOAD |
-                                                   INTERNET_FLAG_NO_CACHE_WRITE |
-                                                   INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS |
-                                                   INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP,
-                                                   (DWORD_PTR)d->m_jobId);
-            if (urlHandle == INVALID_HANDLE_VALUE) {
-                InternetCloseHandle(d->m_resourceHandle);
-                delete this;
-            }
-        }
-    } else if (!d->m_secondaryHandle) {
-        assert(request().httpMethod() == "POST");
-        d->m_secondaryHandle = HINTERNET(lParam);
-        
-        // Need to actually send the request now.
-        String headers = "Content-Type: application/x-www-form-urlencoded\n";
-        headers += "Referer: ";
-        headers += d->m_postReferrer;
-        headers += "\n";
-        const CString& headersLatin1 = headers.latin1();
-        if (firstRequest().httpBody()) {
-            firstRequest().httpBody()->flatten(d->m_formData);
-            d->m_bytesRemainingToWrite = d->m_formData.size();
-        }
-        INTERNET_BUFFERSA buffers;
-        memset(&buffers, 0, sizeof(buffers));
-        buffers.dwStructSize = sizeof(INTERNET_BUFFERSA);
-        buffers.lpcszHeader = headersLatin1.data();
-        buffers.dwHeadersLength = headers.length();
-        buffers.dwBufferTotal = d->m_bytesRemainingToWrite;
-        
-        HttpSendRequestExA(d->m_secondaryHandle, &buffers, 0, 0, (DWORD_PTR)d->m_jobId);
-        // FIXME: add proper error handling
-    }
 }
 
 static void callOnRedirect(void* context)
@@ -346,8 +203,6 @@ bool ResourceHandle::onRequestComplete()
         return true;
     }
 
-    HINTERNET handle = (request().httpMethod() == "POST") ? d->m_secondaryHandle : d->m_resourceHandle;
-
     static const int bufferSize = 32768;
     char buffer[bufferSize];
     INTERNET_BUFFERSA buffers;
@@ -402,59 +257,6 @@ bool ResourceHandle::onRequestComplete()
     return false;
 }
 
-static void __stdcall transferJobStatusCallback(HINTERNET internetHandle,
-                                                DWORD_PTR jobId,
-                                                DWORD internetStatus,
-                                                LPVOID statusInformation,
-                                                DWORD statusInformationLength)
-{
-#ifdef RESOURCE_LOADER_DEBUG
-    char buf[64];
-    _snprintf(buf, sizeof(buf), "status-callback: status=%u, job=%p\n",
-              internetStatus, jobId);
-    OutputDebugStringA(buf);
-#endif
-
-    UINT msg;
-    LPARAM lParam;
-
-    switch (internetStatus) {
-    case INTERNET_STATUS_HANDLE_CREATED:
-        // tell the main thread about the newly created handle
-        msg = handleCreatedMessage;
-        lParam = (LPARAM) LPINTERNET_ASYNC_RESULT(statusInformation)->dwResult;
-        break;
-    case INTERNET_STATUS_REQUEST_COMPLETE:
-#ifdef RESOURCE_LOADER_DEBUG
-        _snprintf(buf, sizeof(buf), "request-complete: result=%p, error=%u\n",
-            LPINTERNET_ASYNC_RESULT(statusInformation)->dwResult,
-            LPINTERNET_ASYNC_RESULT(statusInformation)->dwError);
-        OutputDebugStringA(buf);
-#endif
-        // tell the main thread that the request is done
-        msg = requestCompleteMessage;
-        lParam = 0;
-        break;
-    case INTERNET_STATUS_REDIRECT:
-        // tell the main thread to observe this redirect (FIXME: we probably
-        // need to block the redirect at this point so the application can
-        // decide whether or not to follow the redirect)
-        msg = requestRedirectedMessage;
-        lParam = (LPARAM) StringImpl::create((const UChar*) statusInformation,
-                                             statusInformationLength).releaseRef();
-        break;
-    case INTERNET_STATUS_USER_INPUT_REQUIRED:
-        // FIXME: prompt the user if necessary
-        ResumeSuspendedDownload(internetHandle, 0);
-    case INTERNET_STATUS_STATE_CHANGE:
-        // may need to call ResumeSuspendedDownload here as well
-    default:
-        return;
-    }
-
-    PostMessage(transferJobWindowHandle, msg, (WPARAM) jobId, lParam);
-}
-
 bool ResourceHandle::start(NetworkingContext* context)
 {
     if (request().url().isLocalFile()) {
diff --git a/WebCore/platform/network/win/ResourceHandleWin.h b/WebCore/platform/network/win/ResourceHandleWin.h
deleted file mode 100644
index 2964bcb..0000000
--- a/WebCore/platform/network/win/ResourceHandleWin.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef ResourceHandleWin_h
-#define ResourceHandleWin_h
-
-#include <windows.h>
-
-namespace WebCore {
-
-struct PlatformDataStruct
-{
-    DWORD   error;
-    BOOL    loaded;
-    LPTSTR  errorString;
-};
-
-struct PlatformResponseStruct
-{
-};
-
-}
-
-#endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list