summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.cpp2
-rw-r--r--Source/WebCore/page/Settings.cpp10
-rw-r--r--Source/WebCore/page/Settings.h8
-rw-r--r--Source/WebKit/android/jni/WebSettings.cpp11
4 files changed, 31 insertions, 0 deletions
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
index 91c0629..fe25a93 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
@@ -293,6 +293,8 @@ bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url
}
#if ENABLE(LINK_PREFETCH)
case CachedResource::LinkResource:
+ if (!m_document->settings()->linkPrefetchEnabled())
+ return false;
break;
#endif
}
diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
index c26a0fc..f668f3e 100644
--- a/Source/WebCore/page/Settings.cpp
+++ b/Source/WebCore/page/Settings.cpp
@@ -149,6 +149,9 @@ Settings::Settings(Page* page)
// they can't use by. Leaving enabled for now to not change existing behavior.
, m_downloadableBinaryFontsEnabled(true)
, m_xssAuditorEnabled(false)
+#if ENABLE(LINK_PREFETCH)
+ , m_linkPrefetchEnabled(true)
+#endif
, m_acceleratedCompositingEnabled(true)
, m_acceleratedCompositingFor3DTransformsEnabled(true)
, m_acceleratedCompositingForVideoEnabled(true)
@@ -823,6 +826,13 @@ void Settings::setXSSAuditorEnabled(bool xssAuditorEnabled)
m_xssAuditorEnabled = xssAuditorEnabled;
}
+#if ENABLE(LINK_PREFETCH)
+void Settings::setLinkPrefetchEnabled(bool linkPrefetchEnabled)
+{
+ m_linkPrefetchEnabled = linkPrefetchEnabled;
+}
+#endif
+
void Settings::setAcceleratedCompositingEnabled(bool enabled)
{
if (m_acceleratedCompositingEnabled == enabled)
diff --git a/Source/WebCore/page/Settings.h b/Source/WebCore/page/Settings.h
index 2bb222d..2cf7715 100644
--- a/Source/WebCore/page/Settings.h
+++ b/Source/WebCore/page/Settings.h
@@ -352,6 +352,11 @@ namespace WebCore {
void setXSSAuditorEnabled(bool);
bool xssAuditorEnabled() const { return m_xssAuditorEnabled; }
+#if ENABLE(LINK_PREFETCH)
+ void setLinkPrefetchEnabled(bool);
+ bool linkPrefetchEnabled() const { return m_linkPrefetchEnabled; }
+#endif
+
void setCanvasUsesAcceleratedDrawing(bool);
bool canvasUsesAcceleratedDrawing() const { return m_canvasUsesAcceleratedDrawing; }
@@ -567,6 +572,9 @@ namespace WebCore {
bool m_acceleratedDrawingEnabled : 1;
bool m_downloadableBinaryFontsEnabled : 1;
bool m_xssAuditorEnabled : 1;
+#if ENABLE(LINK_PREFETCH)
+ bool m_linkPrefetchEnabled : 1;
+#endif
bool m_acceleratedCompositingEnabled : 1;
bool m_acceleratedCompositingFor3DTransformsEnabled : 1;
bool m_acceleratedCompositingForVideoEnabled : 1;
diff --git a/Source/WebKit/android/jni/WebSettings.cpp b/Source/WebKit/android/jni/WebSettings.cpp
index 65ac360..cec44c1 100644
--- a/Source/WebKit/android/jni/WebSettings.cpp
+++ b/Source/WebKit/android/jni/WebSettings.cpp
@@ -118,6 +118,9 @@ struct FieldIds {
mGeolocationEnabled = env->GetFieldID(clazz, "mGeolocationEnabled", "Z");
mGeolocationDatabasePath = env->GetFieldID(clazz, "mGeolocationDatabasePath", "Ljava/lang/String;");
mXSSAuditorEnabled = env->GetFieldID(clazz, "mXSSAuditorEnabled", "Z");
+#if ENABLE(LINK_PREFETCH)
+ mLinkPrefetchEnabled = env->GetFieldID(clazz, "mLinkPrefetchEnabled", "Z");
+#endif
mJavaScriptCanOpenWindowsAutomatically = env->GetFieldID(clazz,
"mJavaScriptCanOpenWindowsAutomatically", "Z");
mUseWideViewport = env->GetFieldID(clazz, "mUseWideViewport", "Z");
@@ -245,6 +248,9 @@ struct FieldIds {
jfieldID mGeolocationEnabled;
jfieldID mGeolocationDatabasePath;
jfieldID mXSSAuditorEnabled;
+#if ENABLE(LINK_PREFETCH)
+ jfieldID mLinkPrefetchEnabled;
+#endif
#if ENABLE(DATABASE) || ENABLE(DOM_STORAGE)
jfieldID mDatabasePath;
jfieldID mDatabasePathHasBeenSet;
@@ -545,6 +551,11 @@ public:
flag = env->GetBooleanField(obj, gFieldIds->mXSSAuditorEnabled);
s->setXSSAuditorEnabled(flag);
+#if ENABLE(LINK_PREFETCH)
+ flag = env->GetBooleanField(obj, gFieldIds->mLinkPrefetchEnabled);
+ s->setLinkPrefetchEnabled(flag);
+#endif
+
size = env->GetIntField(obj, gFieldIds->mPageCacheCapacity);
if (size > 0) {
s->setUsesPageCache(true);