WebCore:
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2009 18:06:20 +0000 (18:06 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2009 18:06:20 +0000 (18:06 +0000)
commit70c415e613d6336f198aac5e6cb72310ad5fe6b3
tree1dff5d66a80cb4fc26054e2398cddb0f2b64d59c
parent63df1abe3000226d559f29e959c5cadc1ca80157
WebCore:

2009-02-25  David Levin  <levin@chromium.org>

        Reviewed by Alexey Proskuryakov.

        Bug 24089: ThreadableLoader::loadResourceSynchronously should do callbacks like the async code.
        <https://bugs.webkit.org/show_bug.cgi?id=24089>

        Make threadable loader callbacks to happen during the sync load call.

        Changes the behavior of sync xhr for insecure redirects in two ways:
        + Sends an error event instead of an abort event (which is the same as async xhr's behavior).
        + Throws a network exception which is what other browsers do and what the spec
        says to do (http://www.w3.org/TR/XMLHttpRequest/).

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::loadResourceSynchronously):
        * loader/DocumentThreadableLoader.h:
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoader::loadResourceSynchronously):
        * loader/ThreadableLoader.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::XMLHttpRequest):
        (WebCore::XMLHttpRequest::loadRequestSynchronously):
        (WebCore::XMLHttpRequest::loadRequestAsynchronously):
        (WebCore::XMLHttpRequest::didFail):
        (WebCore::XMLHttpRequest::didFailRedirectCheck):
        * xml/XMLHttpRequest.h:

LayoutTests:

2009-02-25  David Levin  <levin@chromium.org>

        Reviewed by Alexey Proskuryakov.

        Bug 24089: ThreadableLoader::loadResourceSynchronously should do callbacks like the async code.
        <https://bugs.webkit.org/show_bug.cgi?id=24089>

        Modified the test to account for behavior change and output more information to better detect
        future changes in behavior.

        * http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:
        * http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html
WebCore/ChangeLog
WebCore/loader/DocumentThreadableLoader.cpp
WebCore/loader/DocumentThreadableLoader.h
WebCore/loader/ThreadableLoader.cpp
WebCore/loader/ThreadableLoader.h
WebCore/xml/XMLHttpRequest.cpp
WebCore/xml/XMLHttpRequest.h