--- a/webengine/osswebengine/WebCore/loader/icon/IconLoader.cpp Tue Aug 31 16:17:46 2010 +0300
+++ b/webengine/osswebengine/WebCore/loader/icon/IconLoader.cpp Wed Sep 01 12:28:30 2010 +0100
@@ -95,9 +95,13 @@
int status = response.httpStatusCode();
LOG(IconDatabase, "IconLoader::didReceiveResponse() - Loader %p, response %i", resourceLoader, status);
- if (status && (status < 200 || status > 299)) {
- ResourceHandle* handle = resourceLoader->handle();
- finishLoading(handle ? handle->request().url() : KURL(), 0);
+ // It is possible that we are receiving the response for previous load request which is cancelled.
+ // Process down response of last resource loader only. Ignore if we can not remember other icon load requests.
+ if(resourceLoader == m_resourceLoader) {
+ if (status && (status < 200 || status > 299)) {
+ ResourceHandle* handle = resourceLoader->handle();
+ finishLoading(handle ? handle->request().url() : KURL(), 0);
+ }
}
}
@@ -114,8 +118,10 @@
// we need to be prepared to receive this call even after we've "finished loading" once.
// After it is resolved, we can restore an assertion that the load is in progress if ::didFail() is called
- if (m_loadIsInProgress) {
- ASSERT(resourceLoader == m_resourceLoader);
+ // It is possible that we are receiving the response for previous load request which is cancelled.
+ // Process down response of last resource loader only. Ignore if we can not remember other icon load requests.
+ if (m_loadIsInProgress && (resourceLoader == m_resourceLoader)) {
+ //ASSERT(resourceLoader == m_resourceLoader);
ResourceHandle* handle = resourceLoader->handle();
finishLoading(handle ? handle->request().url() : KURL(), 0);
}
@@ -129,8 +135,10 @@
// we need to be prepared to receive this call even after we've "finished loading" once.
// After it is resolved, we can restore an assertion that the load is in progress if ::didFail() is called
- if (m_loadIsInProgress) {
- ASSERT(resourceLoader == m_resourceLoader);
+ // It is possible that we are receiving the response for previous load request which is cancelled.
+ // Process down response of last resource loader only. Ignore if we can not remember other icon load requests.
+ if (m_loadIsInProgress && (resourceLoader == m_resourceLoader)) {
+ //ASSERT(resourceLoader == m_resourceLoader);
ResourceHandle* handle = resourceLoader->handle();
finishLoading(handle ? handle->request().url() : KURL(), m_resourceLoader->resourceData());
}