am 7fdab7f9: Merge change 22377 into eclair
Merge commit '7fdab7f9674aadf90c3be1f06d7d34b60151c658' into eclair-plus-aosp * commit '7fdab7f9674aadf90c3be1f06d7d34b60151c658': The new webkit won't keep RAM cache if http header has "no-store". So remove
This commit is contained in:
@@ -105,8 +105,7 @@ class ContentLoader extends StreamLoader {
|
||||
if (mContentType != null) {
|
||||
headers.setContentType("text/html");
|
||||
}
|
||||
// override the cache-control header set by StreamLoader as content can
|
||||
// change, we don't want WebKit to cache it
|
||||
// content can change, we don't want WebKit to cache it
|
||||
headers.setCacheControl("no-store, no-cache");
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ class LoadListener extends Handler implements EventHandler {
|
||||
private boolean mAuthFailed; // indicates that the prev. auth failed
|
||||
private CacheLoader mCacheLoader;
|
||||
private CacheManager.CacheResult mCacheResult;
|
||||
private boolean mFromCache = false;
|
||||
private HttpAuthHeader mAuthHeader;
|
||||
private int mErrorID = OK;
|
||||
private String mErrorDescription;
|
||||
@@ -409,11 +410,10 @@ class LoadListener extends Handler implements EventHandler {
|
||||
mStatusCode == HTTP_MOVED_PERMANENTLY ||
|
||||
mStatusCode == HTTP_TEMPORARY_REDIRECT) &&
|
||||
mNativeLoader != 0) {
|
||||
// Content arriving from a StreamLoader (eg File, Cache or Data)
|
||||
// will not be cached as they have the header:
|
||||
// cache-control: no-store
|
||||
mCacheResult = CacheManager.createCacheFile(mUrl, mStatusCode,
|
||||
headers, mMimeType, false);
|
||||
if (!mFromCache && URLUtil.isNetworkUrl(mUrl)) {
|
||||
mCacheResult = CacheManager.createCacheFile(mUrl, mStatusCode,
|
||||
headers, mMimeType, false);
|
||||
}
|
||||
if (mCacheResult != null) {
|
||||
mCacheResult.encoding = mEncoding;
|
||||
}
|
||||
@@ -626,6 +626,7 @@ class LoadListener extends Handler implements EventHandler {
|
||||
* serviced by the Cache. */
|
||||
/* package */ void setCacheLoader(CacheLoader c) {
|
||||
mCacheLoader = c;
|
||||
mFromCache = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -642,6 +643,8 @@ class LoadListener extends Handler implements EventHandler {
|
||||
// Go ahead and set the cache loader to null in case the result is
|
||||
// null.
|
||||
mCacheLoader = null;
|
||||
// reset the flag
|
||||
mFromCache = false;
|
||||
|
||||
if (result != null) {
|
||||
// The contents of the cache may need to be revalidated so just
|
||||
@@ -662,6 +665,7 @@ class LoadListener extends Handler implements EventHandler {
|
||||
}
|
||||
// Load the cached file
|
||||
mCacheLoader.load();
|
||||
mFromCache = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,6 @@ abstract class StreamLoader extends Handler {
|
||||
if (mContentLength > 0) {
|
||||
headers.setContentLength(mContentLength);
|
||||
}
|
||||
headers.setCacheControl(NO_STORE);
|
||||
buildHeaders(headers);
|
||||
mHandler.headers(headers);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user