Skip to content
Permalink
Browse files
Remove ENABLE_NETWORK_CACHE
https://bugs.webkit.org/show_bug.cgi?id=177424

Reviewed by Antti Koivisto.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::clearDiskCacheEntries):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::cache):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::canUseCachedRedirect const):
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFailLoading):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheCoders.cpp:
* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
* NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
* NetworkProcess/cache/NetworkCacheData.cpp:
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
* NetworkProcess/cache/NetworkCacheDataSoup.cpp:
* NetworkProcess/cache/NetworkCacheEntry.cpp:
* NetworkProcess/cache/NetworkCacheEntry.h:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheIOChannel.h:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
* NetworkProcess/cache/NetworkCacheKey.cpp:
* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
* NetworkProcess/cache/NetworkCacheStatistics.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
(WebKit::NetworkProcess::clearDiskCache):
* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::clearCacheForAllOrigins):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::NetworkProcess::clearDiskCache):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
(WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
(WebKit::WebProcessPool::isNetworkCacheEnabled):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::storeDerivedDataToCache):
* config.h:


Canonical link: https://commits.webkit.org/194419@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
donny-dont committed Oct 11, 2017
1 parent 212306d commit 903d1aba613b1c83997dbe727dd8bc57718e591a
Showing 42 changed files with 83 additions and 198 deletions.
@@ -1,3 +1,83 @@
2017-10-11 Don Olmstead <don.olmstead@sony.com>

Remove ENABLE_NETWORK_CACHE
https://bugs.webkit.org/show_bug.cgi?id=177424

Reviewed by Antti Koivisto.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::clearDiskCacheEntries):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::cache):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::canUseCachedRedirect const):
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFailLoading):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheCoders.cpp:
* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
* NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
* NetworkProcess/cache/NetworkCacheData.cpp:
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
* NetworkProcess/cache/NetworkCacheDataSoup.cpp:
* NetworkProcess/cache/NetworkCacheEntry.cpp:
* NetworkProcess/cache/NetworkCacheEntry.h:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheIOChannel.h:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
* NetworkProcess/cache/NetworkCacheKey.cpp:
* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
* NetworkProcess/cache/NetworkCacheStatistics.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
(WebKit::NetworkProcess::clearDiskCache):
* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::clearCacheForAllOrigins):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::NetworkProcess::clearDiskCache):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
(WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
(WebKit::WebProcessPool::isNetworkCacheEnabled):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::storeDerivedDataToCache):
* config.h:

2017-10-11 Michael Catanzaro <mcatanzaro@igalia.com>

Unreviewed, rolling out r223146.
@@ -454,13 +454,11 @@ void NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles(const Vector<Stri
});
}

#if ENABLE(NETWORK_CACHE)
void NetworkConnectionToWebProcess::storeDerivedDataToCache(const WebKit::NetworkCache::DataKey& dataKey, const IPC::DataReference& data)
{
if (auto* cache = NetworkProcess::singleton().cache())
cache->storeData(dataKey, data.data(), data.size());
}
#endif

void NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled(bool enabled)
{
@@ -118,9 +118,7 @@ class NetworkConnectionToWebProcess : public RefCounted<NetworkConnectionToWebPr
void unregisterBlobURL(const WebCore::URL&);
void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, uint64_t requestIdentifier);

#if ENABLE(NETWORK_CACHE)
void storeDerivedDataToCache(const WebKit::NetworkCache::DataKey&, const IPC::DataReference&);
#endif

void setCaptureExtraNetworkLoadMetricsEnabled(bool);

@@ -50,9 +50,7 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver {
BlobSize(WebCore::URL url) -> (uint64_t resultSize)
WriteBlobsToTemporaryFiles(Vector<String> blobURLs, uint64_t requestIdentifier)

#if ENABLE(NETWORK_CACHE)
StoreDerivedDataToCache(WebKit::NetworkCache::DataKey key, IPC::DataReference data)
#endif

SetCaptureExtraNetworkLoadMetricsEnabled(bool enabled)

@@ -74,10 +74,8 @@
#include "SecItemShim.h"
#endif

#if ENABLE(NETWORK_CACHE)
#include "NetworkCache.h"
#include "NetworkCacheCoders.h"
#endif

#if ENABLE(NETWORK_CAPTURE)
#include "NetworkCaptureManager.h"
@@ -337,7 +335,6 @@ void NetworkProcess::removePrevalentDomains(PAL::SessionID sessionID, const Vect

static void fetchDiskCacheEntries(PAL::SessionID sessionID, OptionSet<WebsiteDataFetchOption> fetchOptions, Function<void (Vector<WebsiteData::Entry>)>&& completionHandler)
{
#if ENABLE(NETWORK_CACHE)
if (auto* cache = NetworkProcess::singleton().cache()) {
HashMap<SecurityOriginData, uint64_t> originsAndSizes;
cache->traverse([fetchOptions, completionHandler = WTFMove(completionHandler), originsAndSizes = WTFMove(originsAndSizes)](auto* traversalEntry) mutable {
@@ -363,7 +360,6 @@ static void fetchDiskCacheEntries(PAL::SessionID sessionID, OptionSet<WebsiteDat

return;
}
#endif

RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] {
completionHandler({ });
@@ -445,7 +441,6 @@ void NetworkProcess::deleteWebsiteData(PAL::SessionID sessionID, OptionSet<Websi

static void clearDiskCacheEntries(const Vector<SecurityOriginData>& origins, Function<void ()>&& completionHandler)
{
#if ENABLE(NETWORK_CACHE)
if (auto* cache = NetworkProcess::singleton().cache()) {
HashSet<RefPtr<SecurityOrigin>> originsToDelete;
for (auto& origin : origins)
@@ -465,7 +460,6 @@ static void clearDiskCacheEntries(const Vector<SecurityOriginData>& origins, Fun

return;
}
#endif

RunLoop::main().dispatch(WTFMove(completionHandler));
}
@@ -608,12 +602,10 @@ void NetworkProcess::setCacheModel(uint32_t cm)
if (m_diskCacheSizeOverride >= 0)
urlCacheDiskCapacity = m_diskCacheSizeOverride;

#if ENABLE(NETWORK_CACHE)
if (m_cache) {
m_cache->setCapacity(urlCacheDiskCapacity);
return;
}
#endif

platformSetURLCacheSize(urlCacheMemoryCapacity, urlCacheDiskCapacity);
}
@@ -100,9 +100,7 @@ class NetworkProcess : public ChildProcess, private DownloadManager::Client {
AuthenticationManager& authenticationManager();
DownloadManager& downloadManager();

#if ENABLE(NETWORK_CACHE)
NetworkCache::Cache* cache() { return m_cache.get(); }
#endif

bool canHandleHTTPSServerTrustEvaluation() const { return m_canHandleHTTPSServerTrustEvaluation; }

@@ -248,9 +246,7 @@ class NetworkProcess : public ChildProcess, private DownloadManager::Client {
bool m_canHandleHTTPSServerTrustEvaluation;
Seconds m_loadThrottleLatency;

#if ENABLE(NETWORK_CACHE)
RefPtr<NetworkCache::Cache> m_cache;
#endif

typedef HashMap<const char*, std::unique_ptr<NetworkProcessSupplement>, PtrHash<const char*>> NetworkProcessSupplementMap;
NetworkProcessSupplementMap m_supplements;
@@ -50,13 +50,11 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const
encoder << cacheStorageDirectoryExtensionHandle;
encoder << diskCacheDirectory;
encoder << diskCacheDirectoryExtensionHandle;
#if ENABLE(NETWORK_CACHE)
encoder << shouldEnableNetworkCache;
encoder << shouldEnableNetworkCacheEfficacyLogging;
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
encoder << shouldEnableNetworkCacheSpeculativeRevalidation;
#endif
#endif
#if PLATFORM(MAC)
encoder << uiProcessCookieStorageIdentifier;
#endif
@@ -125,7 +123,6 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc
return false;
if (!decoder.decode(result.diskCacheDirectoryExtensionHandle))
return false;
#if ENABLE(NETWORK_CACHE)
if (!decoder.decode(result.shouldEnableNetworkCache))
return false;
if (!decoder.decode(result.shouldEnableNetworkCacheEfficacyLogging))
@@ -134,7 +131,6 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc
if (!decoder.decode(result.shouldEnableNetworkCacheSpeculativeRevalidation))
return false;
#endif
#endif
#if PLATFORM(MAC)
if (!decoder.decode(result.uiProcessCookieStorageIdentifier))
return false;
@@ -60,13 +60,11 @@ struct NetworkProcessCreationParameters {
SandboxExtension::Handle cacheStorageDirectoryExtensionHandle;
String diskCacheDirectory;
SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
#if ENABLE(NETWORK_CACHE)
bool shouldEnableNetworkCache { false };
bool shouldEnableNetworkCacheEfficacyLogging { false };
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
bool shouldEnableNetworkCacheSpeculativeRevalidation { false };
#endif
#endif
#if PLATFORM(MAC)
Vector<uint8_t> uiProcessCookieStorageIdentifier;
#endif

0 comments on commit 903d1ab

Please sign in to comment.