WebKit Bugzilla
Attachment 341315 Details for
Bug 185990
: Drop support for NSURLCache in WebKit2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185990-20180525130804.patch (text/plain), 35.13 KB, created by
Chris Dumez
on 2018-05-25 13:08:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-25 13:08:04 PDT
Size:
35.13 KB
patch
obsolete
>Subversion Revision: 232192 >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 7b566a8f8a0fc52bad15a7ffc1aadd0292dc6e6c..1403d5ed18967bb0240d5024e823567b9fa76002 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,14 @@ >+2018-05-25 Chris Dumez <cdumez@apple.com> >+ >+ Drop support for NSURLCache in WebKit2 >+ https://bugs.webkit.org/show_bug.cgi?id=185990 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable. >+ >+ * pal/spi/cf/CFNetworkSPI.h: >+ > 2018-05-24 Jiewen Tan <jiewen_tan@apple.com> > > Adopt SecKeyProxy SPI in certificate based challenge response code >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d11ffbf7c8a8ca33a96b63c34db2b4cd3ee3bf80..030e2e3b5440604e20e8d3bcc92bb0b75a079416 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,75 @@ >+2018-05-25 Chris Dumez <cdumez@apple.com> >+ >+ Drop support for NSURLCache in WebKit2 >+ https://bugs.webkit.org/show_bug.cgi?id=185990 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 Chris Dumez <cdumez@apple.com> > > Minor ApplicationCacheStorage clean up >diff --git a/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h b/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >index b593cc9176e4583487a5cdac829c89f07e1b29f5..e827987bb672c490a3ad7540789aa3843f8c850c 100644 >--- a/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >@@ -88,7 +88,6 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef); > #if defined(__OBJC__) > > @interface NSURLCache () >--(instancetype)_initWithMemoryCapacity:(NSUInteger)memoryCapacity diskCapacity:(NSUInteger)diskCapacity relativePath:(NSString *)path; > - (CFURLCacheRef)_CFURLCache; > @end > >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index a4bc45e19d17d9ceac214f3e5d5b4ac08b93713c..c71b8372bad1e775c8b7760b41cbcad41afad76f 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -724,12 +724,8 @@ void NetworkProcess::setCacheModel(uint32_t cm) > 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) >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h >index aef6da749e8c05e95f13873050243a77bb8c07b4..5ede804b19fea21cde1740fe02d1599325208d53 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h >@@ -243,9 +243,6 @@ private: > 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 >diff --git a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >index f855293396efaba94a9fb01bad558314c7f7e238..129c1700eceef4b1707458810f5699c9067d2853 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >@@ -51,7 +51,6 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const > encoder << cacheStorageDirectoryExtensionHandle; > encoder << diskCacheDirectory; > encoder << diskCacheDirectoryExtensionHandle; >- encoder << shouldEnableNetworkCache; > encoder << shouldEnableNetworkCacheEfficacyLogging; > #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) > encoder << shouldEnableNetworkCacheSpeculativeRevalidation; >@@ -72,8 +71,6 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const > #if PLATFORM(COCOA) > encoder << parentProcessName; > encoder << uiProcessBundleIdentifier; >- encoder << nsURLCacheMemoryCapacity; >- encoder << nsURLCacheDiskCapacity; > encoder << sourceApplicationBundleIdentifier; > encoder << sourceApplicationSecondaryIdentifier; > #if PLATFORM(IOS) >@@ -156,8 +153,6 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc > 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 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc > 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)) >diff --git a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >index 5d0fe13a5e6a75d80eb79c5f4bbbdd6b2b617bea..d57425c589708ef71d8c9d4bdf1cd37ec0ed962b 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >@@ -61,7 +61,6 @@ struct NetworkProcessCreationParameters { > 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 @@ struct NetworkProcessCreationParameters { > #if PLATFORM(COCOA) > String parentProcessName; > String uiProcessBundleIdentifier; >- uint64_t nsURLCacheMemoryCapacity; >- uint64_t nsURLCacheDiskCapacity; > String sourceApplicationBundleIdentifier; > String sourceApplicationSecondaryIdentifier; > #if PLATFORM(IOS) >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >index 9bf2ede02ae666dcd5b7a3a36cbee96f8871b39e..cb6ce107b935046f735d8c4a988bad9b30744c49 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >@@ -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 @@ void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessC > 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 @@ void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessC > // - 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 @@ void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessC > 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; >-#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 = "."; >+ if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation) >+ cacheOptions |= NetworkCache::Cache::Option::SpeculativeRevalidation; > #endif >- [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc] >- initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity >- diskCapacity:parameters.nsURLCacheDiskCapacity >- diskPath:nsURLCacheDirectory]).get()]; >- } >-} > >-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. >+ m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions); >+ if (!m_cache) >+ RELEASE_LOG_ERROR(NetworkCache, "Failed to initialize the WebKit network disk cache"); >+ >+ // 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 @@ void NetworkProcess::clearHSTSCache(WebCore::NetworkStorageSession& session, Wal > _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 @@ void NetworkProcess::clearDiskCache(WallTime modifiedSince, Function<void ()>&& > > 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) >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h >index 51debdf3a4fee2fb0fb5c3bf838d271f2f2310e3..a9d8f49da0b23a2372163f7fec67ece29b97a500 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h >@@ -52,7 +52,6 @@ public: > 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 >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index 9b0befb3f43184e70930f0d979e8acfa9e1a76d0..3de95bcce15f88fd3325a959f62f38aa670288b8 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >@@ -573,8 +573,6 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data > @end > > namespace WebKit { >- >-static bool usesNetworkCache { false }; > > #if !ASSERT_DISABLED > static bool sessionsCreated = false; >@@ -634,11 +632,6 @@ void NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier(const String& > globalSourceApplicationSecondaryIdentifier() = identifier; > } > >-void NetworkSessionCocoa::setUsesNetworkCache(bool value) >-{ >- usesNetworkCache = value; >-} >- > #if PLATFORM(IOS) > void NetworkSessionCocoa::setCTDataConnectionServiceType(const String& type) > { >@@ -676,8 +669,8 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkSessionCreationParameters&& para > 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 = globalSourceApplicationAuditTokenData()) > configuration._sourceApplicationAuditTokenData = (NSData *)data.get(); >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp >index db6ad7445329d35f027cfebe72790add6b4597d7..8188419f84cbfebdfa1533d420f95fd959cf0f0c 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp >+++ b/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp >@@ -49,11 +49,6 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati > supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStorageFile); > } > >-void NetworkProcess::platformSetURLCacheSize(unsigned, uint64_t) >-{ >- notImplemented(); >-} >- > void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo& certificateInfo, const String& host) > { > notImplemented(); >diff --git a/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp >index 37c4205c0d5e53d56aacf85155d41257e117cc81..faeb4c1093ac474c3a0a60ca1e87412988c221e8 100644 >--- a/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp >+++ b/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp >@@ -133,10 +133,6 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati > setIgnoreTLSErrors(parameters.ignoreTLSErrors); > } > >-void NetworkProcess::platformSetURLCacheSize(unsigned, uint64_t) >-{ >-} >- > void NetworkProcess::setIgnoreTLSErrors(bool ignoreTLSErrors) > { > SoupNetworkSession::setShouldIgnoreTLSErrors(ignoreTLSErrors); >diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm >index 47038243907599d98edacf4c6c2125797054d326..ba6549da347d9a31b81634d150d272bab23251ab 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm >@@ -284,10 +284,6 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& > > 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 @@ void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationPara > 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 @@ String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory() > 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 @@ void WebProcessPool::setJavaScriptConfigurationFileEnabledFromDefaults() > } > #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. >diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h >index 21d71f5f0a4c88d2996648fa6bc439ed1ee13fd8..192fc39f00f85948c73fa53c92afaad5507a15bf 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.h >+++ b/Source/WebKit/UIProcess/WebProcessPool.h >@@ -413,7 +413,6 @@ public: > static String legacyPlatformDefaultApplicationCacheDirectory(); > static String legacyPlatformDefaultNetworkCacheDirectory(); > static String legacyPlatformDefaultJavaScriptConfigurationDirectory(); >- static bool isNetworkCacheEnabled(); > > bool resourceLoadStatisticsEnabled() { return m_resourceLoadStatisticsEnabled; } > void setResourceLoadStatisticsEnabled(bool); >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >index 43c1ae0101acb047acc869c6135f7819daa5c33e..60671ecea8c285c4f7f667fb19a44c4b52490c33 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >@@ -781,7 +781,7 @@ String WebFrame::suggestedFilenameForResourceWithURL(const URL& url) const > if (resource) > return resource->response().suggestedFilename(); > >- return page()->cachedSuggestedFilenameForURL(url); >+ return String(); > } > > String WebFrame::mimeTypeForResourceWithURL(const URL& url) const >@@ -802,7 +802,7 @@ String WebFrame::mimeTypeForResourceWithURL(const URL& url) const > if (resource) > return resource->mimeType(); > >- return page()->cachedResponseMIMETypeForURL(url); >+ return String(); > } > > void WebFrame::setTextDirection(const String& direction) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index c1a313e807234b3f8614e2bb965678904d8d398d..991e184a17cb74dbd39d2edb2ef491284dc2bf06 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -3056,13 +3056,9 @@ static RefPtr<SharedBuffer> resourceDataForFrame(Frame* frame, const URL& resour > 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 @@ bool WebPage::hasLocalDataForURL(const URL& url) > if (documentLoader && documentLoader->subresource(url)) > return true; > >- return platformHasLocalDataForURL(url); >+ return false; > } > > void WebPage::setCustomTextEncodingName(const String& encoding) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index d26333958610f2db31061666e8ed46c82cd2cd8c..333c7cc83e3249070910c4c3ea9b788eab06b900 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -672,9 +672,6 @@ public: > #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 @@ private: > 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&); >diff --git a/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp b/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp >index 493cb163befbe9bc64da662a76689aba2a357671..67212f8f2e4875d65b9696133e34ef53480e72a2 100644 >--- a/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp >+++ b/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp >@@ -157,36 +157,12 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard > return true; > } > >-bool WebPage::platformHasLocalDataForURL(const URL&) >-{ >- notImplemented(); >- return false; >-} >- >-String WebPage::cachedResponseMIMETypeForURL(const URL&) >-{ >- notImplemented(); >- return String(); >-} >- > bool WebPage::platformCanHandleRequest(const ResourceRequest&) > { > notImplemented(); > 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()) >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index c6cd0a13a0e17a0578d4130b4ea11788c40c24d3..836752547f44e30501375baae36a2c8a9c721529 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -487,30 +487,6 @@ WKAccessibilityWebPageObject* WebPage::accessibilityRemoteObject() > 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(); >diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >index 4aa316b6d6e46ddda034c8a5ca46e885437c4115..c9a40814db14f64f788256bb2398c81c2962a192 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >+++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >@@ -677,48 +677,6 @@ WKAccessibilityWebPageObject* WebPage::accessibilityRemoteObject() > { > 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) > { >diff --git a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >index ef40c8a0983d7d3e18b439bc17bd56d4e1c560f9..06681c63c76fc6d3901fdd01476bceea74e2a3a2 100644 >--- a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >+++ b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >@@ -104,36 +104,12 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard > return true; > } > >-bool WebPage::platformHasLocalDataForURL(const URL&) >-{ >- notImplemented(); >- return false; >-} >- >-String WebPage::cachedResponseMIMETypeForURL(const URL&) >-{ >- notImplemented(); >- return String(); >-} >- > bool WebPage::platformCanHandleRequest(const ResourceRequest&) > { > notImplemented(); > 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()) >diff --git a/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp b/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp >index 2f4ab943968d69d082c59fbe867bb63b08389125..61632179ad97f06f42afce54cdbce36351334bcd 100644 >--- a/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp >+++ b/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp >@@ -55,36 +55,12 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&) > return false; > } > >-bool WebPage::platformHasLocalDataForURL(const URL&) >-{ >- notImplemented(); >- return false; >-} >- >-String WebPage::cachedResponseMIMETypeForURL(const URL&) >-{ >- notImplemented(); >- return String(); >-} >- > bool WebPage::platformCanHandleRequest(const ResourceRequest&) > { > notImplemented(); > 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(); >diff --git a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >index f5fad3c510a055941997b184ebcd3af732a6c253..32259d2694000245c7a2e9483eaf5451518f7690 100644 >--- a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >+++ b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >@@ -147,6 +147,7 @@ void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& par > JSC::processConfigFile(javaScriptConfigFile.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()]; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185990
: 341315