[webkit-reviews] review denied: [Bug 24001] [GTK] Cache control APIs : [Attachment 27747] This patch adds API to clear the page and resource caches *and* actually builds
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon May 4 05:32:27 PDT 2009
Gustavo Noronha (kov) <gns at gnome.org> has denied 's request for review:
Bug 24001: [GTK] Cache control APIs
https://bugs.webkit.org/show_bug.cgi?id=24001
Attachment 27747: This patch adds API to clear the page and resource caches
*and* actually builds
https://bugs.webkit.org/attachment.cgi?id=27747&action=review
------- Additional Comments from Gustavo Noronha (kov) <gns at gnome.org>
> +/**
> + * webkit_web_view_clear_cache:
> + * @web_view: a #WebKitWebView
This looks wrong to me. Notice that you use the webview for nothing, and that's
because both caches are actually global, right? So what we want is a
webkit_clear_caches() that explains that it is cleaning the PageCache as well
as the more generic cache, similar to webkit_get_default_session, that we
already have.
> + *
> + * Clears cached resources. Useful for browsers with such functionality
> + * and for forcing a reload of all resources.
> + *
> + * Since: 1.1.1
> + */
> +void webkit_web_view_clear_cache(WebKitWebView* webView)
> +{
> + g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
> +
> + // Clear the page cache
> + int pageCacheSize = pageCache()->capacity();
> + pageCache()->setCapacity(0);
> + pageCache()->setCapacity(pageCacheSize);
> +
> + // Clear the global cache
> + cache()->setDisabled(true);
> + cache()->setDisabled(false);
> +
> +}
> +
> }
> diff --git a/WebKit/gtk/webkit/webkitwebview.h
b/WebKit/gtk/webkit/webkitwebview.h
> index 860c0d0..412326b 100644
> --- a/WebKit/gtk/webkit/webkitwebview.h
> +++ b/WebKit/gtk/webkit/webkitwebview.h
> @@ -2,6 +2,7 @@
> * Copyright (C) 2007 Holger Hans Peter Freyther
> * Copyright (C) 2007, 2008 Alp Toker <alp at atoker.com>
> * Copyright (C) 2008 Collabora Ltd.
> + * Copyright (C) 2009 Movial Creative Technologies Inc.
> *
> * This library is free software; you can redistribute it and/or
> * modify it under the terms of the GNU Library General Public
> @@ -304,6 +305,9 @@ WEBKIT_API void
> webkit_web_view_set_full_content_zoom (WebKitWebView
*web_view,
> gboolean
full_content_zoom);
>
> +WEBKIT_API void
> +webkit_web_view_clear_cache (WebKitWebView
*web_view);
> +
> G_END_DECLS
>
> #endif
More information about the webkit-reviews
mailing list