summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-01-19 16:02:50 +0000
committerKristian Monsen <kristianm@google.com>2011-01-19 17:45:23 +0000
commitf7bd628182bcc30048a111c13fff3ac631ba1640 (patch)
tree725b20a5e2a9e42ee6cadd13313694842634070c /WebKit/android/jni
parentdfdc11618f4880565489123e312150d531c690ed (diff)
downloadexternal_webkit-f7bd628182bcc30048a111c13fff3ac631ba1640.zip
external_webkit-f7bd628182bcc30048a111c13fff3ac631ba1640.tar.gz
external_webkit-f7bd628182bcc30048a111c13fff3ac631ba1640.tar.bz2
Passing WebSettings cacheMode to the chrome load_flags
Fixes a few CTS tests Change-Id: I1b72813b828a6aa24522e9ffb2ff17a3e364f7bf
Diffstat (limited to 'WebKit/android/jni')
-rw-r--r--WebKit/android/jni/WebSettings.cpp9
-rw-r--r--WebKit/android/jni/WebViewCore.cpp9
-rw-r--r--WebKit/android/jni/WebViewCore.h3
3 files changed, 18 insertions, 3 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp
index e4b30c3..3712135 100644
--- a/WebKit/android/jni/WebSettings.cpp
+++ b/WebKit/android/jni/WebSettings.cpp
@@ -147,6 +147,9 @@ struct FieldIds {
mAutoFillProfilePhoneNumber = env->GetFieldID(autoFillProfileClass, "mPhoneNumber", "Ljava/lang/String;");
env->DeleteLocalRef(autoFillProfileClass);
#endif
+#if USE(CHROME_NETWORK_STACK)
+ mOverrideCacheMode = env->GetFieldID(clazz, "mOverrideCacheMode", "I");
+#endif
LOG_ASSERT(mLayoutAlgorithm, "Could not find field mLayoutAlgorithm");
LOG_ASSERT(mTextSize, "Could not find field mTextSize");
@@ -270,6 +273,9 @@ struct FieldIds {
jfieldID mAutoFillProfileCountry;
jfieldID mAutoFillProfilePhoneNumber;
#endif
+#if USE(CHROME_NETWORK_STACK)
+ jfieldID mOverrideCacheMode;
+#endif
};
static struct FieldIds* gFieldIds;
@@ -372,6 +378,9 @@ public:
#if USE(CHROME_NETWORK_STACK)
WebViewCore::getWebViewCore(pFrame->view())->setWebRequestContextUserAgent();
+ jint cacheMode = env->GetIntField(obj, gFieldIds->mOverrideCacheMode);
+ WebViewCore::getWebViewCore(pFrame->view())->setWebRequestContextCacheMode(cacheMode);
+
str = (jstring)env->GetObjectField(obj, gFieldIds->mAcceptLanguage);
WebRequestContext::setAcceptLanguage(jstringToWtfString(env, str));
#endif
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 69585b2..defa66e 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -3477,8 +3477,12 @@ bool WebViewCore::drawIsPaused() const
#if USE(CHROME_NETWORK_STACK)
void WebViewCore::setWebRequestContextUserAgent()
{
- if (m_webRequestContext)
- m_webRequestContext->setUserAgent(WebFrame::getWebFrame(m_mainFrame)->userAgentForURL(0)); // URL not used
+ webRequestContext()->setUserAgent(WebFrame::getWebFrame(m_mainFrame)->userAgentForURL(0)); // URL not used
+}
+
+void WebViewCore::setWebRequestContextCacheMode(int mode)
+{
+ webRequestContext()->setCacheMode(mode);
}
WebRequestContext* WebViewCore::webRequestContext()
@@ -3486,7 +3490,6 @@ WebRequestContext* WebViewCore::webRequestContext()
if (!m_webRequestContext) {
Settings* settings = mainFrame()->settings();
m_webRequestContext = new WebRequestContext(settings && settings->privateBrowsingEnabled());
- setWebRequestContextUserAgent();
}
return m_webRequestContext.get();
}
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index f6c6f66..4d1110f 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -566,8 +566,11 @@ namespace android {
bool isPaused() const { return m_isPaused; }
void setIsPaused(bool isPaused) { m_isPaused = isPaused; }
bool drawIsPaused() const;
+#if USE(CHROME_NETWORK_STACK)
void setWebRequestContextUserAgent();
+ void setWebRequestContextCacheMode(int mode);
WebRequestContext* webRequestContext();
+#endif
// end of shared members
// internal functions