Commit 1fbfab92 authored by beidson@apple.com's avatar beidson@apple.com

2009-02-06 Brady Eidson <beidson@apple.com>

        Reviewed by Dan Bernstein

        <rdar://problem/6563402> - Workaround a case where ::didReceiveData() might be called on a ResourceHandleClient 
        before ::didReceiveResponse().

        No layout test, as we don't have a concrete way to reproduce these conditions.  To that effect, I've added an ASSERT
        to catch the conditions before the workaround takes effect in case any WebKit Debug-build developer runs across
        this case and can come up with something more reproducible.

        * loader/MainResourceLoader.cpp:
        (WebCore::MainResourceLoader::didReceiveData): If the response is null create a dummy response.  This is much 
          like the FrameLoader::init() response that is used for initial document creation.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 158f3856
2009-02-06 Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein
<rdar://problem/6563402> - Workaround a case where ::didReceiveData() might be called on a ResourceHandleClient
before ::didReceiveResponse().
No layout test, as we don't have a concrete way to reproduce these conditions. To that effect, I've added an ASSERT
to catch the conditions before the workaround takes effect in case any WebKit Debug-build developer runs across
this case and can come up with something more reproducible.
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::didReceiveData): If the response is null create a dummy response. This is much
like the FrameLoader::init() response that is used for initial document creation.
2009-02-06 Geoffrey Garen <ggaren@apple.com>
Build fix.
......@@ -323,6 +323,17 @@ void MainResourceLoader::didReceiveData(const char* data, int length, long long
ASSERT(data);
ASSERT(length != 0);
ASSERT(!m_response.isNull());
#if USE(CFNETWORK) || (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER))
// Workaround for <rdar://problem/6060782>
if (m_response.isNull()) {
m_response = ResourceResponse(KURL(), "text/html", 0, String(), String());
if (DocumentLoader* documentLoader = frameLoader()->activeDocumentLoader())
documentLoader->setResponse(m_response);
}
#endif
// There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred.
// See <rdar://problem/6304600> for more details.
#if !PLATFORM(CF)
......
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