diff options
author | Jesse Wilson <jessewilson@google.com> | 2011-05-11 14:52:00 -0700 |
---|---|---|
committer | Jesse Wilson <jessewilson@google.com> | 2011-05-11 15:35:22 -0700 |
commit | 1724d9cddbf0e0f4e35f5c5d83bc335994f0286e (patch) | |
tree | d57d9c509ac751d6dd2420f2aac07ef847a4376c /support | |
parent | d3992b82602c2eef8e83ae7150f987cc9e0864fd (diff) | |
download | libcore-1724d9cddbf0e0f4e35f5c5d83bc335994f0286e.zip libcore-1724d9cddbf0e0f4e35f5c5d83bc335994f0286e.tar.gz libcore-1724d9cddbf0e0f4e35f5c5d83bc335994f0286e.tar.bz2 |
Support Eviction in DiskLruCache.
Change-Id: I84f536e597efb4c2b8dd519261b327dcd3e9eefa
http://b/3180373
Diffstat (limited to 'support')
-rw-r--r-- | support/src/test/java/libcore/net/http/HttpResponseCache.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/support/src/test/java/libcore/net/http/HttpResponseCache.java b/support/src/test/java/libcore/net/http/HttpResponseCache.java index d30b3d9..7476247 100644 --- a/support/src/test/java/libcore/net/http/HttpResponseCache.java +++ b/support/src/test/java/libcore/net/http/HttpResponseCache.java @@ -55,11 +55,13 @@ import libcore.io.Streams; /** * Cache responses in a cache directory. - * - * TODO: tuning knobs, LRU - * TODO: move this class to android.util */ public final class HttpResponseCache extends ResponseCache implements Closeable { + // TODO: tuning knobs + // TODO: better statistics + // TODO: application cache version on disk + // TODO: move this class to android.util + private static final int ENTRY_METADATA = 0; private static final int ENTRY_BODY = 1; private static final int ENTRY_COUNT = 2; @@ -87,7 +89,7 @@ public final class HttpResponseCache extends ResponseCache implements Closeable @Override public synchronized CacheResponse get(URI uri, String requestMethod, Map<String, List<String>> requestHeaders) throws IOException { String key = uriToKey(uri); - DiskLruCache.Snapshot snapshot = cache.read(key); + DiskLruCache.Snapshot snapshot = cache.get(key); if (snapshot == null) { missCount++; |