[Webkit-unassigned] [Bug 24001] [GTK] Cache control APIs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 4 05:32:27 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=24001


gns at gnome.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #27747|                            |review-
               Flag|                            |




------- Comment #6 from gns at gnome.org  2009-05-04 05:32 PDT -------
(From update of attachment 27747)
> +/**
> + * 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


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list