Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1327)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 11051003: Implement Android WebView.clearCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 635d16b74de0b7dabd81f69a68bc9a02e9651a91..f5f426e9f76202fcfedf1e41c0c089c9bd6ab665 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -150,6 +150,17 @@ public class AwContents {
// WebView[Provider] method implementations (where not provided by ContentViewCore)
//--------------------------------------------------------------------------------------------
+ /**
+ * Clears the resource cache. Note that the cache is per-application, so this will clear the
+ * cache for all WebViews used.
+ *
+ * @param includeDiskFiles if false, only the RAM cache is cleared
+ * TODO(boliu): Clear disk cache part not implemented yet.
+ */
+ public void clearCache(boolean includeDiskFiles) {
+ nativeClearCache(mNativeAwContents, includeDiskFiles);
+ }
+
public void documentHasImages(Message message) {
nativeDocumentHasImages(mNativeAwContents, message);
}
@@ -317,4 +328,5 @@ public class AwContents {
private native void nativeFindAllAsync(int nativeAwContents, String searchString);
private native void nativeFindNext(int nativeAwContents, boolean forward);
private native void nativeClearMatches(int nativeAwContents);
+ private native void nativeClearCache(int nativeAwContents, boolean includeDiskFiles);
}

Powered by Google App Engine
This is Rietveld 408576698