WebKit Bugzilla
Attachment 358401 Details for
Bug 193164
: Modernize CacheModel and disk cache fetching and clearing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193164-20190104170330.patch (text/plain), 24.34 KB, created by
Alex Christensen
on 2019-01-04 17:03:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-01-04 17:03:30 PST
Size:
24.34 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 239647) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,48 @@ >+2019-01-04 Alex Christensen <achristensen@webkit.org> >+ >+ Modernize CacheModel and disk cache fetching and clearing >+ https://bugs.webkit.org/show_bug.cgi?id=193164 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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: >+ > 2019-01-04 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Use save sheet instead of dialog where possible >Index: Source/WebKit/NetworkProcess/NetworkProcess.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.cpp (revision 239632) >+++ Source/WebKit/NetworkProcess/NetworkProcess.cpp (working copy) >@@ -121,7 +121,7 @@ NetworkProcess& NetworkProcess::singleto > > NetworkProcess::NetworkProcess() > : m_hasSetCacheModel(false) >- , m_cacheModel(CacheModelDocumentViewer) >+ , m_cacheModel(CacheModel::DocumentViewer) > , m_diskCacheIsDisabledForTesting(false) > , m_canHandleHTTPSServerTrustEvaluation(true) > #if PLATFORM(COCOA) >@@ -291,7 +291,7 @@ void NetworkProcess::initializeNetworkPr > > m_diskCacheIsDisabledForTesting = parameters.shouldUseTestingNetworkSession; > >- setCacheModel(static_cast<uint32_t>(parameters.cacheModel)); >+ setCacheModel(parameters.cacheModel); > > setCanHandleHTTPSServerTrustEvaluation(parameters.canHandleHTTPSServerTrustEvaluation); > >@@ -567,36 +567,35 @@ void NetworkProcess::setSessionIsControl > m_sessionsControlledByAutomation.remove(sessionID); > } > >-static void fetchDiskCacheEntries(PAL::SessionID sessionID, OptionSet<WebsiteDataFetchOption> fetchOptions, Function<void (Vector<WebsiteData::Entry>)>&& completionHandler) >+static void fetchDiskCacheEntries(PAL::SessionID sessionID, OptionSet<WebsiteDataFetchOption> fetchOptions, CompletionHandler<void(Vector<WebsiteData::Entry>)>&& completionHandler) > { >- if (auto* cache = NetworkProcess::singleton().cache()) { >- HashMap<SecurityOriginData, uint64_t> originsAndSizes; >- cache->traverse([fetchOptions, completionHandler = WTFMove(completionHandler), originsAndSizes = WTFMove(originsAndSizes)](auto* traversalEntry) mutable { >- if (!traversalEntry) { >- Vector<WebsiteData::Entry> entries; >- >- for (auto& originAndSize : originsAndSizes) >- entries.append(WebsiteData::Entry { originAndSize.key, WebsiteDataType::DiskCache, originAndSize.value }); >+ auto* cache = NetworkProcess::singleton().cache(); >+ if (!cache) { >+ RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] () mutable { >+ completionHandler({ }); >+ }); >+ } >+ >+ HashMap<SecurityOriginData, uint64_t> originsAndSizes; >+ cache->traverse([fetchOptions, completionHandler = WTFMove(completionHandler), originsAndSizes = WTFMove(originsAndSizes)](auto* traversalEntry) mutable { >+ if (!traversalEntry) { >+ Vector<WebsiteData::Entry> entries; > >- RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), entries = WTFMove(entries)] { >- completionHandler(entries); >- }); >+ for (auto& originAndSize : originsAndSizes) >+ entries.append(WebsiteData::Entry { originAndSize.key, WebsiteDataType::DiskCache, originAndSize.value }); > >- return; >- } >+ RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), entries = WTFMove(entries)] () mutable { >+ completionHandler(entries); >+ }); > >- auto url = traversalEntry->entry.response().url(); >- auto result = originsAndSizes.add({url.protocol().toString(), url.host().toString(), url.port()}, 0); >+ return; >+ } > >- if (fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes)) >- result.iterator->value += traversalEntry->entry.sourceStorageRecord().header.size() + traversalEntry->recordInfo.bodySize; >- }); >+ auto url = traversalEntry->entry.response().url(); >+ auto result = originsAndSizes.add({url.protocol().toString(), url.host().toString(), url.port()}, 0); > >- return; >- } >- >- RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] { >- completionHandler({ }); >+ if (fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes)) >+ result.iterator->value += traversalEntry->entry.sourceStorageRecord().header.size() + traversalEntry->recordInfo.bodySize; > }); > } > >@@ -612,12 +611,12 @@ void NetworkProcess::fetchWebsiteData(PA > { > ASSERT(RunLoop::isMain()); > >- RunLoop::main().dispatch([completionHandler = WTFMove(m_completionHandler), websiteData = WTFMove(m_websiteData)] { >+ RunLoop::main().dispatch([completionHandler = WTFMove(m_completionHandler), websiteData = WTFMove(m_websiteData)] () mutable { > completionHandler(websiteData); > }); > } > >- Function<void (WebsiteData)> m_completionHandler; >+ CompletionHandler<void(WebsiteData)> m_completionHandler; > WebsiteData m_websiteData; > }; > >@@ -718,29 +717,29 @@ void NetworkProcess::deleteWebsiteData(P > clearDiskCache(modifiedSince, [clearTasksHandler = WTFMove(clearTasksHandler)] { }); > } > >-static void clearDiskCacheEntries(const Vector<SecurityOriginData>& origins, Function<void ()>&& completionHandler) >+static void clearDiskCacheEntries(const Vector<SecurityOriginData>& origins, CompletionHandler<void()>&& completionHandler) > { >- if (auto* cache = NetworkProcess::singleton().cache()) { >- HashSet<RefPtr<SecurityOrigin>> originsToDelete; >- for (auto& origin : origins) >- originsToDelete.add(origin.securityOrigin()); >- >- Vector<NetworkCache::Key> cacheKeysToDelete; >- cache->traverse([cache, completionHandler = WTFMove(completionHandler), originsToDelete = WTFMove(originsToDelete), cacheKeysToDelete = WTFMove(cacheKeysToDelete)](auto* traversalEntry) mutable { >- if (traversalEntry) { >- if (originsToDelete.contains(SecurityOrigin::create(traversalEntry->entry.response().url()))) >- cacheKeysToDelete.append(traversalEntry->entry.key()); >- return; >- } >+ auto* cache = NetworkProcess::singleton().cache(); >+ if (!cache) { >+ RunLoop::main().dispatch(WTFMove(completionHandler)); >+ return; >+ } > >- cache->remove(cacheKeysToDelete, WTFMove(completionHandler)); >+ HashSet<RefPtr<SecurityOrigin>> originsToDelete; >+ for (auto& origin : origins) >+ originsToDelete.add(origin.securityOrigin()); >+ >+ Vector<NetworkCache::Key> cacheKeysToDelete; >+ cache->traverse([cache, completionHandler = WTFMove(completionHandler), originsToDelete = WTFMove(originsToDelete), cacheKeysToDelete = WTFMove(cacheKeysToDelete)](auto* traversalEntry) mutable { >+ if (traversalEntry) { >+ if (originsToDelete.contains(SecurityOrigin::create(traversalEntry->entry.response().url()))) >+ cacheKeysToDelete.append(traversalEntry->entry.key()); > return; >- }); >+ } > >+ cache->remove(cacheKeysToDelete, WTFMove(completionHandler)); > return; >- } >- >- RunLoop::main().dispatch(WTFMove(completionHandler)); >+ }); > } > > void NetworkProcess::deleteWebsiteDataForOrigins(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, const Vector<SecurityOriginData>& originDatas, const Vector<String>& cookieHostNames, const Vector<String>& HSTSCacheHostNames, uint64_t callbackID) >@@ -838,10 +837,8 @@ void NetworkProcess::continueDecidePendi > downloadManager().continueDecidePendingDownloadDestination(downloadID, destination, WTFMove(sandboxExtensionHandle), allowOverwrite); > } > >-void NetworkProcess::setCacheModel(uint32_t cm) >+void NetworkProcess::setCacheModel(CacheModel cacheModel) > { >- CacheModel cacheModel = static_cast<CacheModel>(cm); >- > if (m_hasSetCacheModel && (cacheModel == m_cacheModel)) > return; > >Index: Source/WebKit/NetworkProcess/NetworkProcess.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.h (revision 239630) >+++ Source/WebKit/NetworkProcess/NetworkProcess.h (working copy) >@@ -264,7 +264,7 @@ private: > void setCacheStorageParameters(PAL::SessionID, uint64_t quota, String&& cacheStorageDirectory, SandboxExtension::Handle&&); > > // FIXME: This should take a session ID so we can identify which disk cache to delete. >- void clearDiskCache(WallTime modifiedSince, Function<void ()>&& completionHandler); >+ void clearDiskCache(WallTime modifiedSince, CompletionHandler<void()>&&); > > void downloadRequest(PAL::SessionID, DownloadID, const WebCore::ResourceRequest&, const String& suggestedFilename); > void resumeDownload(PAL::SessionID, DownloadID, const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&); >@@ -275,7 +275,7 @@ private: > void continueWillSendRequest(DownloadID, WebCore::ResourceRequest&&); > void continueDecidePendingDownloadDestination(DownloadID, String destination, SandboxExtension::Handle&&, bool allowOverwrite); > >- void setCacheModel(uint32_t); >+ void setCacheModel(CacheModel); > void allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo&, const String& host); > void setCanHandleHTTPSServerTrustEvaluation(bool); > void getNetworkProcessStatistics(uint64_t callbackID); >Index: Source/WebKit/NetworkProcess/NetworkProcess.messages.in >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.messages.in (revision 239630) >+++ Source/WebKit/NetworkProcess/NetworkProcess.messages.in (working copy) >@@ -70,7 +70,7 @@ messages -> NetworkProcess LegacyReceive > GetNetworkProcessStatistics(uint64_t callbackID) > > ClearCacheForAllOrigins(uint32_t cachesToClear) >- SetCacheModel(uint32_t cacheModel); >+ SetCacheModel(enum:uint8_t WebKit::CacheModel cacheModel); > > ProcessDidTransitionToBackground() > ProcessDidTransitionToForeground() >Index: Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (revision 239632) >+++ Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (working copy) >@@ -51,7 +51,7 @@ struct NetworkProcessCreationParameters > void encode(IPC::Encoder&) const; > static bool decode(IPC::Decoder&, NetworkProcessCreationParameters&); > >- CacheModel cacheModel { CacheModelDocumentViewer }; >+ CacheModel cacheModel { CacheModel::DocumentViewer }; > bool canHandleHTTPSServerTrustEvaluation { true }; > > String diskCacheDirectory; >Index: Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.cpp (revision 239630) >+++ Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.cpp (working copy) >@@ -160,10 +160,6 @@ void Entry::capMaxAge(const Seconds seco > #if ENABLE(SHAREABLE_RESOURCE) > void Entry::initializeShareableResourceHandleFromStorageRecord() const > { >- auto* cache = NetworkProcess::singleton().cache(); >- if (!cache) >- return; >- > auto sharedMemory = m_sourceStorageRecord.body.tryCreateSharedMemory(); > if (!sharedMemory) > return; >Index: Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (revision 239632) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (working copy) >@@ -174,18 +174,21 @@ void NetworkProcess::clearHSTSCache(WebC > _CFNetworkResetHSTSHostsSinceDate(session.platformSession(), (__bridge CFDateRef)date); > } > >-void NetworkProcess::clearDiskCache(WallTime modifiedSince, Function<void ()>&& completionHandler) >+void NetworkProcess::clearDiskCache(WallTime modifiedSince, CompletionHandler<void()>&& completionHandler) > { > if (!m_clearCacheDispatchGroup) > m_clearCacheDispatchGroup = dispatch_group_create(); > >- if (auto* cache = NetworkProcess::singleton().cache()) { >- auto group = m_clearCacheDispatchGroup; >- dispatch_group_async(group, dispatch_get_main_queue(), makeBlockPtr([cache, modifiedSince, completionHandler = WTFMove(completionHandler)] () mutable { >- cache->clear(modifiedSince, [completionHandler = WTFMove(completionHandler)] () mutable { >- }); >- }).get()); >+ auto* cache = NetworkProcess::singleton().cache(); >+ if (!cache) { >+ completionHandler(); >+ return; > } >+ >+ auto group = m_clearCacheDispatchGroup; >+ dispatch_group_async(group, dispatch_get_main_queue(), makeBlockPtr([cache, modifiedSince, completionHandler = WTFMove(completionHandler)] () mutable { >+ cache->clear(modifiedSince, WTFMove(completionHandler)); >+ }).get()); > } > > #if PLATFORM(MAC) >Index: Source/WebKit/Shared/CacheModel.cpp >=================================================================== >--- Source/WebKit/Shared/CacheModel.cpp (revision 239630) >+++ Source/WebKit/Shared/CacheModel.cpp (working copy) >@@ -38,7 +38,7 @@ void calculateMemoryCacheSizes(CacheMode > uint64_t memorySize = ramSize() / MB; > > switch (cacheModel) { >- case CacheModelDocumentViewer: { >+ case CacheModel::DocumentViewer: { > // Page cache capacity (in pages) > pageCacheCapacity = 0; > >@@ -59,7 +59,7 @@ void calculateMemoryCacheSizes(CacheMode > > break; > } >- case CacheModelDocumentBrowser: { >+ case CacheModel::DocumentBrowser: { > // Page cache capacity (in pages) > if (memorySize >= 512) > pageCacheCapacity = 2; >@@ -85,7 +85,7 @@ void calculateMemoryCacheSizes(CacheMode > > break; > } >- case CacheModelPrimaryWebBrowser: { >+ case CacheModel::PrimaryWebBrowser: { > // Page cache capacity (in pages) > if (memorySize >= 512) > pageCacheCapacity = 2; >@@ -128,7 +128,7 @@ void calculateMemoryCacheSizes(CacheMode > void calculateURLCacheSizes(CacheModel cacheModel, uint64_t diskFreeSize, unsigned& urlCacheMemoryCapacity, uint64_t& urlCacheDiskCapacity) > { > switch (cacheModel) { >- case CacheModelDocumentViewer: { >+ case CacheModel::DocumentViewer: { > // Foundation memory cache capacity (in bytes) > urlCacheMemoryCapacity = 0; > >@@ -137,7 +137,7 @@ void calculateURLCacheSizes(CacheModel c > > break; > } >- case CacheModelDocumentBrowser: { >+ case CacheModel::DocumentBrowser: { > uint64_t memorySize = ramSize() / MB; > > // Foundation memory cache capacity (in bytes) >@@ -162,7 +162,7 @@ void calculateURLCacheSizes(CacheModel c > > break; > } >- case CacheModelPrimaryWebBrowser: { >+ case CacheModel::PrimaryWebBrowser: { > uint64_t memorySize = ramSize() / MB; > > #if PLATFORM(IOS_FAMILY) >Index: Source/WebKit/Shared/CacheModel.h >=================================================================== >--- Source/WebKit/Shared/CacheModel.h (revision 239630) >+++ Source/WebKit/Shared/CacheModel.h (working copy) >@@ -26,17 +26,31 @@ > #pragma once > > #include <stdint.h> >+#include <wtf/Forward.h> > #include <wtf/Seconds.h> > > namespace WebKit { > >-enum CacheModel { >- CacheModelDocumentViewer, >- CacheModelDocumentBrowser, >- CacheModelPrimaryWebBrowser >+enum class CacheModel : uint8_t { >+ DocumentViewer, >+ DocumentBrowser, >+ PrimaryWebBrowser > }; > > void calculateMemoryCacheSizes(CacheModel, unsigned& cacheTotalCapacity, unsigned& cacheMinDeadCapacity, unsigned& cacheMaxDeadCapacity, Seconds& deadDecodedDataDeletionInterval, unsigned& pageCacheCapacity); > void calculateURLCacheSizes(CacheModel, uint64_t diskFreeSize, unsigned& urlCacheMemoryCapacity, uint64_t& urlCacheDiskCapacity); > > } // namespace WebKit >+ >+namespace WTF { >+ >+template<> struct EnumTraits<WebKit::CacheModel> { >+ using values = EnumValues< >+ WebKit::CacheModel, >+ WebKit::CacheModel::DocumentViewer, >+ WebKit::CacheModel::DocumentBrowser, >+ WebKit::CacheModel::PrimaryWebBrowser >+ >; >+}; >+ >+} // namespace WTF >Index: Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp >=================================================================== >--- Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp (revision 239630) >+++ Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp (working copy) >@@ -42,7 +42,7 @@ Ref<ProcessPoolConfiguration> ProcessPoo > > configuration->m_shouldHaveLegacyDataStore = true; > configuration->m_maximumProcessCount = 1; >- configuration->m_cacheModel = WebKit::CacheModelDocumentViewer; >+ configuration->m_cacheModel = WebKit::CacheModel::DocumentViewer; > > return configuration; > } >Index: Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h >=================================================================== >--- Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h (revision 239630) >+++ Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h (working copy) >@@ -189,7 +189,7 @@ private: > > unsigned m_maximumProcessCount { 0 }; > bool m_diskCacheSpeculativeValidationEnabled { false }; >- WebKit::CacheModel m_cacheModel { WebKit::CacheModelPrimaryWebBrowser }; >+ WebKit::CacheModel m_cacheModel { WebKit::CacheModel::PrimaryWebBrowser }; > > WTF::String m_applicationCacheDirectory; > WTF::String m_applicationCacheFlatFileSubdirectoryName; >Index: Source/WebKit/UIProcess/API/C/WKAPICast.h >=================================================================== >--- Source/WebKit/UIProcess/API/C/WKAPICast.h (revision 239630) >+++ Source/WebKit/UIProcess/API/C/WKAPICast.h (working copy) >@@ -204,25 +204,25 @@ inline CacheModel toCacheModel(WKCacheMo > { > switch (wkCacheModel) { > case kWKCacheModelDocumentViewer: >- return CacheModelDocumentViewer; >+ return CacheModel::DocumentViewer; > case kWKCacheModelDocumentBrowser: >- return CacheModelDocumentBrowser; >+ return CacheModel::DocumentBrowser; > case kWKCacheModelPrimaryWebBrowser: >- return CacheModelPrimaryWebBrowser; >+ return CacheModel::PrimaryWebBrowser; > } > > ASSERT_NOT_REACHED(); >- return CacheModelDocumentViewer; >+ return CacheModel::DocumentViewer; > } > > inline WKCacheModel toAPI(CacheModel cacheModel) > { > switch (cacheModel) { >- case CacheModelDocumentViewer: >+ case CacheModel::DocumentViewer: > return kWKCacheModelDocumentViewer; >- case CacheModelDocumentBrowser: >+ case CacheModel::DocumentBrowser: > return kWKCacheModelDocumentBrowser; >- case CacheModelPrimaryWebBrowser: >+ case CacheModel::PrimaryWebBrowser: > return kWKCacheModelPrimaryWebBrowser; > } > >Index: Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm (revision 239630) >+++ Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm (working copy) >@@ -279,15 +279,15 @@ - (BOOL)processSwapsOnWindowOpenWithOpen > > - (BOOL)pageCacheEnabled > { >- return _processPoolConfiguration->cacheModel() != WebKit::CacheModelDocumentViewer; >+ return _processPoolConfiguration->cacheModel() != WebKit::CacheModel::DocumentViewer; > } > > - (void)setPageCacheEnabled:(BOOL)enabled > { > if (!enabled) >- _processPoolConfiguration->setCacheModel(WebKit::CacheModelDocumentViewer); >+ _processPoolConfiguration->setCacheModel(WebKit::CacheModel::DocumentViewer); > else if (![self pageCacheEnabled]) >- _processPoolConfiguration->setCacheModel(WebKit::CacheModelPrimaryWebBrowser); >+ _processPoolConfiguration->setCacheModel(WebKit::CacheModel::PrimaryWebBrowser); > } > > - (BOOL)suppressesConnectionTerminationOnSystemChange >Index: Source/WebKit/WebProcess/WebProcess.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.cpp (revision 239630) >+++ Source/WebKit/WebProcess/WebProcess.cpp (working copy) >@@ -328,7 +328,7 @@ void WebProcess::initializeWebProcess(We > WebCore::HTMLMediaElement::setMediaCacheDirectory(parameters.mediaCacheDirectory); > #endif > >- setCacheModel(static_cast<uint32_t>(parameters.cacheModel)); >+ setCacheModel(parameters.cacheModel); > > if (!parameters.languages.isEmpty()) > overrideUserPreferredLanguages(parameters.languages); >@@ -562,10 +562,8 @@ PluginProcessConnectionManager& WebProce > } > #endif > >-void WebProcess::setCacheModel(uint32_t cm) >+void WebProcess::setCacheModel(CacheModel cacheModel) > { >- CacheModel cacheModel = static_cast<CacheModel>(cm); >- > if (m_hasSetCacheModel && (cacheModel == m_cacheModel)) > return; > >@@ -781,7 +779,7 @@ void WebProcess::clearResourceCaches(Res > // Toggling the cache model like this forces the cache to evict all its in-memory resources. > // FIXME: We need a better way to do this. > CacheModel cacheModel = m_cacheModel; >- setCacheModel(CacheModelDocumentViewer); >+ setCacheModel(CacheModel::DocumentViewer); > setCacheModel(cacheModel); > > MemoryCache::singleton().evictResources(); >Index: Source/WebKit/WebProcess/WebProcess.h >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.h (revision 239630) >+++ Source/WebKit/WebProcess/WebProcess.h (working copy) >@@ -175,7 +175,7 @@ public: > > LibWebRTCNetwork& libWebRTCNetwork(); > >- void setCacheModel(uint32_t); >+ void setCacheModel(CacheModel); > > void ensureLegacyPrivateBrowsingSessionInNetworkProcess(); > void addWebsiteDataStore(WebsiteDataStoreParameters&&); >@@ -417,7 +417,7 @@ private: > HashSet<String> m_plugInAutoStartOrigins; > > bool m_hasSetCacheModel { false }; >- CacheModel m_cacheModel { CacheModelDocumentViewer }; >+ CacheModel m_cacheModel { CacheModel::DocumentViewer }; > > #if PLATFORM(COCOA) > WTF::MachSendRight m_compositingRenderServerPort; >Index: Source/WebKit/WebProcess/WebProcess.messages.in >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.messages.in (revision 239630) >+++ Source/WebKit/WebProcess/WebProcess.messages.in (working copy) >@@ -30,7 +30,7 @@ messages -> WebProcess LegacyReceiver { > PrewarmWithDomainInformation(struct WebCore::PrewarmInformation prewarmInformation) > > # Global preferences. >- SetCacheModel(uint32_t cacheModel) >+ SetCacheModel(enum:uint8_t WebKit::CacheModel cacheModel) > > RegisterURLSchemeAsEmptyDocument(String scheme) > RegisterURLSchemeAsSecure(String scheme)
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 193164
:
358401
|
358412
|
358423