Modified: trunk/Source/WebKit/ChangeLog (231497 => 231498)
--- trunk/Source/WebKit/ChangeLog 2018-05-08 18:57:48 UTC (rev 231497)
+++ trunk/Source/WebKit/ChangeLog 2018-05-08 18:58:25 UTC (rev 231498)
@@ -1,3 +1,21 @@
+2018-05-08 Chris Dumez <[email protected]>
+
+ Unreviewed, rolling out r231376 and r231458.
+
+ Caused some API tests failures on iOS
+
+ Reverted changesets:
+
+ "[iOS] Apps that are not visible may not get suspended if they
+ trigger page loads while in the background"
+ https://bugs.webkit.org/show_bug.cgi?id=185318
+ https://trac.webkit.org/changeset/231376
+
+ "[iOS] Release page load process assertion if the screen is
+ locked"
+ https://bugs.webkit.org/show_bug.cgi?id=185333
+ https://trac.webkit.org/changeset/231458
+
2018-05-08 Dean Jackson <[email protected]>
Use thumbnails in System Previews
Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h (231497 => 231498)
--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h 2018-05-08 18:57:48 UTC (rev 231497)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h 2018-05-08 18:58:25 UTC (rev 231498)
@@ -82,11 +82,6 @@
void didFirstPaint();
-#if PLATFORM(IOS)
- enum class NetworkActivityTokenReleaseReason { LoadCompleted, ScreenLocked };
- void releaseNetworkActivityToken(NetworkActivityTokenReleaseReason);
-#endif
-
private:
class NavigationClient final : public API::NavigationClient {
public:
@@ -177,7 +172,7 @@
void didChangeWebProcessIsResponsive() override;
#if PLATFORM(IOS)
- void releaseNetworkActivityTokenAfterLoadCompletion() { releaseNetworkActivityToken(NetworkActivityTokenReleaseReason::LoadCompleted); }
+ void releaseNetworkActivityToken();
#endif
WKWebView *m_webView;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (231497 => 231498)
--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2018-05-08 18:57:48 UTC (rev 231497)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2018-05-08 18:58:25 UTC (rev 231498)
@@ -97,7 +97,7 @@
, m_navigationDelegateMethods()
, m_historyDelegateMethods()
#if PLATFORM(IOS)
- , m_releaseActivityTimer(RunLoop::current(), this, &NavigationState::releaseNetworkActivityTokenAfterLoadCompletion)
+ , m_releaseActivityTimer(RunLoop::current(), this, &NavigationState::releaseNetworkActivityToken)
#endif
{
ASSERT(m_webView->_page);
@@ -1145,21 +1145,11 @@
}
#if PLATFORM(IOS)
-void NavigationState::releaseNetworkActivityToken(NetworkActivityTokenReleaseReason reason)
+void NavigationState::releaseNetworkActivityToken()
{
- if (!m_activityToken)
- return;
-
- switch (reason) {
- case NetworkActivityTokenReleaseReason::LoadCompleted:
- RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p NavigationState is releasing background process assertion because a page load completed", this);
- break;
- case NetworkActivityTokenReleaseReason::ScreenLocked:
- RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p NavigationState is releasing background process assertion because the screen was locked", this);
- break;
- }
+ RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p UIProcess is releasing a background assertion because a page load completed", this);
+ ASSERT(m_activityToken);
m_activityToken = nullptr;
- m_releaseActivityTimer.stop();
}
#endif
@@ -1167,27 +1157,17 @@
{
#if PLATFORM(IOS)
if (m_webView->_page->pageLoadState().isLoading()) {
- // We do not take a network activity token if a load starts after the screen has been locked.
- if ([UIApp isSuspendedUnderLock])
- return;
-
- if (m_releaseActivityTimer.isActive()) {
- RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NavigationState keeps its process network assertion because a new page load started", this);
+ if (m_releaseActivityTimer.isActive())
m_releaseActivityTimer.stop();
- }
- if (!m_activityToken) {
- RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NavigationState is taking a process network assertion because a page load started", this);
+ else {
+ RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - UIProcess is taking a background assertion because a page load started", this);
+ ASSERT(!m_activityToken);
m_activityToken = m_webView->_page->process().throttler().backgroundActivityToken();
}
- } else if (m_activityToken) {
- if (m_webView._isBackground)
- releaseNetworkActivityTokenAfterLoadCompletion();
- else {
- // The application is visible so we delay releasing the background activity for 3 seconds to give it a chance to start another navigation
- // before suspending the WebContent process <rdar://problem/27910964>.
- RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NavigationState will release its process network assertion soon because the page load completed", this);
- m_releaseActivityTimer.startOneShot(3_s);
- }
+ } else {
+ // Delay releasing the background activity for 3 seconds to give the application a chance to start another navigation
+ // before suspending the WebContent process <rdar://problem/27910964>.
+ m_releaseActivityTimer.startOneShot(3_s);
}
#endif
Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (231497 => 231498)
--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2018-05-08 18:57:48 UTC (rev 231497)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2018-05-08 18:58:25 UTC (rev 231498)
@@ -34,7 +34,6 @@
#import "InteractionInformationAtPosition.h"
#import "Logging.h"
#import "NativeWebKeyboardEvent.h"
-#import "NavigationState.h"
#import "PageClient.h"
#import "PrintInfo.h"
#import "RemoteLayerTreeDrawingAreaProxy.h"
@@ -678,11 +677,6 @@
void WebPageProxy::applicationDidEnterBackground()
{
bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock];
-
- // We normally delay process suspension when the app is backgrounded until the current page load completes. However,
- // we do not want to do so when the screen is locked for power reasons.
- if (isSuspendedUnderLock)
- NavigationState::fromWebPage(*this).releaseNetworkActivityToken(NavigationState::NetworkActivityTokenReleaseReason::ScreenLocked);
m_process->send(Messages::WebPage::ApplicationDidEnterBackground(isSuspendedUnderLock), m_pageID);
}