Split calculateCacheSizes in two methods
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jul 2016 05:22:14 +0000 (05:22 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jul 2016 05:22:14 +0000 (05:22 +0000)
commit3451cca62c3129a07a8f419eda20f83c362a6507
treef91b3d5a749210abcf26a0a6cbad813b1d07652b
parent75399f033d14ada35734b45bee01bfa7c1006977
Split calculateCacheSizes in two methods
https://bugs.webkit.org/show_bug.cgi?id=160237

Reviewed by Darin Adler.

Source/WebCore:

Rename getVolumeFreeSizeForPath as volumeFreeSizeForPath and make it available to all platforms adding an
implementation for mac.

* platform/FileSystem.h:
* platform/efl/FileSystemEfl.cpp:
(WebCore::volumeFreeSizeForPath):
(WebCore::getVolumeFreeSizeForPath): Deleted.
* platform/glib/FileSystemGlib.cpp:
(WebCore::volumeFreeSizeForPath):
(WebCore::getVolumeFreeSizeForPath): Deleted.
* platform/mac/FileSystemMac.mm:
(WebCore::volumeFreeSizeForPath):
* platform/win/FileSystemWin.cpp:
(WebCore::volumeFreeSizeForPath):

Source/WebKit2:

It's used to calculate memory and disk cache sizes, but only the web process is interested in memory caches, and
the network process in disk cache. We can also avoid a lot of duplicated code between ports to set the cache model.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setCacheModel): Use calculateURLCacheSizes to set the disk cache size and call
platformSetURLCacheSize if not set to allow ports to setup platform specific cache.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSetURLCacheSize): Remove common code that is now in cross-platform file.
(WebKit::volumeFreeSize): Deleted.
(WebKit::NetworkProcess::platformSetCacheModel): Renamed to platformSetURLCacheSize().
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformSetURLCacheSize): Remove common code that is now in cross-platform file.
(WebKit::getCacheDiskFreeSize): Deleted.
(WebKit::NetworkProcess::platformSetCacheModel): Renamed to platformSetURLCacheSize().
* Shared/CacheModel.cpp:
(WebKit::calculateMemoryCacheSizes): Calculate the memory and page cache sizes.
(WebKit::calculateURLCacheSizes): Calculate the disk cache size.
(WebKit::calculateCacheSizes): Deleted.
* Shared/CacheModel.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess): Tell the page cache to clear backing stores for GTK+ port too. This was done before when
setting the cache model.
(WebKit::WebProcess::setCacheModel): Use calculateMemoryCacheSizes to setup memory caches and call
platformSetCacheModel to allow ports do more setup according to the cache model.
(WebKit::WebProcess::clearResourceCaches): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetCacheModel): Remove common code that is now in cross-platform file.
(WebKit::volumeFreeSize): Deleted.
(WebKit::WebProcess::platformClearResourceCaches): Deleted.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel): Remove common code that is now in cross-platform file.
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformClearResourceCaches): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203857 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/FileSystem.h
Source/WebCore/platform/efl/FileSystemEfl.cpp
Source/WebCore/platform/glib/FileSystemGlib.cpp
Source/WebCore/platform/mac/FileSystemMac.mm
Source/WebCore/platform/win/FileSystemWin.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.h
Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit2/Shared/CacheModel.cpp
Source/WebKit2/Shared/CacheModel.h
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp