https://bugs.webkit.org/show_bug.cgi?id=175769
Reviewed by Carlos Alberto Lopez Perez.
Given that the build guard exists, it should be possible to
compile the WebKit layer with the feature disabled. Missing
guards are added in order to achieve that.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::NetworkProcess::clearDiskCache):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::storeDerivedDataToCache):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221005
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-08-21 Zan Dobersek <zdobersek@igalia.com>
+
+ [WK] Add missing ENABLE(NETWORK_CACHE) build guards
+ https://bugs.webkit.org/show_bug.cgi?id=175769
+
+ Reviewed by Carlos Alberto Lopez Perez.
+
+ Given that the build guard exists, it should be possible to
+ compile the WebKit layer with the feature disabled. Missing
+ guards are added in order to achieve that.
+
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ * NetworkProcess/NetworkConnectionToWebProcess.h:
+ * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+ * NetworkProcess/NetworkProcess.h:
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::NetworkResourceLoader):
+ * NetworkProcess/soup/NetworkProcessSoup.cpp:
+ (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+ (WebKit::NetworkProcess::clearDiskCache):
+ * UIProcess/soup/WebProcessPoolSoup.cpp:
+ (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+ * WebProcess/Network/WebLoaderStrategy.cpp:
+ (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
+
2017-08-21 Chris Dumez <cdumez@apple.com>
[Beacon] Content extensions should be able to intercept Beacon / Ping redirects
});
}
+#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)
{
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);
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)
AuthenticationManager& authenticationManager();
DownloadManager& downloadManager();
+#if ENABLE(NETWORK_CACHE)
NetworkCache::Cache* cache() { return m_cache.get(); }
+#endif
bool canHandleHTTPSServerTrustEvaluation() const { return m_canHandleHTTPSServerTrustEvaluation; }
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;
, m_connection(connection)
, m_defersLoading(parameters.defersLoading)
, m_bufferingTimer(*this, &NetworkResourceLoader::bufferingTimerFired)
+#if ENABLE(NETWORK_CACHE)
, m_cache(sessionID().isEphemeral() ? nullptr : NetworkProcess::singleton().cache())
+#endif
{
ASSERT(RunLoop::isMain());
// FIXME: This is necessary because of the existence of EmptyFrameLoaderClient in WebCore.
SoupNetworkSession::clearOldSoupCache(WebCore::directoryName(m_diskCacheDirectory));
+#if ENABLE(NETWORK_CACHE)
OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify };
if (parameters.shouldEnableNetworkCacheEfficacyLogging)
cacheOptions |= NetworkCache::Cache::Option::EfficacyLogging;
#endif
m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions);
+#endif
if (!parameters.cookiePersistentStoragePath.isEmpty()) {
supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath,
void NetworkProcess::clearDiskCache(std::chrono::system_clock::time_point modifiedSince, Function<void ()>&& completionHandler)
{
+#if ENABLE(NETWORK_CACHE)
if (!m_cache)
return;
m_cache->clear(modifiedSince, WTFMove(completionHandler));
+#else
+ UNUSED_PARAM(modifiedSince);
+ UNUSED_PARAM(completionHandler);
+#endif
}
void NetworkProcess::platformTerminate()
parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
parameters.ignoreTLSErrors = m_ignoreTLSErrors;
parameters.languages = WebCore::userPreferredLanguages();
+#if ENABLE(NETWORK_CACHE)
parameters.shouldEnableNetworkCacheEfficacyLogging = false;
+#endif
parameters.proxySettings = m_networkProxySettings;
}
void WebLoaderStrategy::storeDerivedDataToCache(const SHA1::Digest& bodyHash, const String& type, const String& partition, WebCore::SharedBuffer& data)
{
+#if ENABLE(NETWORK_CACHE)
NetworkCache::DataKey key { partition, type, bodyHash };
IPC::SharedBufferDataReference dataReference { &data };
WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::StoreDerivedDataToCache(key, dataReference), 0);
+#else
+ UNUSED_PARAM(bodyHash);
+ UNUSED_PARAM(type);
+ UNUSED_PARAM(partition);
+ UNUSED_PARAM(data);
+#endif
}
void WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled(bool enabled)