diff options
| author | Steve Block <steveblock@google.com> | 2010-11-29 14:55:36 +0000 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-11-29 15:02:13 +0000 |
| commit | 8f71a88eb32d112e6277f0a0260df04e969d6f8a (patch) | |
| tree | 6e8cbff2bbcd348d76a9af5bb3d47ed675da526e /WebKit | |
| parent | 63ebc0f62b5ab9255998d79dfa25ed607118938f (diff) | |
| download | external_webkit-8f71a88eb32d112e6277f0a0260df04e969d6f8a.zip external_webkit-8f71a88eb32d112e6277f0a0260df04e969d6f8a.tar.gz external_webkit-8f71a88eb32d112e6277f0a0260df04e969d6f8a.tar.bz2 | |
Moves implementation of ResourceLoaderAndroid to ResourceLoaderAndroid.cpp
This means that the implmentation of this class for both HTTP stacks is
in the same place.
Change-Id: I006cddf27c245a88327643314bb7564a2486ff38
Diffstat (limited to 'WebKit')
| -rw-r--r-- | WebKit/Android.mk | 4 | ||||
| -rw-r--r-- | WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp | 22 | ||||
| -rw-r--r-- | WebKit/android/WebCoreSupport/WebUrlLoader.cpp | 28 |
3 files changed, 21 insertions, 33 deletions
diff --git a/WebKit/Android.mk b/WebKit/Android.mk index 29ff8e2..e039421 100644 --- a/WebKit/Android.mk +++ b/WebKit/Android.mk @@ -28,6 +28,7 @@ LOCAL_SRC_FILES := \ android/WebCoreSupport/GeolocationPermissions.cpp \ android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp \ android/WebCoreSupport/PlatformBridge.cpp \ + android/WebCoreSupport/ResourceLoaderAndroid.cpp \ android/WebCoreSupport/UrlInterceptResponse.cpp \ android/WebCoreSupport/V8Counters.cpp @@ -43,9 +44,6 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ android/WebCoreSupport/WebResourceRequest.cpp \ android/WebCoreSupport/WebResponse.cpp \ android/WebCoreSupport/WebViewClientError.cpp -else -LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ - android/WebCoreSupport/ResourceLoaderAndroid.cpp endif # HTTP_STACK == chrome LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ 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 } } diff --git a/WebKit/android/WebCoreSupport/WebUrlLoader.cpp b/WebKit/android/WebCoreSupport/WebUrlLoader.cpp index 170e78f..8c943a0 100644 --- a/WebKit/android/WebCoreSupport/WebUrlLoader.cpp +++ b/WebKit/android/WebCoreSupport/WebUrlLoader.cpp @@ -80,31 +80,3 @@ void WebUrlLoader::downloadFile() } } // namespace android - - -namespace WebCore { -// on main thread -// static -// TODO: Implement sync requests -PassRefPtr<ResourceLoaderAndroid> ResourceLoaderAndroid::start(WebCore::ResourceHandle* resourceHandle, const WebCore::ResourceRequest& resourceRequest, - FrameLoaderClient* client, bool /*isMainResource*/, bool isSync, bool isPrivateBrowsing) -{ - return android::WebUrlLoader::start(client, resourceHandle, resourceRequest, isSync, isPrivateBrowsing); -} - -// static -bool ResourceLoaderAndroid::willLoadFromCache(const WebCore::KURL&, int64_t identifier) -{ - // 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; -} - -} // namespace WebCore |
