Diff
Modified: trunk/Source/WebKit/ChangeLog (261406 => 261407)
--- trunk/Source/WebKit/ChangeLog 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/ChangeLog 2020-05-08 20:10:24 UTC (rev 261407)
@@ -1,3 +1,30 @@
+2020-05-08 Chris Dumez <[email protected]>
+
+ Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority
+ https://bugs.webkit.org/show_bug.cgi?id=211632
+
+ Reviewed by Darin Adler.
+
+ Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority.
+ _alwaysRunsAtForegroundPriority is a frequent source of process assertion leaks that get blamed on WebKit. Clients
+ are using this in order to be able to do loads in background views so _clientNavigationsRunAtForegroundPriority
+ should suffice and is not leak prone since the process assertion is released after the navigation has completed.
+
+ * UIProcess/API/APIPageConfiguration.cpp:
+ (API::PageConfiguration::copy const):
+ * UIProcess/API/APIPageConfiguration.h:
+ (API::PageConfiguration::alwaysRunsAtForegroundPriority const): Deleted.
+ (API::PageConfiguration::setAlwaysRunsAtForegroundPriority): Deleted.
+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+ (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
+ (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
+ * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::close):
+ (WebKit::WebPageProxy::updateThrottleState):
+ (WebKit::WebPageProxy::resetStateAfterProcessExited):
+ * UIProcess/WebPageProxy.h:
+
2020-05-08 Alex Christensen <[email protected]>
Revert r260390
Modified: trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp (261406 => 261407)
--- trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp 2020-05-08 20:10:24 UTC (rev 261407)
@@ -73,7 +73,6 @@
copy->m_websiteDataStore = this->m_websiteDataStore;
#if PLATFORM(IOS_FAMILY)
copy->m_clientNavigationsRunAtForegroundPriority = this->m_clientNavigationsRunAtForegroundPriority;
- copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority;
copy->m_canShowWhileLocked = this->m_canShowWhileLocked;
copy->m_clickInteractionDriverForTesting = this->m_clickInteractionDriverForTesting;
#endif
Modified: trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h (261406 => 261407)
--- trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h 2020-05-08 20:10:24 UTC (rev 261407)
@@ -93,9 +93,7 @@
#if PLATFORM(IOS_FAMILY)
bool clientNavigationsRunAtForegroundPriority() const { return m_clientNavigationsRunAtForegroundPriority; }
void setClientNavigationsRunAtForegroundPriority(bool value) { m_clientNavigationsRunAtForegroundPriority = value; }
- bool alwaysRunsAtForegroundPriority() const { return m_alwaysRunsAtForegroundPriority; }
- void setAlwaysRunsAtForegroundPriority(bool alwaysRunsAtForegroundPriority) { m_alwaysRunsAtForegroundPriority = alwaysRunsAtForegroundPriority; }
-
+
bool canShowWhileLocked() const { return m_canShowWhileLocked; }
void setCanShowWhileLocked(bool canShowWhileLocked) { m_canShowWhileLocked = canShowWhileLocked; }
@@ -175,7 +173,6 @@
#if PLATFORM(IOS_FAMILY)
bool m_clientNavigationsRunAtForegroundPriority { true };
- bool m_alwaysRunsAtForegroundPriority { false };
bool m_canShowWhileLocked { false };
RetainPtr<_UIClickInteractionDriving> m_clickInteractionDriverForTesting;
#endif
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm (261406 => 261407)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm 2020-05-08 20:10:24 UTC (rev 261407)
@@ -144,7 +144,7 @@
configuration._needsStorageAccessFromFileURLsQuirk = NO;
#if PLATFORM(IOS_FAMILY)
configuration.allowsInlineMediaPlayback = NO;
- configuration._alwaysRunsAtForegroundPriority = YES;
+ configuration._clientNavigationsRunAtForegroundPriority = YES;
#endif
}
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (261406 => 261407)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2020-05-08 20:10:24 UTC (rev 261407)
@@ -729,12 +729,12 @@
- (BOOL)_alwaysRunsAtForegroundPriority
{
- return _pageConfiguration->alwaysRunsAtForegroundPriority();
+ return _pageConfiguration->clientNavigationsRunAtForegroundPriority();
}
- (void)_setAlwaysRunsAtForegroundPriority:(BOOL)alwaysRunsAtForegroundPriority
{
- _pageConfiguration->setAlwaysRunsAtForegroundPriority(alwaysRunsAtForegroundPriority);
+ _pageConfiguration->setClientNavigationsRunAtForegroundPriority(alwaysRunsAtForegroundPriority);
}
- (BOOL)_inlineMediaPlaybackRequiresPlaysInlineAttribute
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h (261406 => 261407)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h 2020-05-08 20:10:24 UTC (rev 261407)
@@ -91,7 +91,7 @@
#if TARGET_OS_IPHONE
@property (nonatomic, setter=_setClientNavigationsRunAtForegroundPriority:) BOOL _clientNavigationsRunAtForegroundPriority WK_API_AVAILABLE(ios(WK_IOS_TBA));
-@property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_API_AVAILABLE(ios(9_0));
+@property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_API_DEPRECATED_WITH_REPLACEMENT("_clientNavigationsRunAtForegroundPriority", ios(9.0, WK_IOS_TBA));
@property (nonatomic, setter=_setInlineMediaPlaybackRequiresPlaysInlineAttribute:) BOOL _inlineMediaPlaybackRequiresPlaysInlineAttribute WK_API_AVAILABLE(ios(10.0));
@property (nonatomic, setter=_setAllowsInlineMediaPlaybackAfterFullscreen:) BOOL _allowsInlineMediaPlaybackAfterFullscreen WK_API_AVAILABLE(ios(10.0));
@property (nonatomic, setter=_setDragLiftDelay:) _WKDragLiftDelay _dragLiftDelay WK_API_AVAILABLE(ios(11.0));
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (261406 => 261407)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-05-08 20:10:24 UTC (rev 261407)
@@ -464,7 +464,6 @@
, m_geolocationPermissionRequestManager(*this)
, m_notificationPermissionRequestManager(*this)
#if PLATFORM(IOS_FAMILY)
- , m_alwaysRunsAtForegroundPriority(m_configuration->alwaysRunsAtForegroundPriority())
, m_audibleActivityTimer(RunLoop::main(), this, &WebPageProxy::clearAudibleActivity)
#endif
, m_initialCapitalizationEnabled(m_configuration->initialCapitalizationEnabled())
@@ -1126,7 +1125,6 @@
m_isAudibleActivity = nullptr;
m_isCapturingActivity = nullptr;
m_openingAppLinkActivity = nullptr;
- m_alwaysRunsAtForegroundPriorityActivity = nullptr;
m_audibleActivityTimer.stop();
#endif
@@ -2082,16 +2080,6 @@
RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "updateThrottleState: UIProcess is releasing a foreground assertion because media capture is no longer active");
m_isCapturingActivity = nullptr;
}
-
- if (m_alwaysRunsAtForegroundPriority) {
- if (!m_alwaysRunsAtForegroundPriorityActivity || !m_alwaysRunsAtForegroundPriorityActivity->isValid()) {
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "updateThrottleState: UIProcess is taking a foreground assertion because m_alwaysRunsAtForegroundPriority is true");
- m_alwaysRunsAtForegroundPriorityActivity = m_process->throttler().foregroundActivity("View always runs at foreground priority"_s).moveToUniquePtr();
- }
- } else if (m_alwaysRunsAtForegroundPriorityActivity) {
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "updateThrottleState: UIProcess is releasing a foreground assertion because m_alwaysRunsAtForegroundPriority is no longer true");
- m_alwaysRunsAtForegroundPriorityActivity = nullptr;
- }
#endif
}
@@ -7660,7 +7648,6 @@
m_isAudibleActivity = nullptr;
m_isCapturingActivity = nullptr;
m_openingAppLinkActivity = nullptr;
- m_alwaysRunsAtForegroundPriorityActivity = nullptr;
#endif
m_pageIsUserObservableCount = nullptr;
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (261406 => 261407)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-05-08 20:10:24 UTC (rev 261407)
@@ -2447,11 +2447,9 @@
bool m_viewWasEverInWindow { false };
#if PLATFORM(IOS_FAMILY)
bool m_allowsMediaDocumentInlinePlayback { false };
- bool m_alwaysRunsAtForegroundPriority { false };
std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isVisibleActivity;
std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isAudibleActivity;
std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isCapturingActivity;
- std::unique_ptr<ProcessThrottler::ForegroundActivity> m_alwaysRunsAtForegroundPriorityActivity;
RunLoop::Timer<WebPageProxy> m_audibleActivityTimer;
std::unique_ptr<ProcessThrottler::BackgroundActivity> m_openingAppLinkActivity;
#endif
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm (261406 => 261407)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm 2020-05-08 20:10:24 UTC (rev 261407)
@@ -96,7 +96,7 @@
std::unique_ptr<InstanceMethodSwizzler> isInBackgroundSwizzler = makeUnique<InstanceMethodSwizzler>(NSClassFromString(@"WKApplicationStateTrackingView"), @selector(isBackground), reinterpret_cast<IMP>(isBackground));
RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
- [configuration _setAlwaysRunsAtForegroundPriority:YES];
+ [configuration _setClientNavigationsRunAtForegroundPriority:YES];
RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (261406 => 261407)
--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2020-05-08 20:08:38 UTC (rev 261406)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2020-05-08 20:10:24 UTC (rev 261407)
@@ -86,9 +86,6 @@
globalWebViewConfiguration._invisibleAutoplayNotPermitted = NO;
globalWebViewConfiguration._mediaDataLoadsAutomatically = YES;
globalWebViewConfiguration.requiresUserActionForMediaPlayback = NO;
-
- // Make sure the view does not get suspended and runs at foreground priority, even if not visible on screen.
- globalWebViewConfiguration._alwaysRunsAtForegroundPriority = YES;
#endif
globalWebViewConfiguration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;