[SOUP] Use a webkit subdirectory for the disk cache
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Apr 2015 07:17:07 +0000 (07:17 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Apr 2015 07:17:07 +0000 (07:17 +0000)
commit3594940cf079072db6a09cde1a81fda1d11b601c
treeaa6b11407b26177c8e59b2cd5d7d5eb65428618a
parent73673584eb8c5a985b756b4519ef7a4ba797b5b9
[SOUP] Use a webkit subdirectory for the disk cache
https://bugs.webkit.org/show_bug.cgi?id=144048

Reviewed by Martin Robinson.

Source/WebCore:

Add a static method to SoupNetworkSession to clear a soup cache
given its directory.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::strIsNumeric):
(WebCore::SoupNetworkSession::clearCache):
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit2:

Recent versions of libsoup remove any file in cache dir not
referenced by the index when the cache is loaded to workaround
leaked resources when load/dump is unbalanced for whatever reason,
like a crash. We currently use $XDG_CACHE_HOME/app-name as default
disk cache directory, but that directory could be used by apps to
cache other things, and the soup cache might end up deleting other
stuff. The soup cache assumes the given directory is only for the
disk cache, so we should ensure that.

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess): Append
webkit to the given disk cache and clear the previous soup cache if it exists.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
Source/WebCore/platform/network/soup/SoupNetworkSession.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp