REGRESSION (r231676): watchOS WebKit usually doesn't load in the background
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2018 22:22:42 +0000 (22:22 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2018 22:22:42 +0000 (22:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187663
<rdar://problem/42181185>

Reviewed by Chris Dumez.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidEnterBackground):
"Screen lock" is very aggressive on watchOS; we want to do our usual
30 seconds of loading in the background when you drop your wrist,
so disable this power optimization on that platform.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233818 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

index 69d7327..5798e1f 100644 (file)
@@ -1,3 +1,17 @@
+2018-07-13  Tim Horton  <timothy_horton@apple.com>
+
+        REGRESSION (r231676): watchOS WebKit usually doesn't load in the background
+        https://bugs.webkit.org/show_bug.cgi?id=187663
+        <rdar://problem/42181185>
+
+        Reviewed by Chris Dumez.
+
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::applicationDidEnterBackground):
+        "Screen lock" is very aggressive on watchOS; we want to do our usual
+        30 seconds of loading in the background when you drop your wrist,
+        so disable this power optimization on that platform.
+
 2018-07-13  Chris Dumez  <cdumez@apple.com>
 
         WebResourceLoader may try to send a IPC with a destination ID that is 0
index ffbd8e1..0e592be 100644 (file)
@@ -644,10 +644,12 @@ void WebPageProxy::applicationDidEnterBackground()
 {
     bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock];
 
+#if !PLATFORM(WATCHOS)
     // 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);
+#endif
     m_process->send(Messages::WebPage::ApplicationDidEnterBackground(isSuspendedUnderLock), m_pageID);
 }