Changeset 238183 in webkit
- Timestamp:
- Nov 14, 2018 10:13:13 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238179 r238183 1 2018-11-14 Chris Dumez <cdumez@apple.com> 2 3 Client should be able to disable PSON even if the experimental feature is on by default 4 https://bugs.webkit.org/show_bug.cgi?id=191634 5 6 Reviewed by Dean Jackson. 7 8 Instead of overriding the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag to true 9 when the experimental is enabled, use a separate flag to store this information. If the client 10 explicitly sets the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag then we obey 11 the client's request, otherwise, we fall back to using the state from experimental features. 12 13 This allows: 14 - API tests to explicitely disable PSON / Process prewarming even if those are on by default 15 in experimental features. 16 - If the client does not set those flags on the APIProcessPoolConfiguration (Safari for e.g.), 17 then the experimental feature flag still fully controls the feature. 18 19 * UIProcess/API/APIProcessPoolConfiguration.cpp: 20 (API::ProcessPoolConfiguration::copy): 21 * UIProcess/API/APIProcessPoolConfiguration.h: 22 * UIProcess/WebProcessPool.cpp: 23 (WebKit::WebProcessPool::createWebPage): 24 1 25 2018-11-14 Chris Dumez <cdumez@apple.com> 2 26 -
trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
r238076 r238183 121 121 #endif 122 122 copy->m_presentingApplicationPID = this->m_presentingApplicationPID; 123 copy->m_processSwapsOnNavigation = this->m_processSwapsOnNavigation; 123 copy->m_processSwapsOnNavigationFromClient = this->m_processSwapsOnNavigationFromClient; 124 copy->m_processSwapsOnNavigationFromExperimentalFeatures = this->m_processSwapsOnNavigationFromExperimentalFeatures; 124 125 copy->m_alwaysKeepAndReuseSwappedProcesses = this->m_alwaysKeepAndReuseSwappedProcesses; 125 126 copy->m_processSwapsOnWindowOpenWithOpener = this->m_processSwapsOnWindowOpenWithOpener; 126 copy->m_isAutomaticProcessWarmingEnabled = this->m_isAutomaticProcessWarmingEnabled;127 copy->m_isAutomaticProcessWarmingEnabledByClient = this->m_isAutomaticProcessWarmingEnabledByClient; 127 128 #if ENABLE(PROXIMITY_NETWORKING) 128 129 copy->m_wirelessContextIdentifier = this->m_wirelessContextIdentifier; -
trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
r237281 r238183 60 60 void setMaximumProcessCount(unsigned maximumProcessCount) { m_maximumProcessCount = maximumProcessCount; } 61 61 62 bool isAutomaticProcessWarmingEnabled() const { return m_isAutomaticProcessWarmingEnabled; } 63 void setIsAutomaticProcessWarmingEnabled(bool value) { m_isAutomaticProcessWarmingEnabled = value; } 62 bool isAutomaticProcessWarmingEnabled() const 63 { 64 // FIXME: For now, turning on PSON from the experimental features menu also turns on 65 // automatic process warming until clients can be updated. 66 return m_isAutomaticProcessWarmingEnabledByClient.value_or(m_processSwapsOnNavigationFromExperimentalFeatures); 67 } 68 void setIsAutomaticProcessWarmingEnabled(bool value) { m_isAutomaticProcessWarmingEnabledByClient = value; } 64 69 65 70 bool diskCacheSpeculativeValidationEnabled() const { return m_diskCacheSpeculativeValidationEnabled; } … … 151 156 void setPresentingApplicationPID(ProcessID pid) { m_presentingApplicationPID = pid; } 152 157 153 bool processSwapsOnNavigation() const { return m_processSwapsOnNavigation; } 154 void setProcessSwapsOnNavigation(bool swaps) { m_processSwapsOnNavigation = swaps; } 158 bool processSwapsOnNavigation() const 159 { 160 return m_processSwapsOnNavigationFromClient.value_or(m_processSwapsOnNavigationFromExperimentalFeatures); 161 } 162 void setProcessSwapsOnNavigation(bool swaps) { m_processSwapsOnNavigationFromClient = swaps; } 163 void setProcessSwapsOnNavigationFromExperimentalFeatures(bool swaps) { m_processSwapsOnNavigationFromExperimentalFeatures = swaps; } 155 164 156 165 bool alwaysKeepAndReuseSwappedProcesses() const { return m_alwaysKeepAndReuseSwappedProcesses; } … … 206 215 bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS }; 207 216 ProcessID m_presentingApplicationPID { getCurrentProcessID() }; 208 bool m_processSwapsOnNavigation { false }; 217 std::optional<bool> m_processSwapsOnNavigationFromClient; 218 bool m_processSwapsOnNavigationFromExperimentalFeatures { false }; 209 219 bool m_alwaysKeepAndReuseSwappedProcesses { false }; 210 220 bool m_processSwapsOnWindowOpenWithOpener { false }; 211 bool m_isAutomaticProcessWarmingEnabled{ false };221 std::optional<bool> m_isAutomaticProcessWarmingEnabledByClient { false }; 212 222 WTF::String m_customWebContentServiceBundleIdentifier; 213 223 -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r238174 r238183 1127 1127 1128 1128 auto page = process->createWebPage(pageClient, WTFMove(pageConfiguration)); 1129 if (page->preferences().processSwapOnCrossSiteNavigationEnabled()) { 1130 m_configuration->setProcessSwapsOnNavigation(true); 1131 // FIXME: For now, turning on PSON from the debug features menu also turns on 1132 // automatic process warming until clients can be updated. 1133 m_configuration->setIsAutomaticProcessWarmingEnabled(true); 1134 } 1129 m_configuration->setProcessSwapsOnNavigationFromExperimentalFeatures(page->preferences().processSwapOnCrossSiteNavigationEnabled()); 1135 1130 1136 1131 return page;
Note: See TracChangeset
for help on using the changeset viewer.