Changeset 250148 in webkit
- Timestamp:
- Sep 20, 2019 1:36:57 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r250146 r250148 1 2019-09-20 Alex Christensen <achristensen@webkit.org> 2 3 Introduce LegacyGlobalSettings for settings the NetworkProcess needs from a WebProcessPool 4 https://bugs.webkit.org/show_bug.cgi?id=201970 5 6 Reviewed by Geoff Garen. 7 8 I'm starting by moving the cache model to this new abstraction. 9 We were using it in tests to disable the page cache, which should be done with a boolean on the pool configuration, not by changing the cache model. 10 We were also using it in WKContextSetCacheModel which has several clients that won't change quickly, so this abstraction is used to maintain existing behavior. 11 I need this so I can make a NetworkProcess not depend on anything from a WebProcessPool when starting. 12 13 * Sources.txt: 14 * UIProcess/API/APIProcessPoolConfiguration.cpp: 15 (API::ProcessPoolConfiguration::copy): 16 * UIProcess/API/APIProcessPoolConfiguration.h: 17 * UIProcess/API/C/WKContext.cpp: 18 (WKContextSetCacheModel): 19 (WKContextGetCacheModel): 20 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: 21 (-[_WKProcessPoolConfiguration pageCacheEnabled]): 22 (-[_WKProcessPoolConfiguration setPageCacheEnabled:]): 23 * UIProcess/LegacyGlobalSettings.cpp: Added. 24 (WebKit::LegacyGlobalSettings::singleton): 25 (WebKit::LegacyGlobalSettings::setCacheModel): 26 * UIProcess/LegacyGlobalSettings.h: Added. 27 (WebKit::LegacyGlobalSettings::cacheModel const): 28 * UIProcess/WebProcessCache.cpp: 29 (WebKit::WebProcessCache::updateCapacity): 30 * UIProcess/WebProcessPool.cpp: 31 (WebKit::WebProcessPool::ensureNetworkProcess): 32 (WebKit::WebProcessPool::initializeNewWebProcess): 33 (WebKit::WebProcessPool::updateMaxSuspendedPageCount): 34 (WebKit::WebProcessPool::setCacheModel): 35 * UIProcess/WebProcessPool.h: 36 * WebKit.xcodeproj/project.pbxproj: 37 1 38 2019-09-20 Alex Christensen <achristensen@webkit.org> 2 39 -
trunk/Source/WebKit/Sources.txt
r249778 r250148 245 245 UIProcess/GeolocationPermissionRequestProxy.cpp 246 246 UIProcess/InspectorTargetProxy.cpp 247 UIProcess/LegacyGlobalSettings.cpp 247 248 UIProcess/PageLoadState.cpp 248 249 UIProcess/ProcessAssertion.cpp -
trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
r250143 r250148 45 45 auto copy = this->create(); 46 46 47 copy->m_cacheModel = this->m_cacheModel;48 47 copy->m_diskCacheSpeculativeValidationEnabled = this->m_diskCacheSpeculativeValidationEnabled; 49 48 copy->m_injectedBundlePath = this->m_injectedBundlePath; … … 73 72 copy->m_isAutomaticProcessWarmingEnabledByClient = this->m_isAutomaticProcessWarmingEnabledByClient; 74 73 copy->m_usesWebProcessCache = this->m_usesWebProcessCache; 74 copy->m_usesPageCache = this->m_usesPageCache; 75 75 #if PLATFORM(COCOA) 76 76 copy->m_suppressesConnectionTerminationOnSystemChange = this->m_suppressesConnectionTerminationOnSystemChange; -
trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
r250143 r250148 75 75 void setDiskCacheSpeculativeValidationEnabled(bool enabled) { m_diskCacheSpeculativeValidationEnabled = enabled; } 76 76 77 WebKit::CacheModel cacheModel() const { return m_cacheModel; }78 void setCacheModel(WebKit::CacheModel cacheModel) { m_cacheModel = cacheModel; }77 void setUsesPageCache(bool value) { m_usesPageCache = value; } 78 bool usesPageCache() const { return m_usesPageCache; } 79 79 80 80 const WTF::String& injectedBundlePath() const { return m_injectedBundlePath; } … … 159 159 private: 160 160 bool m_diskCacheSpeculativeValidationEnabled { false }; 161 WebKit::CacheModel m_cacheModel { WebKit::CacheModel::PrimaryWebBrowser };162 161 163 162 WTF::String m_injectedBundlePath; … … 182 181 Optional<bool> m_isAutomaticProcessWarmingEnabledByClient; 183 182 bool m_usesWebProcessCache { false }; 183 bool m_usesPageCache { true }; 184 184 bool m_clientWouldBenefitFromAutomaticProcessPrewarming { false }; 185 185 WTF::String m_customWebContentServiceBundleIdentifier; -
trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp
r249671 r250148 36 36 #include "AuthenticationChallengeProxy.h" 37 37 #include "DownloadProxy.h" 38 #include "LegacyGlobalSettings.h" 38 39 #include "WKAPICast.h" 39 40 #include "WKArray.h" … … 321 322 void WKContextSetCacheModel(WKContextRef contextRef, WKCacheModel cacheModel) 322 323 { 323 WebKit::toImpl(contextRef)->setCacheModel(WebKit::toCacheModel(cacheModel));324 LegacyGlobalSettings::singleton().setCacheModel(WebKit::toCacheModel(cacheModel)); 324 325 } 325 326 326 327 WKCacheModel WKContextGetCacheModel(WKContextRef contextRef) 327 328 { 328 return WebKit::toAPI( WebKit::toImpl(contextRef)->cacheModel());329 return WebKit::toAPI(LegacyGlobalSettings::singleton().cacheModel()); 329 330 } 330 331 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
r250093 r250148 27 27 #import "_WKProcessPoolConfigurationInternal.h" 28 28 29 #import "LegacyGlobalSettings.h" 29 30 #import <objc/runtime.h> 30 31 #import <wtf/RetainPtr.h> … … 314 315 - (BOOL)pageCacheEnabled 315 316 { 316 return _processPoolConfiguration-> cacheModel() != WebKit::CacheModel::DocumentViewer;317 return _processPoolConfiguration->usesPageCache(); 317 318 } 318 319 319 320 - (void)setPageCacheEnabled:(BOOL)enabled 320 321 { 321 if (!enabled) 322 _processPoolConfiguration->setCacheModel(WebKit::CacheModel::DocumentViewer); 323 else if (![self pageCacheEnabled]) 324 _processPoolConfiguration->setCacheModel(WebKit::CacheModel::PrimaryWebBrowser); 322 return _processPoolConfiguration->setUsesPageCache(enabled); 325 323 } 326 324 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
r250143 r250148 28 28 #include "APIProcessPoolConfiguration.h" 29 29 #include "APIString.h" 30 #include "LegacyGlobalSettings.h" 30 31 #include "TextChecker.h" 31 32 #include "TextCheckerState.h" … … 691 692 * %WEBKIT_CACHE_MODEL_WEB_BROWSER. 692 693 */ 693 void webkit_web_context_set_cache_model(WebKitWebContext* context, WebKitCacheModel model)694 void webkit_web_context_set_cache_model(WebKitWebContext*, WebKitCacheModel model) 694 695 { 695 696 CacheModel cacheModel; 696 697 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));698 697 699 698 switch (model) { … … 711 710 } 712 711 713 if (cacheModel != context->priv->processPool->cacheModel())714 context->priv->processPool->setCacheModel(cacheModel);712 if (cacheModel != LegacyGlobalSettings::singleton().cacheModel()) 713 LegacyGlobalSettings::singleton().setCacheModel(cacheModel); 715 714 } 716 715 … … 729 728 g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_CACHE_MODEL_WEB_BROWSER); 730 729 731 switch ( context->priv->processPool->cacheModel()) {730 switch (LegacyGlobalSettings::singleton().cacheModel()) { 732 731 case CacheModel::DocumentViewer: 733 732 return WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER; -
trunk/Source/WebKit/UIProcess/WebProcessCache.cpp
r249948 r250148 27 27 #include "WebProcessCache.h" 28 28 29 #include "LegacyGlobalSettings.h" 29 30 #include "Logging.h" 30 31 #include "WebProcessPool.h" … … 151 152 void WebProcessCache::updateCapacity(WebProcessPool& processPool) 152 153 { 153 if (!processPool.configuration().processSwapsOnNavigation() || !processPool.configuration().usesWebProcessCache() || processPool.cacheModel() != CacheModel::PrimaryWebBrowser) {154 if (!processPool.configuration().processSwapsOnNavigation() || !processPool.configuration().usesWebProcessCache() || LegacyGlobalSettings::singleton().cacheModel() != CacheModel::PrimaryWebBrowser) { 154 155 if (!processPool.configuration().processSwapsOnNavigation()) 155 156 RELEASE_LOG(ProcessSwapping, "%p - WebProcessCache::updateCapacity: Cache is disabled because process swap on navigation is disabled", this); -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r250144 r250148 493 493 } 494 494 495 parameters.cacheModel = cacheModel();495 parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel(); 496 496 parameters.canHandleHTTPSServerTrustEvaluation = m_canHandleHTTPSServerTrustEvaluation; 497 497 … … 920 920 #endif 921 921 922 parameters.cacheModel = cacheModel();922 parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel(); 923 923 parameters.languages = configuration().overrideLanguages().isEmpty() ? userPreferredLanguages() : configuration().overrideLanguages(); 924 924 … … 1576 1576 void WebProcessPool::updateMaxSuspendedPageCount() 1577 1577 { 1578 if (!m_configuration->usesPageCache()) 1579 return; 1580 1578 1581 unsigned dummy = 0; 1579 1582 Seconds dummyInterval; 1580 1583 unsigned pageCacheSize = 0; 1581 calculateMemoryCacheSizes( m_configuration->cacheModel(), dummy, dummy, dummy, dummyInterval, pageCacheSize);1584 calculateMemoryCacheSizes(LegacyGlobalSettings::singleton().cacheModel(), dummy, dummy, dummy, dummyInterval, pageCacheSize); 1582 1585 1583 1586 m_maxSuspendedPageCount = pageCacheSize; … … 1589 1592 void WebProcessPool::setCacheModel(CacheModel cacheModel) 1590 1593 { 1591 m_configuration->setCacheModel(cacheModel);1592 1594 updateMaxSuspendedPageCount(); 1593 1595 -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r250143 r250148 282 282 283 283 void setCacheModel(CacheModel); 284 CacheModel cacheModel() const { return m_configuration->cacheModel(); }285 284 286 285 void setDefaultRequestTimeoutInterval(double); -
trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp
r250077 r250148 29 29 #include "WebProcessPool.h" 30 30 31 #include "LegacyGlobalSettings.h" 31 32 #include "WebMemoryPressureHandler.h" 32 33 #include "WebProcessCreationParameters.h" … … 126 127 #endif 127 128 128 parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModel::DocumentViewer;129 parameters.memoryCacheDisabled = m_memoryCacheDisabled || LegacyGlobalSettings::singleton().cacheModel() == CacheModel::DocumentViewer; 129 130 parameters.proxySettings = m_networkProxySettings; 130 131 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r249778 r250148 1726 1726 filePatterns = "*.h"; 1727 1727 fileType = pattern.proxy; 1728 inputFiles = ( 1729 ); 1728 1730 isEditable = 1; 1729 1731 outputFiles = ( … … 3695 3697 5CE9120C2293C1E0005BEC78 /* WKMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKMain.mm; sourceTree = "<group>"; }; 3696 3698 5CE9120F2293C25F005BEC78 /* AuxiliaryProcessMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AuxiliaryProcessMain.cpp; path = Cocoa/AuxiliaryProcessMain.cpp; sourceTree = "<group>"; }; 3699 5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyGlobalSettings.h; sourceTree = "<group>"; }; 3700 5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyGlobalSettings.cpp; sourceTree = "<group>"; }; 3697 3701 5CFECB031E1ED1C800F88504 /* LegacyCustomProtocolManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCustomProtocolManager.cpp; sourceTree = "<group>"; }; 3698 3702 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; }; … … 7756 7760 A5E391FB2183C1E900C8FB31 /* InspectorTargetProxy.cpp */, 7757 7761 A5E391FC2183C1E900C8FB31 /* InspectorTargetProxy.h */, 7762 5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */, 7763 5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */, 7758 7764 31607F3819627002009B87DA /* LegacySessionStateCoding.h */, 7759 7765 BC6EDAA5111271C600E7678B /* PageClient.h */,
Note: See TracChangeset
for help on using the changeset viewer.