Modernize CacheModel and disk cache fetching and clearing
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2019 13:56:42 +0000 (13:56 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2019 13:56:42 +0000 (13:56 +0000)
commitca999f0cd2ac945ca2f29630c96ce036efa371df
tree01c3bb252dafdcd355151f295844b2893bcd6bc7
parent5a4e5ccf7254d6814fa361e632120b23305b605b
Modernize CacheModel and disk cache fetching and clearing
https://bugs.webkit.org/show_bug.cgi?id=193164

Reviewed by Joseph Pecoraro.

fetchDiskCacheEntries and clearDiskCacheEntries now use an early-return model.
CacheModel is now an enum class.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::fetchDiskCacheEntries):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::clearDiskCacheEntries):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::clearDiskCache):
* Shared/CacheModel.cpp:
(WebKit::calculateMemoryCacheSizes):
(WebKit::calculateURLCacheSizes):
* Shared/CacheModel.h:
(): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKAPICast.h:
(WebKit::toCacheModel):
(WebKit::toAPI):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration pageCacheEnabled]):
(-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setCacheModel):
(WebKit::WebProcess::clearResourceCaches):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/NetworkProcess.messages.in
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.cpp
Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp
Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit/Shared/CacheModel.cpp
Source/WebKit/Shared/CacheModel.h
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/C/WKAPICast.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp
Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebProcess.h
Source/WebKit/WebProcess/WebProcess.messages.in
Source/WebKit/WebProcess/soup/WebProcessSoup.cpp