summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/WebCoreSupport
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-08-25 20:33:21 +0100
committerKristian Monsen <kristianm@google.com>2011-09-02 02:09:30 +0100
commit76859bf6d78119b2bf4fe2aa2c2a4761fa90503c (patch)
treed43211938e817ca1e103dc22972c4243835fb806 /Source/WebKit/android/WebCoreSupport
parentb6b02e9acdbe69eeecb5416f6019f80f8a443350 (diff)
downloadexternal_webkit-76859bf6d78119b2bf4fe2aa2c2a4761fa90503c.zip
external_webkit-76859bf6d78119b2bf4fe2aa2c2a4761fa90503c.tar.gz
external_webkit-76859bf6d78119b2bf4fe2aa2c2a4761fa90503c.tar.bz2
Closing idle connections, including jni interface
Part of fix for bug 4487538 Current Drain Change-Id: Ib08ea52c1c71726b76a5811663b6990aa13146ad
Diffstat (limited to 'Source/WebKit/android/WebCoreSupport')
-rw-r--r--Source/WebKit/android/WebCoreSupport/WebCache.cpp12
-rw-r--r--Source/WebKit/android/WebCoreSupport/WebCache.h5
2 files changed, 17 insertions, 0 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/WebCache.cpp b/Source/WebKit/android/WebCoreSupport/WebCache.cpp
index a15bf7f..3c49430 100644
--- a/Source/WebKit/android/WebCoreSupport/WebCache.cpp
+++ b/Source/WebKit/android/WebCoreSupport/WebCache.cpp
@@ -134,6 +134,18 @@ void WebCache::clear()
thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this, &WebCache::clearImpl));
}
+void WebCache::closeIdleConnections()
+{
+ base::Thread* thread = WebUrlLoaderClient::ioThread();
+ if (thread)
+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this, &WebCache::closeIdleImpl));
+}
+
+void WebCache::closeIdleImpl()
+{
+ m_cache->CloseIdleConnections();
+}
+
void WebCache::clearImpl()
{
if (m_isClearInProgress)
diff --git a/Source/WebKit/android/WebCoreSupport/WebCache.h b/Source/WebKit/android/WebCoreSupport/WebCache.h
index 7149fcc..c3b623d 100644
--- a/Source/WebKit/android/WebCoreSupport/WebCache.h
+++ b/Source/WebKit/android/WebCoreSupport/WebCache.h
@@ -47,6 +47,8 @@ public:
net::HostResolver* hostResolver() { return m_hostResolver.get(); }
net::HttpCache* cache() { return m_cache.get(); }
net::ProxyConfigServiceAndroid* proxy() { return m_proxyConfigService; }
+ void closeIdleConnections();
+
private:
WebCache(bool isPrivateBrowsing);
@@ -56,6 +58,9 @@ private:
void doomAllEntries(int);
void onClearDone(int);
+ // For closeIdleConnections
+ void closeIdleImpl();
+
// For getEntry()
void getEntryImpl();
void openEntry(int);