summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-11-29 14:55:36 +0000
committerSteve Block <steveblock@google.com>2010-11-29 15:02:13 +0000
commit8f71a88eb32d112e6277f0a0260df04e969d6f8a (patch)
tree6e8cbff2bbcd348d76a9af5bb3d47ed675da526e /WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp
parent63ebc0f62b5ab9255998d79dfa25ed607118938f (diff)
downloadexternal_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/android/WebCoreSupport/ResourceLoaderAndroid.cpp')
-rw-r--r--WebKit/android/WebCoreSupport/ResourceLoaderAndroid.cpp22
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
}
}