summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2010-10-05 07:05:31 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-05 07:05:31 -0700
commit24c6a233780d45269caa0095213e59a3ded360b6 (patch)
tree382386fc75a5071b948b924030ca1a0212672cbb /WebKit/android/WebCoreSupport
parent1d88f7c1752437240899bb62df4e508b91f396f6 (diff)
parentf69429a9e93ec4396c01fe27171bcefd4d238342 (diff)
downloadexternal_webkit-24c6a233780d45269caa0095213e59a3ded360b6.zip
external_webkit-24c6a233780d45269caa0095213e59a3ded360b6.tar.gz
external_webkit-24c6a233780d45269caa0095213e59a3ded360b6.tar.bz2
Merge "Block network loads based on the setting."
Diffstat (limited to 'WebKit/android/WebCoreSupport')
-rw-r--r--WebKit/android/WebCoreSupport/WebUrlLoader.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/WebKit/android/WebCoreSupport/WebUrlLoader.cpp b/WebKit/android/WebCoreSupport/WebUrlLoader.cpp
index cda02dd..391f988 100644
--- a/WebKit/android/WebCoreSupport/WebUrlLoader.cpp
+++ b/WebKit/android/WebCoreSupport/WebUrlLoader.cpp
@@ -28,6 +28,7 @@
#include "WebUrlLoader.h"
#include "FrameLoaderClientAndroid.h"
+#include "WebCoreFrameBridge.h"
#include "WebUrlLoaderClient.h"
namespace android {
@@ -46,8 +47,13 @@ WebUrlLoader::~WebUrlLoader()
PassRefPtr<WebUrlLoader> WebUrlLoader::start(FrameLoaderClient* client, WebCore::ResourceHandle* resourceHandle,
const WebCore::ResourceRequest& resourceRequest, bool isSync, bool isPrivateBrowsing)
{
- FrameLoaderClientAndroid* clientAndroid = static_cast<FrameLoaderClientAndroid*> (client);
- RefPtr<WebUrlLoader> loader = WebUrlLoader::create(clientAndroid->webFrame(), resourceHandle, resourceRequest);
+ WebFrame* webFrame = static_cast<FrameLoaderClientAndroid*>(client)->webFrame();
+
+ if (webFrame->blockNetworkLoads() &&
+ (resourceRequest.url().protocolIs("http") ||
+ resourceRequest.url().protocolIs("https")))
+ return NULL;
+ RefPtr<WebUrlLoader> loader = WebUrlLoader::create(webFrame, resourceHandle, resourceRequest);
loader->m_loaderClient->start(isSync, isPrivateBrowsing);
return loader.release();