diff options
| author | Grace Kloba <klobag@google.com> | 2009-06-19 15:56:08 -0700 |
|---|---|---|
| committer | Grace Kloba <klobag@google.com> | 2009-06-25 09:48:39 -0700 |
| commit | e64c5567de20d06ac7ed1f5a01f018991cd40a52 (patch) | |
| tree | 847e197b95b613e9c0b7888aeba979c7be4d9585 /core/java/android/webkit/CacheManager.java | |
| parent | 7822de554aacd1e364c77427d1a09e070b8159b9 (diff) | |
Fix for the new webkit. Now "expires" takes the string instead of int.
We have to upadte our cache database. Good thing is Gears can avoid the expensive date conversion.
Diffstat (limited to 'core/java/android/webkit/CacheManager.java')
| -rw-r--r-- | core/java/android/webkit/CacheManager.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java index 4d471f7f6789..06148fbbbf0c 100644 --- a/core/java/android/webkit/CacheManager.java +++ b/core/java/android/webkit/CacheManager.java @@ -79,6 +79,7 @@ public final class CacheManager { int httpStatusCode; long contentLength; long expires; + String expiresString; String localPath; String lastModified; String etag; @@ -107,6 +108,10 @@ public final class CacheManager { return expires; } + public String getExpiresString() { + return expiresString; + } + public String getLastModified() { return lastModified; } @@ -603,17 +608,18 @@ public final class CacheManager { if (location != null) ret.location = location; ret.expires = -1; - String expires = headers.getExpires(); - if (expires != null) { + ret.expiresString = headers.getExpires(); + if (ret.expiresString != null) { try { - ret.expires = HttpDateTime.parse(expires); + ret.expires = HttpDateTime.parse(ret.expiresString); } catch (IllegalArgumentException ex) { // Take care of the special "-1" and "0" cases - if ("-1".equals(expires) || "0".equals(expires)) { + if ("-1".equals(ret.expiresString) + || "0".equals(ret.expiresString)) { // make it expired, but can be used for history navigation ret.expires = 0; } else { - Log.e(LOGTAG, "illegal expires: " + expires); + Log.e(LOGTAG, "illegal expires: " + ret.expiresString); } } } |
