From cedb3a7e5849fd16e939add1ac6f5586467b8c68 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Thu, 20 Jan 2011 12:42:16 +0000 Subject: [PATCH] Clear the files we copy over to the temp cache Fixes CTS tests Change-Id: I3464ac90e58a9df21379a8da9d637f4f5ee69b85 --- core/java/android/webkit/CacheManager.java | 8 ++++++-- core/java/android/webkit/WebViewCore.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java index 6073f7a924140..a553a45927202 100644 --- a/core/java/android/webkit/CacheManager.java +++ b/core/java/android/webkit/CacheManager.java @@ -244,6 +244,9 @@ public final class CacheManager { * obtained from {@link android.webkit.CacheManager.CacheResult#getLocalPath}, this * identifies the cache file. * + * Cache files are not guaranteed to be in this directory before + * CacheManager#getCacheFile(String, Map) is called. + * * @return File The base directory of the cache. * * @deprecated Access to the HTTP cache will be removed in a future release. @@ -611,8 +614,9 @@ public final class CacheManager { return true; } // delete rows in the cache database - WebViewWorker.getHandler().sendEmptyMessage( - WebViewWorker.MSG_CLEAR_CACHE); + if (!JniUtil.useChromiumHttpStack()) + WebViewWorker.getHandler().sendEmptyMessage(WebViewWorker.MSG_CLEAR_CACHE); + // delete cache files in a separate thread to not block UI. final Runnable clearCache = new Runnable() { public void run() { diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index c56f25270c6c0..4fe16781027c8 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -1770,7 +1770,7 @@ final class WebViewCore { private void clearCache(boolean includeDiskFiles) { mBrowserFrame.clearCache(); - if (includeDiskFiles && !JniUtil.useChromiumHttpStack()) { + if (includeDiskFiles) { CacheManager.removeAllCacheFiles(); } }