[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
sergio at webkit.org
sergio at webkit.org
Wed Dec 22 18:01:34 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 8384ddd66bddfb8da0a587d4c3febb4bf5886f1f
Author: sergio at webkit.org <sergio at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 6 09:42:37 2010 +0000
2010-12-06 Sergio Villar Senin <svillar at igalia.com>
Reviewed by Martin Robinson.
[GTK] webkit_soup_cache_clear() does not delete all entries in the cache
https://bugs.webkit.org/show_bug.cgi?id=50462
Do not use g_hash_table_foreach to remove entries from the cache
entries hashtable. Iterate over a list of entries to remove them
from the hash table.
* platform/network/soup/ResourceHandleSoup.cpp:
* platform/network/soup/cache/webkit/soup-cache.c:
(remove_cache_item):
(webkit_soup_cache_finalize):
(clear_cache_item):
(webkit_soup_cache_clear):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6088d9b..1721526 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-06 Sergio Villar Senin <svillar at igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] webkit_soup_cache_clear() does not delete all entries in the cache
+ https://bugs.webkit.org/show_bug.cgi?id=50462
+
+ Do not use g_hash_table_foreach to remove entries from the cache
+ entries hashtable. Iterate over a list of entries to remove them
+ from the hash table.
+
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ * platform/network/soup/cache/webkit/soup-cache.c:
+ (remove_cache_item):
+ (webkit_soup_cache_finalize):
+ (clear_cache_item):
+ (webkit_soup_cache_clear):
+
2010-12-05 Kent Tamura <tkent at chromium.org>
Unreviewed. Run sort-Xcode-project-file.
diff --git a/WebCore/platform/network/soup/cache/webkit/soup-cache.c b/WebCore/platform/network/soup/cache/webkit/soup-cache.c
index b916468..a7937dd 100644
--- a/WebCore/platform/network/soup/cache/webkit/soup-cache.c
+++ b/WebCore/platform/network/soup/cache/webkit/soup-cache.c
@@ -1084,11 +1084,12 @@ webkit_soup_cache_init (WebKitSoupCache *cache)
}
static void
-remove_cache_item (gpointer key,
- gpointer value,
- WebKitSoupCache *cache)
+remove_cache_item (gpointer data,
+ gpointer user_data)
{
- WebKitSoupCacheEntry *entry = g_hash_table_lookup (cache->priv->cache, (const gchar *)key);
+ WebKitSoupCache *cache = (WebKitSoupCache *) user_data;
+ WebKitSoupCacheEntry *entry = (WebKitSoupCacheEntry *) data;
+
if (webkit_soup_cache_entry_remove (cache, entry))
webkit_soup_cache_entry_free (entry, FALSE);
}
@@ -1097,10 +1098,15 @@ static void
webkit_soup_cache_finalize (GObject *object)
{
WebKitSoupCachePrivate *priv;
+ GList *entries;
priv = WEBKIT_SOUP_CACHE (object)->priv;
- g_hash_table_foreach (priv->cache, (GHFunc)remove_cache_item, object);
+ // Cannot use g_hash_table_foreach as callbacks must not modify the hash table
+ entries = g_hash_table_get_values (priv->cache);
+ g_list_foreach (entries, remove_cache_item, object);
+ g_list_free (entries);
+
g_hash_table_destroy (priv->cache);
g_free (priv->cache_dir);
@@ -1449,11 +1455,12 @@ webkit_soup_cache_flush (WebKitSoupCache *cache)
}
static void
-clear_cache_item (gpointer key,
- gpointer value,
- WebKitSoupCache *cache)
+clear_cache_item (gpointer data,
+ gpointer user_data)
{
- WebKitSoupCacheEntry *entry = g_hash_table_lookup (cache->priv->cache, (const gchar *)key);
+ WebKitSoupCache *cache = (WebKitSoupCache *) user_data;
+ WebKitSoupCacheEntry *entry = (WebKitSoupCacheEntry *) data;
+
if (webkit_soup_cache_entry_remove (cache, entry))
webkit_soup_cache_entry_free (entry, TRUE);
}
@@ -1469,13 +1476,17 @@ void
webkit_soup_cache_clear (WebKitSoupCache *cache)
{
GHashTable *hash;
+ GList *entries;
g_return_if_fail (WEBKIT_IS_SOUP_CACHE (cache));
hash = cache->priv->cache;
g_return_if_fail (hash);
- g_hash_table_foreach (hash, (GHFunc)clear_cache_item, cache);
+ // Cannot use g_hash_table_foreach as callbacks must not modify the hash table
+ entries = g_hash_table_get_values (hash);
+ g_list_foreach (entries, clear_cache_item, cache);
+ g_list_free (entries);
}
SoupMessage *
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list