Title: [260912] trunk/Source/WebKit
Revision
260912
Author
[email protected]
Date
2020-04-29 13:16:52 -0700 (Wed, 29 Apr 2020)

Log Message

[iOS][WK2] Temporarily stop using RunningBoard for the foreground process assertion
https://bugs.webkit.org/show_bug.cgi?id=211196
<rdar://problem/62535822>

Reviewed by Tim Horton.

Temporarily stop using RunningBoard for the foreground process assertion. On recent iOS builds, there
are issues where this assertion can time out after 30 seconds, even though the process is still
foreground.

* Configurations/WebKit.xcconfig:
* UIProcess/ProcessAssertion.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::runningBoardNameForAssertionType):
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::~ProcessAssertion):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (260911 => 260912)


--- trunk/Source/WebKit/ChangeLog	2020-04-29 20:06:18 UTC (rev 260911)
+++ trunk/Source/WebKit/ChangeLog	2020-04-29 20:16:52 UTC (rev 260912)
@@ -1,3 +1,22 @@
+2020-04-29  Chris Dumez  <[email protected]>
+
+        [iOS][WK2] Temporarily stop using RunningBoard for the foreground process assertion
+        https://bugs.webkit.org/show_bug.cgi?id=211196
+        <rdar://problem/62535822>
+
+        Reviewed by Tim Horton.
+
+        Temporarily stop using RunningBoard for the foreground process assertion. On recent iOS builds, there
+        are issues where this assertion can time out after 30 seconds, even though the process is still
+        foreground.
+
+        * Configurations/WebKit.xcconfig:
+        * UIProcess/ProcessAssertion.h:
+        * UIProcess/ios/ProcessAssertionIOS.mm:
+        (WebKit::runningBoardNameForAssertionType):
+        (WebKit::ProcessAssertion::ProcessAssertion):
+        (WebKit::ProcessAssertion::~ProcessAssertion):
+
 2020-04-29  Youenn Fablet  <[email protected]>
 
         Set _STAttributionDisplayName to iOS WebContent Info plist

Modified: trunk/Source/WebKit/Configurations/WebKit.xcconfig (260911 => 260912)


--- trunk/Source/WebKit/Configurations/WebKit.xcconfig	2020-04-29 20:06:18 UTC (rev 260911)
+++ trunk/Source/WebKit/Configurations/WebKit.xcconfig	2020-04-29 20:16:52 UTC (rev 260912)
@@ -48,16 +48,8 @@
 WK_APPKIT_LDFLAGS_macosx = -framework AppKit;
 WK_APPKIT_LDFLAGS_maccatalyst = -framework AppKit;
 
-WK_ASSERTION_SERVICES_LDFLAGS = $(WK_ASSERTION_SERVICES_LDFLAGS_$(WK_PLATFORM_NAME));
-WK_ASSERTION_SERVICES_LDFLAGS_iphoneos = $(WK_ASSERTION_SERVICES_LDFLAGS$(WK_IOS_14));
-WK_ASSERTION_SERVICES_LDFLAGS_iphonesimulator = $(WK_ASSERTION_SERVICES_LDFLAGS$(WK_IOS_14));
-WK_ASSERTION_SERVICES_LDFLAGS_IOS_BEFORE_14 = -framework AssertionServices;
-// FIXME: It is unnecessary to link against AssertionServices with the latest SDK for the following platforms too.
-WK_ASSERTION_SERVICES_LDFLAGS_watchos = -framework AssertionServices;
-WK_ASSERTION_SERVICES_LDFLAGS_watchsimulator = -framework AssertionServices;
-WK_ASSERTION_SERVICES_LDFLAGS_appletvos = -framework AssertionServices;
-WK_ASSERTION_SERVICES_LDFLAGS_appletvsimulator = -framework AssertionServices;
-WK_ASSERTION_SERVICES_LDFLAGS_maccatalyst = -framework AssertionServices;
+WK_ASSERTION_SERVICES_LDFLAGS = $(WK_ASSERTION_SERVICES_LDFLAGS_$(WK_COCOA_TOUCH));
+WK_ASSERTION_SERVICES_LDFLAGS_cocoatouch = -framework AssertionServices;
 
 WK_RUNNINGBOARD_SERVICES_LDFLAGS = $(WK_RUNNINGBOARD_SERVICES_LDFLAGS_$(WK_COCOA_TOUCH));
 WK_RUNNINGBOARD_SERVICES_LDFLAGS_cocoatouch = -framework RunningBoardServices;

Modified: trunk/Source/WebKit/UIProcess/ProcessAssertion.h (260911 => 260912)


--- trunk/Source/WebKit/UIProcess/ProcessAssertion.h	2020-04-29 20:06:18 UTC (rev 260911)
+++ trunk/Source/WebKit/UIProcess/ProcessAssertion.h	2020-04-29 20:16:52 UTC (rev 260912)
@@ -39,9 +39,7 @@
 
 OBJC_CLASS RBSAssertion;
 OBJC_CLASS WKRBSAssertionDelegate;
-#if !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
 OBJC_CLASS BKSProcessAssertion;
-#endif
 #endif // PLATFORM(IOS_FAMILY)
 
 namespace WebKit {
@@ -87,9 +85,7 @@
 #if PLATFORM(IOS_FAMILY)
     RetainPtr<RBSAssertion> m_rbsAssertion;
     RetainPtr<WKRBSAssertionDelegate> m_delegate;
-#if !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
     RetainPtr<BKSProcessAssertion> m_bksAssertion; // Legacy.
-#endif
     Validity m_validity { Validity::Unset };
 #endif
     Client* m_client { nullptr };

Modified: trunk/Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm (260911 => 260912)


--- trunk/Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm	2020-04-29 20:06:18 UTC (rev 260911)
+++ trunk/Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm	2020-04-29 20:16:52 UTC (rev 260912)
@@ -28,6 +28,7 @@
 
 #if PLATFORM(IOS_FAMILY)
 
+#import "AssertionServicesSPI.h"
 #import "Logging.h"
 #import "RunningBoardServicesSPI.h"
 #import "WebProcessPool.h"
@@ -37,10 +38,6 @@
 #import <wtf/Vector.h>
 #import <wtf/WeakHashSet.h>
 
-#if !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
-#import "AssertionServicesSPI.h"
-#endif
-
 using WebKit::ProcessAndUIAssertion;
 
 // This gives some time to our child processes to process the ProcessWillSuspendImminently IPC but makes sure we release
@@ -312,7 +309,7 @@
     case ProcessAssertionType::UnboundedNetworking:
         return @"UnboundedNetworking";
     case ProcessAssertionType::Foreground:
-        return @"Foreground";
+        return nil; // We are not using RunningBoard for the Foreground assertion yet due to <rdar://problem/62535822>.
     case ProcessAssertionType::DependentProcessLink:
         return @"DependentProcessLink";
     case ProcessAssertionType::MediaPlayback:
@@ -325,8 +322,6 @@
 #endif
 }
 
-#if !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
-
 const BKSProcessAssertionFlags suspendedTabFlags = (BKSProcessAssertionAllowIdleSleep);
 const BKSProcessAssertionFlags backgroundTabFlags = (BKSProcessAssertionPreventTaskSuspend);
 const BKSProcessAssertionFlags foregroundTabFlags = (BKSProcessAssertionPreventTaskSuspend | BKSProcessAssertionWantsForegroundResourcePriority | BKSProcessAssertionPreventTaskThrottleDown);
@@ -365,8 +360,6 @@
     }
 }
 
-#endif // !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
-
 ProcessAssertion::ProcessAssertion(pid_t pid, const String& reason, ProcessAssertionType assertionType)
     : m_assertionType(assertionType)
     , m_pid(pid)
@@ -374,7 +367,6 @@
     auto weakThis = makeWeakPtr(*this);
     NSString *runningBoardAssertionName = runningBoardNameForAssertionType(assertionType);
 
-#if !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
     if (!runningBoardAssertionName) {
         // Legacy code path.
         BKSProcessAssertionAcquisitionHandler handler = ^(BOOL acquired) {
@@ -399,7 +391,6 @@
         };
         return;
     }
-#endif // !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
 
     ASSERT(runningBoardAssertionName);
     if (!pid) {
@@ -440,12 +431,10 @@
         [m_rbsAssertion invalidate];
     }
 
-#if !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
     if (m_bksAssertion) {
         m_bksAssertion.get().invalidationHandler = nil;
         [m_bksAssertion invalidate];
     }
-#endif
 }
 
 void ProcessAssertion::processAssertionWasInvalidated()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to