summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/icon/IconLoader.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/loader/icon/IconLoader.cpp
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/loader/icon/IconLoader.cpp')
-rw-r--r--WebCore/loader/icon/IconLoader.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/WebCore/loader/icon/IconLoader.cpp b/WebCore/loader/icon/IconLoader.cpp
index 4337f51..b7bf115 100644
--- a/WebCore/loader/icon/IconLoader.cpp
+++ b/WebCore/loader/icon/IconLoader.cpp
@@ -36,6 +36,7 @@
#include "ResourceResponse.h"
#include "ResourceRequest.h"
#include "SubresourceLoader.h"
+#include <wtf/UnusedParam.h>
using namespace std;
@@ -101,9 +102,13 @@ void IconLoader::didReceiveResponse(SubresourceLoader* resourceLoader, const Res
}
}
-void IconLoader::didReceiveData(SubresourceLoader* loader, const char*, int size)
+void IconLoader::didReceiveData(SubresourceLoader* unusedLoader, const char*, int unusedSize)
{
- LOG(IconDatabase, "IconLoader::didReceiveData() - Loader %p, number of bytes %i", loader, size);
+#if LOG_DISABLED
+ UNUSED_PARAM(unusedLoader);
+ UNUSED_PARAM(unusedSize);
+#endif
+ LOG(IconDatabase, "IconLoader::didReceiveData() - Loader %p, number of bytes %i", unusedLoader, unusedSize);
}
void IconLoader::didFail(SubresourceLoader* resourceLoader, const ResourceError&)
@@ -121,7 +126,7 @@ void IconLoader::didFail(SubresourceLoader* resourceLoader, const ResourceError&
}
}
-void IconLoader::didReceiveAuthenticationChallenge(SubresourceLoader* resourceLoader, const AuthenticationChallenge& challenge)
+void IconLoader::didReceiveAuthenticationChallenge(SubresourceLoader*, const AuthenticationChallenge&)
{
// We don't ever want to prompt for authentication just for a site icon, so
// implement this method to cancel the resource load
@@ -153,9 +158,12 @@ void IconLoader::finishLoading(const KURL& iconURL, PassRefPtr<SharedBuffer> dat
// <rdar://problem/5463392> tracks that enhancement
if (!iconURL.isEmpty() && m_loadIsInProgress) {
- iconDatabase()->setIconDataForIconURL(data, iconURL.string());
LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to database", iconURL.string().ascii().data());
m_frame->loader()->commitIconURLToIconDatabase(iconURL);
+ // Setting the icon data only after committing to the database ensures that the data is
+ // kept in memory (so it does not have to be read from the database asynchronously), since
+ // there is a page URL referencing it.
+ iconDatabase()->setIconDataForIconURL(data, iconURL.string());
m_frame->loader()->client()->dispatchDidReceiveIcon();
}