Title: [122223] trunk/Source/WebKit2
Revision
122223
Author
[email protected]
Date
2012-07-10 08:30:55 -0700 (Tue, 10 Jul 2012)

Log Message

[GTK] Add API to clear the cache to WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=90856

Reviewed by Martin Robinson.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_clear_cache): Call
WKResourceCacheManagerClearCacheForAllOrigins() to clear all
resources currently cached.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (122222 => 122223)


--- trunk/Source/WebKit2/ChangeLog	2012-07-10 14:25:37 UTC (rev 122222)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-10 15:30:55 UTC (rev 122223)
@@ -1,3 +1,17 @@
+2012-07-10  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Add API to clear the cache to WebKit2 GTK+
+        https://bugs.webkit.org/show_bug.cgi?id=90856
+
+        Reviewed by Martin Robinson.
+
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (webkit_web_context_clear_cache): Call
+        WKResourceCacheManagerClearCacheForAllOrigins() to clear all
+        resources currently cached.
+        * UIProcess/API/gtk/WebKitWebContext.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
+
 2012-07-10  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r122178.

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (122222 => 122223)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp	2012-07-10 14:25:37 UTC (rev 122222)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp	2012-07-10 15:30:55 UTC (rev 122223)
@@ -162,11 +162,10 @@
  * these caches, including various WebCore caches.
  *
  * Browsers can improve document load speed substantially by
- * specifying WEBKIT_CACHE_MODEL_WEB_BROWSER. Applications without a
+ * specifying %WEBKIT_CACHE_MODEL_WEB_BROWSER. Applications without a
  * browsing interface can reduce memory usage substantially by
- * specifying WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER. The default value is
- * WEBKIT_CACHE_MODEL_WEB_BROWSER.
- *
+ * specifying %WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER. The default value is
+ * %WEBKIT_CACHE_MODEL_WEB_BROWSER.
  */
 void webkit_web_context_set_cache_model(WebKitWebContext* context, WebKitCacheModel model)
 {
@@ -221,6 +220,21 @@
     return WEBKIT_CACHE_MODEL_WEB_BROWSER;
 }
 
+/**
+ * webkit_web_context_clear_cache:
+ * @context: a #WebKitWebContext
+ *
+ * Clears all resources currently cached.
+ * See also webkit_web_context_set_cache_model().
+ */
+void webkit_web_context_clear_cache(WebKitWebContext* context)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
+
+    WebKitWebContextPrivate* priv = context->priv;
+    WKResourceCacheManagerClearCacheForAllOrigins(WKContextGetResourceCacheManager(priv->context.get()), WKResourceCachesToClearAll);
+}
+
 typedef HashMap<WKDownloadRef, GRefPtr<WebKitDownload> > DownloadsMap;
 
 static DownloadsMap& downloadsMap()

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h (122222 => 122223)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h	2012-07-10 14:25:37 UTC (rev 122222)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h	2012-07-10 15:30:55 UTC (rev 122223)
@@ -51,7 +51,7 @@
  * @WEBKIT_CACHE_MODEL_WEB_BROWSER: Improve document load speed substantially
  *   by caching a very large number of resources and previously viewed content.
  *
- * Enum values used for determining the webview cache model.
+ * Enum values used for determining the #WebKitWebContext cache model.
  */
 typedef enum {
     WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER,
@@ -103,6 +103,9 @@
 WEBKIT_API WebKitCacheModel
 webkit_web_context_get_cache_model                  (WebKitWebContext              *context);
 
+WEBKIT_API void
+webkit_web_context_clear_cache                      (WebKitWebContext              *context);
+
 WEBKIT_API WebKitDownload *
 webkit_web_context_download_uri                     (WebKitWebContext              *context,
                                                      const gchar                   *uri);

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (122222 => 122223)


--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt	2012-07-10 14:25:37 UTC (rev 122222)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt	2012-07-10 15:30:55 UTC (rev 122223)
@@ -27,6 +27,7 @@
 webkit_web_context_get_default
 webkit_web_context_get_cache_model
 webkit_web_context_set_cache_model
+webkit_web_context_clear_cache
 webkit_web_context_download_uri
 webkit_web_context_get_cookie_manager
 webkit_web_context_set_additional_plugins_directory
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to