Diff
Modified: trunk/Source/WebCore/PAL/ChangeLog (232200 => 232201)
--- trunk/Source/WebCore/PAL/ChangeLog 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebCore/PAL/ChangeLog 2018-05-25 21:27:19 UTC (rev 232201)
@@ -1,3 +1,14 @@
+2018-05-25 Chris Dumez <[email protected]>
+
+ Drop support for NSURLCache in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=185990
+
+ Reviewed by Geoffrey Garen.
+
+ Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable.
+
+ * pal/spi/cf/CFNetworkSPI.h:
+
2018-05-24 Jiewen Tan <[email protected]>
Adopt SecKeyProxy SPI in certificate based challenge response code
Modified: trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (232200 => 232201)
--- trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h 2018-05-25 21:27:19 UTC (rev 232201)
@@ -88,7 +88,6 @@
#if defined(__OBJC__)
@interface NSURLCache ()
--(instancetype)_initWithMemoryCapacity:(NSUInteger)memoryCapacity diskCapacity:(NSUInteger)diskCapacity relativePath:(NSString *)path;
- (CFURLCacheRef)_CFURLCache;
@end
Modified: trunk/Source/WebKit/ChangeLog (232200 => 232201)
--- trunk/Source/WebKit/ChangeLog 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/ChangeLog 2018-05-25 21:27:19 UTC (rev 232201)
@@ -1,3 +1,75 @@
+2018-05-25 Chris Dumez <[email protected]>
+
+ Drop support for NSURLCache in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=185990
+
+ Reviewed by Geoffrey Garen.
+
+ Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable.
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::setCacheModel):
+ * NetworkProcess/NetworkProcess.h:
+ * NetworkProcess/NetworkProcessCreationParameters.cpp:
+ (WebKit::NetworkProcessCreationParameters::encode const):
+ (WebKit::NetworkProcessCreationParameters::decode):
+ * NetworkProcess/NetworkProcessCreationParameters.h:
+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+ (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
+ (WebKit::NetworkProcess::clearDiskCache):
+ (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
+ (WebKit::clearNSURLCache): Deleted.
+ * NetworkProcess/cocoa/NetworkSessionCocoa.h:
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+ (): Deleted.
+ (WebKit::NetworkSessionCocoa::setUsesNetworkCache): Deleted.
+ * NetworkProcess/curl/NetworkProcessCurl.cpp:
+ (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
+ * NetworkProcess/soup/NetworkProcessSoup.cpp:
+ (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+ (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
+ (WebKit::WebProcessPool::isNetworkCacheEnabled): Deleted.
+ * UIProcess/WebProcessPool.h:
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::suggestedFilenameForResourceWithURL const):
+ (WebKit::WebFrame::mimeTypeForResourceWithURL const):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::getResourceDataFromFrame):
+ (WebKit::WebPage::hasLocalDataForURL):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+ (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
+ (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
+ (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
+ (WebKit::WebPage::cachedResponseDataForURL): Deleted.
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
+ (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
+ (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
+ (WebKit::WebPage::cachedResponseDataForURL): Deleted.
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::accessibilityRemoteObject):
+ (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
+ (WebKit::cachedResponseForURL): Deleted.
+ (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
+ (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
+ (WebKit::WebPage::cachedResponseDataForURL): Deleted.
+ * WebProcess/WebPage/win/WebPageWin.cpp:
+ (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
+ (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
+ (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
+ (WebKit::WebPage::cachedResponseDataForURL): Deleted.
+ * WebProcess/WebPage/wpe/WebPageWPE.cpp:
+ (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
+ (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
+ (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
+ (WebKit::WebPage::cachedResponseDataForURL): Deleted.
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+
2018-05-25 Alex Christensen <[email protected]>
Fix internal iOS builds after r232198
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -724,12 +724,8 @@
if (m_diskCacheSizeOverride >= 0)
urlCacheDiskCapacity = m_diskCacheSizeOverride;
- if (m_cache) {
+ if (m_cache)
m_cache->setCapacity(urlCacheDiskCapacity);
- return;
- }
-
- platformSetURLCacheSize(urlCacheMemoryCapacity, urlCacheDiskCapacity);
}
void NetworkProcess::setCanHandleHTTPSServerTrustEvaluation(bool value)
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2018-05-25 21:27:19 UTC (rev 232201)
@@ -243,9 +243,6 @@
void setNetworkProxySettings(const WebCore::SoupNetworkProxySettings&);
#endif
- // Platform Helpers
- void platformSetURLCacheSize(unsigned urlCacheMemoryCapacity, uint64_t urlCacheDiskCapacity);
-
#if PLATFORM(COCOA)
static void setSharedHTTPCookieStorage(const Vector<uint8_t>& identifier);
#endif
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -51,7 +51,6 @@
encoder << cacheStorageDirectoryExtensionHandle;
encoder << diskCacheDirectory;
encoder << diskCacheDirectoryExtensionHandle;
- encoder << shouldEnableNetworkCache;
encoder << shouldEnableNetworkCacheEfficacyLogging;
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
encoder << shouldEnableNetworkCacheSpeculativeRevalidation;
@@ -72,8 +71,6 @@
#if PLATFORM(COCOA)
encoder << parentProcessName;
encoder << uiProcessBundleIdentifier;
- encoder << nsURLCacheMemoryCapacity;
- encoder << nsURLCacheDiskCapacity;
encoder << sourceApplicationBundleIdentifier;
encoder << sourceApplicationSecondaryIdentifier;
#if PLATFORM(IOS)
@@ -156,8 +153,6 @@
return false;
result.diskCacheDirectoryExtensionHandle = WTFMove(*diskCacheDirectoryExtensionHandle);
- if (!decoder.decode(result.shouldEnableNetworkCache))
- return false;
if (!decoder.decode(result.shouldEnableNetworkCacheEfficacyLogging))
return false;
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
@@ -202,10 +197,6 @@
return false;
if (!decoder.decode(result.uiProcessBundleIdentifier))
return false;
- if (!decoder.decode(result.nsURLCacheMemoryCapacity))
- return false;
- if (!decoder.decode(result.nsURLCacheDiskCapacity))
- return false;
if (!decoder.decode(result.sourceApplicationBundleIdentifier))
return false;
if (!decoder.decode(result.sourceApplicationSecondaryIdentifier))
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h 2018-05-25 21:27:19 UTC (rev 232201)
@@ -61,7 +61,6 @@
SandboxExtension::Handle cacheStorageDirectoryExtensionHandle;
String diskCacheDirectory;
SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
- bool shouldEnableNetworkCache { false };
bool shouldEnableNetworkCacheEfficacyLogging { false };
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
bool shouldEnableNetworkCacheSpeculativeRevalidation { false };
@@ -84,8 +83,6 @@
#if PLATFORM(COCOA)
String parentProcessName;
String uiProcessBundleIdentifier;
- uint64_t nsURLCacheMemoryCapacity;
- uint64_t nsURLCacheDiskCapacity;
String sourceApplicationBundleIdentifier;
String sourceApplicationSecondaryIdentifier;
#if PLATFORM(IOS)
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm 2018-05-25 21:27:19 UTC (rev 232201)
@@ -27,6 +27,7 @@
#import "NetworkProcess.h"
#import "CookieStorageUtilsCF.h"
+#import "Logging.h"
#import "NetworkCache.h"
#import "NetworkProcessCreationParameters.h"
#import "NetworkResourceLoader.h"
@@ -88,7 +89,6 @@
NetworkSessionCocoa::setSourceApplicationAuditTokenData(sourceApplicationAuditData());
NetworkSessionCocoa::setSourceApplicationBundleIdentifier(parameters.sourceApplicationBundleIdentifier);
NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier(parameters.sourceApplicationSecondaryIdentifier);
- NetworkSessionCocoa::setUsesNetworkCache(parameters.shouldEnableNetworkCache);
#if PLATFORM(IOS)
NetworkSessionCocoa::setCTDataConnectionServiceType(parameters.ctDataConnectionServiceType);
#endif
@@ -107,7 +107,7 @@
// - disk cache size passed from UI process is effectively a minimum size.
// One non-obvious constraint is that we need to use -setSharedURLCache: even in testing mode, to prevent creating a default one on disk later, when some other code touches the cache.
- ASSERT(!m_diskCacheIsDisabledForTesting || !parameters.nsURLCacheDiskCapacity);
+ ASSERT(!m_diskCacheIsDisabledForTesting);
if (!parameters.cacheStorageDirectory.isNull()) {
m_cacheStorageDirectory = parameters.cacheStorageDirectory;
@@ -119,46 +119,28 @@
initializeWiFiAssertions(parameters);
#endif
- if (!m_diskCacheDirectory.isNull()) {
- SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
- if (parameters.shouldEnableNetworkCache) {
- OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify };
- if (parameters.shouldEnableNetworkCacheEfficacyLogging)
- cacheOptions |= NetworkCache::Cache::Option::EfficacyLogging;
- if (parameters.shouldUseTestingNetworkSession)
- cacheOptions |= NetworkCache::Cache::Option::TestingMode;
+ if (m_diskCacheDirectory.isNull())
+ return;
+
+ SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
+ OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify };
+ if (parameters.shouldEnableNetworkCacheEfficacyLogging)
+ cacheOptions |= NetworkCache::Cache::Option::EfficacyLogging;
+ if (parameters.shouldUseTestingNetworkSession)
+ cacheOptions |= NetworkCache::Cache::Option::TestingMode;
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
- if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation)
- cacheOptions |= NetworkCache::Cache::Option::SpeculativeRevalidation;
+ if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation)
+ cacheOptions |= NetworkCache::Cache::Option::SpeculativeRevalidation;
#endif
- m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions);
- if (m_cache) {
- // Disable NSURLCache.
- auto urlCache(adoptNS([[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]));
- [NSURLCache setSharedURLCache:urlCache.get()];
- return;
- }
- }
- String nsURLCacheDirectory = m_diskCacheDirectory;
-#if PLATFORM(IOS)
- // NSURLCache path is relative to network process cache directory.
- // This puts cache files under <container>/Library/Caches/com.apple.WebKit.Networking/
- nsURLCacheDirectory = ".";
-#endif
- [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc]
- initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity
- diskCapacity:parameters.nsURLCacheDiskCapacity
- diskPath:nsURLCacheDirectory]).get()];
- }
-}
+ m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions);
+ if (!m_cache)
+ RELEASE_LOG_ERROR(NetworkCache, "Failed to initialize the WebKit network disk cache");
-void NetworkProcess::platformSetURLCacheSize(unsigned urlCacheMemoryCapacity, uint64_t urlCacheDiskCapacity)
-{
- NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
- [nsurlCache setMemoryCapacity:urlCacheMemoryCapacity];
- if (!m_diskCacheIsDisabledForTesting)
- [nsurlCache setDiskCapacity:std::max<uint64_t>(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn.
+ // Disable NSURLCache.
+ auto urlCache(adoptNS([[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]));
+ [NSURLCache setSharedURLCache:urlCache.get()];
+ return;
}
RetainPtr<CFDataRef> NetworkProcess::sourceApplicationAuditData() const
@@ -182,21 +164,6 @@
_CFNetworkResetHSTSHostsSinceDate(session.platformSession(), (__bridge CFDateRef)date);
}
-static void clearNSURLCache(dispatch_group_t group, WallTime modifiedSince, Function<void ()>&& completionHandler)
-{
- dispatch_group_async(group, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), BlockPtr<void()>::fromCallable([modifiedSince, completionHandler = WTFMove(completionHandler)] () mutable {
- NSURLCache *cache = [NSURLCache sharedURLCache];
-
- NSTimeInterval timeInterval = modifiedSince.secondsSinceEpoch().seconds();
- NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeInterval];
- [cache removeCachedResponsesSinceDate:date];
-
- dispatch_async(dispatch_get_main_queue(), BlockPtr<void()>::fromCallable([completionHandler = WTFMove(completionHandler)] {
- completionHandler();
- }).get());
- }).get());
-}
-
void NetworkProcess::clearDiskCache(WallTime modifiedSince, Function<void ()>&& completionHandler)
{
if (!m_clearCacheDispatchGroup)
@@ -204,15 +171,11 @@
if (auto* cache = NetworkProcess::singleton().cache()) {
auto group = m_clearCacheDispatchGroup;
- dispatch_group_async(group, dispatch_get_main_queue(), BlockPtr<void()>::fromCallable([cache, group, modifiedSince, completionHandler = WTFMove(completionHandler)] () mutable {
- cache->clear(modifiedSince, [group, modifiedSince, completionHandler = WTFMove(completionHandler)] () mutable {
- // FIXME: Probably not necessary.
- clearNSURLCache(group, modifiedSince, WTFMove(completionHandler));
+ dispatch_group_async(group, dispatch_get_main_queue(), BlockPtr<void()>::fromCallable([cache, modifiedSince, completionHandler = WTFMove(completionHandler)] () mutable {
+ cache->clear(modifiedSince, [completionHandler = WTFMove(completionHandler)] () mutable {
});
}).get());
- return;
}
- clearNSURLCache(m_clearCacheDispatchGroup, modifiedSince, WTFMove(completionHandler));
}
#if PLATFORM(COCOA)
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h 2018-05-25 21:27:19 UTC (rev 232201)
@@ -52,7 +52,6 @@
static void setSourceApplicationAuditTokenData(RetainPtr<CFDataRef>&&);
static void setSourceApplicationBundleIdentifier(const String&);
static void setSourceApplicationSecondaryIdentifier(const String&);
- static void setUsesNetworkCache(bool);
#if PLATFORM(IOS)
static void setCTDataConnectionServiceType(const String&);
#endif
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2018-05-25 21:27:19 UTC (rev 232201)
@@ -573,8 +573,6 @@
@end
namespace WebKit {
-
-static bool usesNetworkCache { false };
#if !ASSERT_DISABLED
static bool sessionsCreated = false;
@@ -634,11 +632,6 @@
globalSourceApplicationSecondaryIdentifier() = identifier;
}
-void NetworkSessionCocoa::setUsesNetworkCache(bool value)
-{
- usesNetworkCache = value;
-}
-
#if PLATFORM(IOS)
void NetworkSessionCocoa::setCTDataConnectionServiceType(const String& type)
{
@@ -676,8 +669,8 @@
if (parameters.allowsCellularAccess == AllowsCellularAccess::No)
configuration.allowsCellularAccess = NO;
- if (usesNetworkCache)
- configuration.URLCache = nil;
+ // The WebKit network cache was already queried.
+ configuration.URLCache = nil;
if (auto& data = ""
configuration._sourceApplicationAuditTokenData = (NSData *)data.get();
Modified: trunk/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -49,11 +49,6 @@
supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStorageFile);
}
-void NetworkProcess::platformSetURLCacheSize(unsigned, uint64_t)
-{
- notImplemented();
-}
-
void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo& certificateInfo, const String& host)
{
notImplemented();
Modified: trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp (232200 => 232201)
--- trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -133,10 +133,6 @@
setIgnoreTLSErrors(parameters.ignoreTLSErrors);
}
-void NetworkProcess::platformSetURLCacheSize(unsigned, uint64_t)
-{
-}
-
void NetworkProcess::setIgnoreTLSErrors(bool ignoreTLSErrors)
{
SoupNetworkSession::setShouldIgnoreTLSErrors(ignoreTLSErrors);
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (232200 => 232201)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2018-05-25 21:27:19 UTC (rev 232201)
@@ -284,10 +284,6 @@
void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)
{
- NSURLCache *urlCache = [NSURLCache sharedURLCache];
- parameters.nsURLCacheMemoryCapacity = [urlCache memoryCapacity];
- parameters.nsURLCacheDiskCapacity = [urlCache diskCapacity];
-
parameters.parentProcessName = [[NSProcessInfo processInfo] processName];
parameters.uiProcessBundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
@@ -297,7 +293,6 @@
parameters.httpsProxy = [defaults stringForKey:WebKit2HTTPSProxyDefaultsKey];
parameters.networkATSContext = adoptCF(_CFNetworkCopyATSContext());
- parameters.shouldEnableNetworkCache = isNetworkCacheEnabled();
parameters.shouldEnableNetworkCacheEfficacyLogging = [defaults boolForKey:WebKitNetworkCacheEfficacyLoggingEnabledDefaultsKey];
parameters.sourceApplicationBundleIdentifier = m_configuration->sourceApplicationBundleIdentifier();
@@ -482,8 +477,7 @@
if (!cachePath)
cachePath = @"~/Library/Caches/com.apple.WebKit.WebProcess";
- if (isNetworkCacheEnabled())
- cachePath = [cachePath stringByAppendingPathComponent:@"WebKitCache"];
+ cachePath = [cachePath stringByAppendingPathComponent:@"WebKitCache"];
return stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
}
@@ -515,17 +509,6 @@
}
#endif
-bool WebProcessPool::isNetworkCacheEnabled()
-{
- registerUserDefaultsIfNeeded();
-
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-
- bool networkCacheEnabledByDefaults = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey];
-
- return networkCacheEnabledByDefaults && linkedOnOrAfter(SDKVersion::FirstWithNetworkCache);
-}
-
bool WebProcessPool::omitPDFSupport()
{
// Since this is a "secret default" we don't bother registering it.
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (232200 => 232201)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.h 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h 2018-05-25 21:27:19 UTC (rev 232201)
@@ -413,7 +413,6 @@
static String legacyPlatformDefaultApplicationCacheDirectory();
static String legacyPlatformDefaultNetworkCacheDirectory();
static String legacyPlatformDefaultJavaScriptConfigurationDirectory();
- static bool isNetworkCacheEnabled();
bool resourceLoadStatisticsEnabled() { return m_resourceLoadStatisticsEnabled; }
void setResourceLoadStatisticsEnabled(bool);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -781,7 +781,7 @@
if (resource)
return resource->response().suggestedFilename();
- return page()->cachedSuggestedFilenameForURL(url);
+ return String();
}
String WebFrame::mimeTypeForResourceWithURL(const URL& url) const
@@ -802,7 +802,7 @@
if (resource)
return resource->mimeType();
- return page()->cachedResponseMIMETypeForURL(url);
+ return String();
}
void WebFrame::setTextDirection(const String& direction)
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -3056,13 +3056,9 @@
void WebPage::getResourceDataFromFrame(uint64_t frameID, const String& resourceURLString, CallbackID callbackID)
{
RefPtr<SharedBuffer> buffer;
- if (WebFrame* frame = WebProcess::singleton().webFrame(frameID)) {
+ if (auto* frame = WebProcess::singleton().webFrame(frameID)) {
URL resourceURL(URL(), resourceURLString);
buffer = resourceDataForFrame(frame->coreFrame(), resourceURL);
- if (!buffer) {
- // Try to get the resource data from the cache.
- buffer = cachedResponseDataForURL(resourceURL);
- }
}
// FIXME: Use SharedBufferDataReference.
@@ -4101,7 +4097,7 @@
if (documentLoader && documentLoader->subresource(url))
return true;
- return platformHasLocalDataForURL(url);
+ return false;
}
void WebPage::setCustomTextEncodingName(const String& encoding)
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2018-05-25 21:27:19 UTC (rev 232201)
@@ -672,9 +672,6 @@
#endif
bool hasLocalDataForURL(const WebCore::URL&);
- String cachedResponseMIMETypeForURL(const WebCore::URL&);
- String cachedSuggestedFilenameForURL(const WebCore::URL&);
- RefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
static bool canHandleRequest(const WebCore::ResourceRequest&);
@@ -1154,8 +1151,6 @@
void loadDataImpl(uint64_t navigationID, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
void loadStringImpl(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
- bool platformHasLocalDataForURL(const WebCore::URL&);
-
// Actions
void tryClose();
void platformDidReceiveLoadParameters(const LoadParameters&);
Modified: trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -157,18 +157,6 @@
return true;
}
-bool WebPage::platformHasLocalDataForURL(const URL&)
-{
- notImplemented();
- return false;
-}
-
-String WebPage::cachedResponseMIMETypeForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
bool WebPage::platformCanHandleRequest(const ResourceRequest&)
{
notImplemented();
@@ -175,18 +163,6 @@
return false;
}
-String WebPage::cachedSuggestedFilenameForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
-RefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const URL&)
-{
- notImplemented();
- return 0;
-}
-
String WebPage::platformUserAgent(const URL& url) const
{
if (url.isNull() || !m_page->settings().needsSiteSpecificQuirks())
Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2018-05-25 21:27:19 UTC (rev 232201)
@@ -487,30 +487,6 @@
return 0;
}
-bool WebPage::platformHasLocalDataForURL(const WebCore::URL&)
-{
- notImplemented();
- return false;
-}
-
-String WebPage::cachedSuggestedFilenameForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
-String WebPage::cachedResponseMIMETypeForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
-RefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const URL&)
-{
- notImplemented();
- return nullptr;
-}
-
bool WebPage::platformCanHandleRequest(const WebCore::ResourceRequest&)
{
notImplemented();
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm 2018-05-25 21:27:19 UTC (rev 232201)
@@ -677,49 +677,7 @@
{
return m_mockAccessibilityElement.get();
}
-
-bool WebPage::platformHasLocalDataForURL(const WebCore::URL& url)
-{
- NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
- [request setValue:(NSString*)userAgent(url) forHTTPHeaderField:@"User-Agent"];
- NSCachedURLResponse *cachedResponse;
- auto* storageSession = NetworkStorageSession::storageSession(corePage()->sessionID());
- if (CFURLStorageSessionRef platformSession = storageSession ? storageSession->platformSession() : nullptr)
- cachedResponse = cachedResponseForRequest(platformSession, request);
- else
- cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
- [request release];
-
- return cachedResponse;
-}
-static NSCachedURLResponse *cachedResponseForURL(WebPage* webPage, const URL& url)
-{
- RetainPtr<NSMutableURLRequest> request = adoptNS([[NSMutableURLRequest alloc] initWithURL:url]);
- [request setValue:(NSString *)webPage->userAgent(url) forHTTPHeaderField:@"User-Agent"];
-
- auto* storageSession = NetworkStorageSession::storageSession(webPage->corePage()->sessionID());
- if (CFURLStorageSessionRef platformSession = storageSession ? storageSession->platformSession() : nullptr)
- return cachedResponseForRequest(platformSession, request.get());
-
- return [[NSURLCache sharedURLCache] cachedResponseForRequest:request.get()];
-}
-
-String WebPage::cachedSuggestedFilenameForURL(const URL& url)
-{
- return [[cachedResponseForURL(this, url) response] suggestedFilename];
-}
-
-String WebPage::cachedResponseMIMETypeForURL(const URL& url)
-{
- return [[cachedResponseForURL(this, url) response] MIMEType];
-}
-
-RefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const URL& url)
-{
- return SharedBuffer::create([cachedResponseForURL(this, url) data]);
-}
-
bool WebPage::platformCanHandleRequest(const WebCore::ResourceRequest& request)
{
if ([NSURLConnection canHandleRequest:request.nsURLRequest(DoNotUpdateHTTPBody)])
Modified: trunk/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -104,18 +104,6 @@
return true;
}
-bool WebPage::platformHasLocalDataForURL(const URL&)
-{
- notImplemented();
- return false;
-}
-
-String WebPage::cachedResponseMIMETypeForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
bool WebPage::platformCanHandleRequest(const ResourceRequest&)
{
notImplemented();
@@ -122,18 +110,6 @@
return false;
}
-String WebPage::cachedSuggestedFilenameForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
-RefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const URL&)
-{
- notImplemented();
- return 0;
-}
-
String WebPage::platformUserAgent(const URL& url) const
{
if (url.isNull() || !m_page->settings().needsSiteSpecificQuirks())
Modified: trunk/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp 2018-05-25 21:27:19 UTC (rev 232201)
@@ -55,18 +55,6 @@
return false;
}
-bool WebPage::platformHasLocalDataForURL(const URL&)
-{
- notImplemented();
- return false;
-}
-
-String WebPage::cachedResponseMIMETypeForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
bool WebPage::platformCanHandleRequest(const ResourceRequest&)
{
notImplemented();
@@ -73,18 +61,6 @@
return false;
}
-String WebPage::cachedSuggestedFilenameForURL(const URL&)
-{
- notImplemented();
- return String();
-}
-
-RefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const URL&)
-{
- notImplemented();
- return nullptr;
-}
-
String WebPage::platformUserAgent(const URL&) const
{
notImplemented();
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (232200 => 232201)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2018-05-25 21:18:04 UTC (rev 232200)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2018-05-25 21:27:19 UTC (rev 232201)
@@ -147,6 +147,7 @@
JSC::processConfigFile(_javascript_ConfigFile.latin1().data(), "com.apple.WebKit.WebContent", parameters.uiProcessBundleIdentifier.latin1().data());
}
+ // Disable NSURLCache.
auto urlCache = adoptNS([[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]);
[NSURLCache setSharedURLCache:urlCache.get()];