diff options
author | Selim Gurun <sgurun@google.com> | 2012-02-14 12:08:25 -0800 |
---|---|---|
committer | Selim Gurun <sgurun@google.com> | 2012-02-15 10:05:32 -0800 |
commit | d61e19d1adc4e5fd664a3a5e5c0fd1141e697345 (patch) | |
tree | cc0c93ac0e5cfca9d7d096dd54dcef30e3f85476 /Source/WebKit/android | |
parent | 82921a8052f869822cbd9fb6d54750c480ac9054 (diff) | |
download | external_webkit-d61e19d1adc4e5fd664a3a5e5c0fd1141e697345.zip external_webkit-d61e19d1adc4e5fd664a3a5e5c0fd1141e697345.tar.gz external_webkit-d61e19d1adc4e5fd664a3a5e5c0fd1141e697345.tar.bz2 |
Clean cached trust state on system storage update.
Bug: 6009802
When credential storage is updated, reset any states in network layer
that caches information.
Change-Id: I551cd84645e40991234b18801216907ae7ab6579
Diffstat (limited to 'Source/WebKit/android')
-rw-r--r-- | Source/WebKit/android/WebCoreSupport/WebCache.cpp | 17 | ||||
-rw-r--r-- | Source/WebKit/android/WebCoreSupport/WebCache.h | 3 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 10 |
3 files changed, 28 insertions, 2 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/WebCache.cpp b/Source/WebKit/android/WebCoreSupport/WebCache.cpp index 9b505ee..82e3b27 100644 --- a/Source/WebKit/android/WebCoreSupport/WebCache.cpp +++ b/Source/WebKit/android/WebCoreSupport/WebCache.cpp @@ -30,7 +30,7 @@ #include "WebCoreJni.h" #include "WebRequestContext.h" #include "WebUrlLoaderClient.h" - +#include "net/http/http_network_session.h" #include <wtf/text/CString.h> using namespace WTF; @@ -131,6 +131,21 @@ void WebCache::clear() thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this, &WebCache::clearImpl)); } +void WebCache::certTrustChanged() +{ + base::Thread* thread = WebUrlLoaderClient::ioThread(); + if (thread) + thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this, &WebCache::certTrustChangedImpl)); +} + +void WebCache::certTrustChangedImpl() +{ + net::HttpNetworkSession* session = m_cache->GetSession(); + if (session) + session->cert_verifier()->ClearCache(); + m_cache->CloseAllConnections(); +} + void WebCache::closeIdleConnections() { base::Thread* thread = WebUrlLoaderClient::ioThread(); diff --git a/Source/WebKit/android/WebCoreSupport/WebCache.h b/Source/WebKit/android/WebCoreSupport/WebCache.h index c3b623d..ad57d88 100644 --- a/Source/WebKit/android/WebCoreSupport/WebCache.h +++ b/Source/WebKit/android/WebCoreSupport/WebCache.h @@ -48,7 +48,7 @@ public: net::HttpCache* cache() { return m_cache.get(); } net::ProxyConfigServiceAndroid* proxy() { return m_proxyConfigService; } void closeIdleConnections(); - + void certTrustChanged(); private: WebCache(bool isPrivateBrowsing); @@ -60,6 +60,7 @@ private: // For closeIdleConnections void closeIdleImpl(); + void certTrustChangedImpl(); // For getEntry() void getEntryImpl(); diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index fd1a833..6fbabec 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -4961,6 +4961,14 @@ static void CloseIdleConnections(JNIEnv* env, jobject obj, jint nativeClass) #endif } +static void nativeCertTrustChanged(JNIEnv *env, jobject obj) +{ +#if USE(CHROME_NETWORK_STACK) + WebCache::get(true)->certTrustChanged(); + WebCache::get(false)->certTrustChanged(); +#endif +} + static void ScrollRenderLayer(JNIEnv* env, jobject obj, jint nativeClass, jint layer, jobject jRect) { @@ -5147,6 +5155,8 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) SelectWordAt }, { "nativeSelectAll", "(I)V", (void*) SelectAll }, + { "nativeCertTrustChanged","()V", + (void*) nativeCertTrustChanged }, }; int registerWebViewCore(JNIEnv* env) |