Commit 1e06d8b2 authored by levin@chromium.org's avatar levin@chromium.org

DocumentThreadableLoader::getShouldUseCredentialStorage should allow for...

DocumentThreadableLoader::getShouldUseCredentialStorage should allow for synchronous callbacks from SubresourceLoader::create.
https://bugs.webkit.org/show_bug.cgi?id=28728

Patch by David Levin <levin@chromium.org> on 2009-08-25
Reviewed by Maciej Stachowiak.

Test: This code path is exercised while running xhr layout tests in chromium.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::getShouldUseCredentialStorage): When called
back synchronously, the loader is 0, so the assert is changed to allow for that.
(WebCore::DocumentThreadableLoader::loadRequest): Synchronous callbacks may be
done before SubresourceLoader::create finishes, so ensure that any previous loader
-- from a preflight request -- is cleared before calling SubresourceLoader::create.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 56cabcfe
2009-08-25 David Levin <levin@chromium.org>
Reviewed by Maciej Stachowiak.
DocumentThreadableLoader::getShouldUseCredentialStorage should allow for synchronous callbacks from SubresourceLoader::create.
https://bugs.webkit.org/show_bug.cgi?id=28728
Test: This code path is exercised while running xhr layout tests in chromium.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::getShouldUseCredentialStorage): When called
back synchronously, the loader is 0, so the assert is changed to allow for that.
(WebCore::DocumentThreadableLoader::loadRequest): Synchronous callbacks may be
done before SubresourceLoader::create finishes, so ensure that any previous loader
-- from a preflight request -- is cleared before calling SubresourceLoader::create.
2009-08-25 Mark Rowe <mrowe@apple.com>
Stop installing IDL files in to the framework.
......@@ -251,7 +251,7 @@ void DocumentThreadableLoader::didFail(SubresourceLoader* loader, const Resource
bool DocumentThreadableLoader::getShouldUseCredentialStorage(SubresourceLoader* loader, bool& shouldUseCredentialStorage)
{
ASSERT_UNUSED(loader, loader == m_loader);
ASSERT_UNUSED(loader, loader == m_loader || !m_loader);
if (!m_options.allowCredentials) {
shouldUseCredentialStorage = false;
......@@ -299,6 +299,9 @@ void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, bool
// Don't sniff content or send load callbacks for the preflight request.
bool sendLoadCallbacks = m_options.sendLoadCallbacks && !m_actualRequest;
bool sniffContent = m_options.sniffContent && !m_actualRequest;
// Clear the loader so that any callbacks from SubresourceLoader::create will not have the old loader.
m_loader = 0;
m_loader = SubresourceLoader::create(m_document->frame(), this, request, skipCanLoadCheck, sendLoadCallbacks, sniffContent);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment