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 4c1e1d4..30a42df 100644 (file)
@@ -2,6 +2,29 @@
 
         Reviewed by Alexey Proskuryakov.
 
 
         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.
+
         Bug 24047: Need to simplify nested if's in WorkerRunLoop::runInMode
         <https://bugs.webkit.org/show_bug.cgi?id=24047>
 
         Bug 24047: Need to simplify nested if's in WorkerRunLoop::runInMode
         <https://bugs.webkit.org/show_bug.cgi?id=24047>
 
index 2768525..d519069 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);
     // 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();
     }
 }
         cancel();
     }
 }
index f46ef25..93a8e86 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 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&) { }
 
 
         virtual void didReceiveAuthenticationCancellation(const ResourceResponse&) { }
 
index 1b9a24a..4c6163f 100644 (file)
@@ -80,6 +80,12 @@ namespace WebCore {
                 m_client->didFail(error);
         }
 
                 m_client->didFail(error);
         }
 
+        void didFailRedirectCheck()
+        {
+            if (m_client)
+                m_client->didFailRedirectCheck();
+        }
+
         void didReceiveAuthenticationCancellation(const ResourceResponse& response)
         {
             if (m_client)
         void didReceiveAuthenticationCancellation(const ResourceResponse& response)
         {
             if (m_client)
index 7f0a136..8372822 100644 (file)
@@ -199,6 +199,17 @@ void WorkerThreadableLoader::MainThreadBridge::didFail(const ResourceError& erro
     m_messagingProxy.postTaskToWorkerContext(createCallbackTask(&workerContextDidFail, m_workerClientWrapper, error));
 }
 
     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());
 static void workerContextDidReceiveAuthenticationCancellation(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, auto_ptr<CrossThreadResourceResponseData> responseData)
 {
     ASSERT_UNUSED(context, context->isWorkerContext());
index 5c1926d..ab6b62c 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 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.
             virtual void didReceiveAuthenticationCancellation(const ResourceResponse&);
 
             // Only to be used on the main thread.
index 44d1b13..aad0725 100644 (file)
@@ -1168,7 +1168,7 @@ void XMLHttpRequest::didFail(const ResourceError& error)
     networkError();
 }
 
     networkError();
 }
 
-void XMLHttpRequest::didFailWillSendRequestCheck()
+void XMLHttpRequest::didFailRedirectCheck()
 {
     internalAbort();
     networkError();
 {
     internalAbort();
     networkError();
index 48df3d5..0882ddc 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 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
     virtual void didReceiveAuthenticationCancellation(const ResourceResponse&);
 
     // Special versions for the preflight