summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-01-24 11:11:57 +0000
committerKristian Monsen <kristianm@google.com>2011-01-24 16:20:48 +0000
commit0d22ca3d36328ab53f67cd4ab162f425b1f4d1e7 (patch)
treed2b30f264764c3ef9eb10807ef9411e0fbbbc791 /WebKit/android/jni/WebViewCore.cpp
parent5cd48bb81a0acf1f841e9fd78cae14de7112e070 (diff)
downloadexternal_webkit-0d22ca3d36328ab53f67cd4ab162f425b1f4d1e7.zip
external_webkit-0d22ca3d36328ab53f67cd4ab162f425b1f4d1e7.tar.gz
external_webkit-0d22ca3d36328ab53f67cd4ab162f425b1f4d1e7.tar.bz2
Fix for bug 3380288
Cannot create a WebRequestContext before we know if we should use private mode or not. Change-Id: I82b0dd67342a381ea1764c4d0457386ff7980be4
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 6fd7b9c..c4a0c33 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -3493,12 +3493,19 @@ bool WebViewCore::drawIsPaused() const
#if USE(CHROME_NETWORK_STACK)
void WebViewCore::setWebRequestContextUserAgent()
{
- webRequestContext()->setUserAgent(WebFrame::getWebFrame(m_mainFrame)->userAgentForURL(0)); // URL not used
+ // We cannot create a WebRequestContext, because we might not know it this is a private tab or not yet
+ if (m_webRequestContext)
+ m_webRequestContext->setUserAgent(WebFrame::getWebFrame(m_mainFrame)->userAgentForURL(0)); // URL not used
}
-void WebViewCore::setWebRequestContextCacheMode(int mode)
+void WebViewCore::setWebRequestContextCacheMode(int cacheMode)
{
- webRequestContext()->setCacheMode(mode);
+ m_cacheMode = cacheMode;
+ // We cannot create a WebRequestContext, because we might not know it this is a private tab or not yet
+ if (!m_webRequestContext)
+ return;
+
+ m_webRequestContext->setCacheMode(cacheMode);
}
WebRequestContext* WebViewCore::webRequestContext()
@@ -3506,6 +3513,8 @@ WebRequestContext* WebViewCore::webRequestContext()
if (!m_webRequestContext) {
Settings* settings = mainFrame()->settings();
m_webRequestContext = new WebRequestContext(settings && settings->privateBrowsingEnabled());
+ setWebRequestContextUserAgent();
+ setWebRequestContextCacheMode(m_cacheMode);
}
return m_webRequestContext.get();
}