2009-02-23 David Levin <levin@chromium.org>
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Feb 2009 22:37:35 +0000 (22:37 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Feb 2009 22:37:35 +0000 (22:37 +0000)
        Reviewed by Alexey Proskuryakov.

        Bug 24088: ThreadableLoaderClient::didFailWillSendRequestCheck isn't wired up completely for workers and could use a better name.
        <https://bugs.webkit.org/show_bug.cgi?id=24088>

        No observable change in behavior, so no test.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::create):
        * loader/ThreadableLoaderClient.h:
        (WebCore::ThreadableLoaderClient::didFailRedirectCheck):
        * loader/ThreadableLoaderClientWrapper.h:
        (WebCore::ThreadableLoaderClientWrapper::didFailRedirectCheck):
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::workerContextDidFailRedirectCheck):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
        * loader/WorkerThreadableLoader.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::didFinishLoading):
        * xml/XMLHttpRequest.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41157 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/DocumentThreadableLoader.cpp
WebCore/loader/ThreadableLoaderClient.h
WebCore/loader/ThreadableLoaderClientWrapper.h
WebCore/loader/WorkerThreadableLoader.cpp
WebCore/loader/WorkerThreadableLoader.h
WebCore/xml/XMLHttpRequest.cpp
WebCore/xml/XMLHttpRequest.h

index 4c1e1d4c062a486aad661701108577673416e777..30a42dffd210e8d12cc093bf407767c4e0d802e7 100644 (file)
@@ -1,3 +1,26 @@
+2009-02-23  David Levin  <levin@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Bug 24088: ThreadableLoaderClient::didFailWillSendRequestCheck isn't wired up completely for workers and could use a better name.
+        <https://bugs.webkit.org/show_bug.cgi?id=24088>
+
+        No observable change in behavior, so no test.
+
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::create):
+        * loader/ThreadableLoaderClient.h:
+        (WebCore::ThreadableLoaderClient::didFailRedirectCheck):
+        * loader/ThreadableLoaderClientWrapper.h:
+        (WebCore::ThreadableLoaderClientWrapper::didFailRedirectCheck):
+        * loader/WorkerThreadableLoader.cpp:
+        (WebCore::workerContextDidFailRedirectCheck):
+        (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
+        * loader/WorkerThreadableLoader.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::didFinishLoading):
+        * xml/XMLHttpRequest.h:
+
 2009-02-23  David Levin  <levin@chromium.org>
 
         Reviewed by Alexey Proskuryakov.
index 2768525be748eade5bf9afc85319c7a124e63232..d5190693e51711768f81676389206be85d5e5675 100644 (file)
@@ -82,7 +82,7 @@ void DocumentThreadableLoader::willSendRequest(SubresourceLoader*, ResourceReque
     // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
     if (!m_document->securityOrigin()->canRequest(request.url())) {
         RefPtr<DocumentThreadableLoader> protect(this);
-        m_client->didFailWillSendRequestCheck();
+        m_client->didFailRedirectCheck();
         cancel();
     }
 }
index f46ef25c400dba0f7fd873839744aeeca31ed611..93a8e869df1e1908db3051616d0789ca50e64b00 100644 (file)
@@ -44,7 +44,7 @@ namespace WebCore {
         virtual void didReceiveData(const char*, int /*lengthReceived*/) { }
         virtual void didFinishLoading(unsigned long /*identifier*/) { }
         virtual void didFail(const ResourceError&) { }
-        virtual void didFailWillSendRequestCheck() { }
+        virtual void didFailRedirectCheck() { }
 
         virtual void didReceiveAuthenticationCancellation(const ResourceResponse&) { }
 
index 1b9a24aa0b3a06ee62d7556491aaca450fb9f1ca..4c6163f1b8039ad1e9b3ea4055100f887d1819b7 100644 (file)
@@ -80,6 +80,12 @@ namespace WebCore {
                 m_client->didFail(error);
         }
 
+        void didFailRedirectCheck()
+        {
+            if (m_client)
+                m_client->didFailRedirectCheck();
+        }
+
         void didReceiveAuthenticationCancellation(const ResourceResponse& response)
         {
             if (m_client)
index 7f0a1365b917e9f1d398db00f09096b79d46079e..83728224ce39e3429fac3e914ec0753bed9a6a88 100644 (file)
@@ -199,6 +199,17 @@ void WorkerThreadableLoader::MainThreadBridge::didFail(const ResourceError& erro
     m_messagingProxy.postTaskToWorkerContext(createCallbackTask(&workerContextDidFail, m_workerClientWrapper, error));
 }
 
+static void workerContextDidFailRedirectCheck(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper)
+{
+    ASSERT_UNUSED(context, context->isWorkerContext());
+    workerClientWrapper->didFailRedirectCheck();
+}
+
+void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck()
+{
+    m_messagingProxy.postTaskToWorkerContext(createCallbackTask(&workerContextDidFailRedirectCheck, m_workerClientWrapper));
+}
+
 static void workerContextDidReceiveAuthenticationCancellation(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, auto_ptr<CrossThreadResourceResponseData> responseData)
 {
     ASSERT_UNUSED(context, context->isWorkerContext());
index 5c1926d68d2bf1e6d2fd235f8e8abaa2bc533cd7..ab6b62c9473a6dc99774e44b6fbd265647c97896 100644 (file)
@@ -112,6 +112,7 @@ namespace WebCore {
             virtual void didReceiveData(const char*, int lengthReceived);
             virtual void didFinishLoading(int identifier);
             virtual void didFail(const ResourceError&);
+            virtual void didFailRedirectCheck();
             virtual void didReceiveAuthenticationCancellation(const ResourceResponse&);
 
             // Only to be used on the main thread.
index 44d1b138c27db31c668ea31332a4d6f685d1bb5f..aad07259b21d640bd1dcd9212b8b3601a1880722 100644 (file)
@@ -1168,7 +1168,7 @@ void XMLHttpRequest::didFail(const ResourceError& error)
     networkError();
 }
 
-void XMLHttpRequest::didFailWillSendRequestCheck()
+void XMLHttpRequest::didFailRedirectCheck()
 {
     internalAbort();
     networkError();
index 48df3d5bfd18929483488305bd7c7a71829fbe1d..0882ddc9a5409e33540ce537a965325c642f47b5 100644 (file)
@@ -130,7 +130,7 @@ private:
     virtual void didReceiveData(const char* data, int lengthReceived);
     virtual void didFinishLoading(unsigned long identifier);
     virtual void didFail(const ResourceError&);
-    virtual void didFailWillSendRequestCheck();
+    virtual void didFailRedirectCheck();
     virtual void didReceiveAuthenticationCancellation(const ResourceResponse&);
 
     // Special versions for the preflight