Invalidate CFNetwork connection cache on memory pressure.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Apr 2014 17:45:02 +0000 (17:45 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Apr 2014 17:45:02 +0000 (17:45 +0000)
<https://webkit.org/b/131038>

Stop holding on to cached HTTP connections if we come under memory pressure.

Reviewed by Geoff Malloc-Garen.

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformLowMemoryHandler):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166597 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm

index bdee564..25e805b 100644 (file)
@@ -1,3 +1,15 @@
+2014-04-01  Andreas Kling  <akling@apple.com>
+
+        Invalidate CFNetwork connection cache on memory pressure.
+        <https://webkit.org/b/131038>
+
+        Stop holding on to cached HTTP connections if we come under memory pressure.
+
+        Reviewed by Geoff Malloc-Garen.
+
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+        (WebKit::NetworkProcess::platformLowMemoryHandler):
+
 2014-04-01  Anders Carlsson  <andersca@apple.com>
 
         Tweak WKPreferences API
index 83e8c4c..c4833cd 100644 (file)
@@ -38,6 +38,7 @@
 typedef const struct _CFURLCache* CFURLCacheRef;
 extern "C" CFURLCacheRef CFURLCacheCopySharedURLCache();
 extern "C" void _CFURLCachePurgeMemoryCache(CFURLCacheRef);
+extern "C" void CFURLConnectionInvalidateConnectionCache();
 
 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
 extern "C" void _CFURLCacheSetMinSizeForVMCachedResource(CFURLCacheRef, CFIndex);
@@ -47,6 +48,7 @@ namespace WebKit {
 
 void NetworkProcess::platformLowMemoryHandler(bool)
 {
+    CFURLConnectionInvalidateConnectionCache();
     _CFURLCachePurgeMemoryCache(adoptCF(CFURLCacheCopySharedURLCache()).get());
 }