Commit a5712f32 authored by beidson's avatar beidson

Reviewed by Hyatt

        http://bugs.webkit.org/show_bug.cgi?id=13111
        When stopped a load before it completes, partial images become the 
        broken image icon

        * loader/loader.cpp:
        (WebCore::Loader::didFail): Split off into a method that knows the 
          difference between failed and cancelled.  If a load is cancelled,
          don't call error() on the object - only remove it from the cache
        (WebCore::Loader::cancelRequests): Call didFail(loader, true)
        * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent db08bf82
2007-03-18 Brady Eidson <beidson@apple.com>
Reviewed by Hyatt
http://bugs.webkit.org/show_bug.cgi?id=13111
When stopped a load before it completes, partial images become the
broken image icon
* loader/loader.cpp:
(WebCore::Loader::didFail): Split off into a method that knows the
difference between failed and cancelled. If a load is cancelled,
don't call error() on the object - only remove it from the cache
(WebCore::Loader::cancelRequests): Call didFail(loader, true)
* loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
2007-03-18 Mitz Pettel <mitz@webkit.org>
Reviewed by Adele.
......
......@@ -113,7 +113,12 @@ void Loader::didFinishLoading(SubresourceLoader* loader)
servePendingRequests();
}
void Loader::didFail(SubresourceLoader* loader, const ResourceError& error)
void Loader::didFail(SubresourceLoader* loader, const ResourceError&)
{
didFail(loader);
}
void Loader::didFail(SubresourceLoader* loader, bool cancelled)
{
RequestMap::iterator i = m_requestsLoading.find(loader);
if (i == m_requestsLoading.end())
......@@ -125,8 +130,11 @@ void Loader::didFail(SubresourceLoader* loader, const ResourceError& error)
CachedResource* object = req->cachedResource();
DocLoader* docLoader = req->docLoader();
docLoader->setLoadInProgress(true);
object->error();
if (!cancelled) {
docLoader->setLoadInProgress(true);
object->error();
}
docLoader->setLoadInProgress(false);
cache()->remove(object);
......@@ -221,7 +229,7 @@ void Loader::cancelRequests(DocLoader* dl)
for (unsigned i = 0; i < loadersToCancel.size(); ++i) {
SubresourceLoader* loader = loadersToCancel[i];
didFail(loader, loader->cancelledError());
didFail(loader, true);
}
}
......
......@@ -59,6 +59,7 @@ namespace WebCore {
virtual void didReceiveData(SubresourceLoader*, const char*, int);
virtual void didFinishLoading(SubresourceLoader*);
virtual void didFail(SubresourceLoader*, const ResourceError&);
void didFail(SubresourceLoader*, bool cancelled = false);
void servePendingRequests(bool skipCanLoadCheck = false);
......
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