diff options
author | Steve Block <steveblock@google.com> | 2010-11-29 07:19:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-29 07:19:42 -0800 |
commit | 454adf027eb747dd9d6c6b041f1d2d68f228c44b (patch) | |
tree | 0df65d7a67702d4322a0d5472058ee04700f5723 /WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp | |
parent | 9092f30ce1d2ad138d0095acddc2f5f4b2a025f9 (diff) | |
parent | 8f71a88eb32d112e6277f0a0260df04e969d6f8a (diff) | |
download | external_webkit-454adf027eb747dd9d6c6b041f1d2d68f228c44b.zip external_webkit-454adf027eb747dd9d6c6b041f1d2d68f228c44b.tar.gz external_webkit-454adf027eb747dd9d6c6b041f1d2d68f228c44b.tar.bz2 |
Merge changes I006cddf2,Ib304a845,I4622749d
* changes:
Moves implementation of ResourceLoaderAndroid to ResourceLoaderAndroid.cpp
Add a static WebRequestContext::acceptLanguage() method
Make WebCookieJar::get() threadsafe
Diffstat (limited to 'WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp')
-rw-r--r-- | WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp b/WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp index 8872a52..2b4a6fc 100644 --- a/WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp @@ -24,27 +24,45 @@ */ #include <config.h> - #include <ResourceLoaderAndroid.h> #include "FrameLoaderClientAndroid.h" #include "WebCoreFrameBridge.h" #include "WebCoreResourceLoader.h" +#include "WebUrlLoader.h" using namespace android; namespace WebCore { PassRefPtr<ResourceLoaderAndroid> ResourceLoaderAndroid::start( - ResourceHandle* handle, const ResourceRequest& request, FrameLoaderClient* client, bool isMainResource, bool isSync, bool /*isPrivateBrowsing*/) + ResourceHandle* handle, const ResourceRequest& request, FrameLoaderClient* client, bool isMainResource, bool isSync, bool isPrivateBrowsing) { + // Called on main thread +#if USE(CHROME_NETWORK_STACK) + // TODO: Implement sync requests + return WebUrlLoader::start(client, handle, request, isSync, isPrivateBrowsing); +#else FrameLoaderClientAndroid* clientAndroid = static_cast<FrameLoaderClientAndroid*> (client); return clientAndroid->webFrame()->startLoadingResource(handle, request, isMainResource, isSync); +#endif } bool ResourceLoaderAndroid::willLoadFromCache(const WebCore::KURL& url, int64_t identifier) { +#if USE(CHROME_NETWORK_STACK) + // This method is used to determine if a POST request can be repeated from + // cache, but you cannot really know until you actually try to read from the + // cache. Even if we checked now, something else could come along and wipe + // out the cache entry by the time we fetch it. + // + // So, we always say yes here, to prevent the FrameLoader from initiating a + // reload. Then in FrameLoaderClientImpl::dispatchWillSendRequest, we + // fix-up the cache policy of the request to force a load from the cache. + return true; +#else return WebCoreResourceLoader::willLoadFromCache(url, identifier); +#endif } } |