Modified: trunk/Source/WebKit2/ChangeLog (218763 => 218764)
--- trunk/Source/WebKit2/ChangeLog 2017-06-23 21:18:28 UTC (rev 218763)
+++ trunk/Source/WebKit2/ChangeLog 2017-06-23 21:26:26 UTC (rev 218764)
@@ -1,5 +1,23 @@
2017-06-23 Chris Dumez <[email protected]>
+ Add more release logging for process assertions
+ https://bugs.webkit.org/show_bug.cgi?id=173624
+ <rdar://problem/32412701>
+
+ Reviewed by Geoffrey Garen.
+
+ Add more release logging for process assertions to help debug issues such
+ as <rdar://problem/32412701>.
+
+ * UIProcess/ProcessThrottler.cpp:
+ (WebKit::ProcessThrottler::didConnectToProcess):
+ * UIProcess/ios/ProcessAssertionIOS.mm:
+ (WebKit::ProcessAssertion::ProcessAssertion):
+ (WebKit::ProcessAssertion::~ProcessAssertion):
+ (WebKit::ProcessAssertion::setState):
+
+2017-06-23 Chris Dumez <[email protected]>
+
Consistently use RunLoop::isMain() in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=173745
<rdar://problem/32936527>
Modified: trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp (218763 => 218764)
--- trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp 2017-06-23 21:18:28 UTC (rev 218763)
+++ trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp 2017-06-23 21:26:26 UTC (rev 218764)
@@ -93,6 +93,8 @@
void ProcessThrottler::didConnectToProcess(pid_t pid)
{
+ RELEASE_LOG(ProcessSuspension, "%p - ProcessThrottler::didConnectToProcess(%d)", this, pid);
+
m_suspendTimer.stop();
if (m_shouldTakeUIBackgroundAssertion)
m_assertion = std::make_unique<ProcessAndUIAssertion>(pid, assertionState());
Modified: trunk/Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm (218763 => 218764)
--- trunk/Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm 2017-06-23 21:18:28 UTC (rev 218763)
+++ trunk/Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm 2017-06-23 21:26:26 UTC (rev 218764)
@@ -105,6 +105,7 @@
- (void)_updateBackgroundTask
{
if (_needsToRunInBackgroundCount && _backgroundTask == UIBackgroundTaskInvalid) {
+ RELEASE_LOG(ProcessSuspension, "%p - WKProcessAssertionBackgroundTaskManager - beginBackgroundTaskWithName", self);
_backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithName:@"com.apple.WebKit.ProcessAssertion" expirationHandler:^{
RELEASE_LOG_ERROR(ProcessSuspension, "Background task expired while holding WebKit ProcessAssertion (isMainThread? %d).", RunLoop::isMain());
// The expiration handler gets called on a non-main thread when the underlying assertion could not be taken (rdar://problem/27278419).
@@ -121,6 +122,7 @@
}
if (!_needsToRunInBackgroundCount && _backgroundTask != UIBackgroundTaskInvalid) {
+ RELEASE_LOG(ProcessSuspension, "%p - WKProcessAssertionBackgroundTaskManager - endBackgroundTask", self);
[[UIApplication sharedApplication] endBackgroundTask:_backgroundTask];
_backgroundTask = UIBackgroundTaskInvalid;
}
@@ -166,7 +168,7 @@
auto weakThis = createWeakPtr();
BKSProcessAssertionAcquisitionHandler handler = ^(BOOL acquired) {
if (!acquired) {
- RELEASE_LOG_ERROR(ProcessSuspension, "Unable to acquire assertion for process %d", pid);
+ RELEASE_LOG_ERROR(ProcessSuspension, " %p - ProcessAssertion() Unable to acquire assertion for process with PID %d", this, pid);
ASSERT_NOT_REACHED();
dispatch_async(dispatch_get_main_queue(), ^{
if (weakThis)
@@ -174,9 +176,11 @@
});
}
};
+ RELEASE_LOG(ProcessSuspension, "%p - ProcessAssertion() Acquiring assertion for process with PID %d", this, pid);
m_assertion = adoptNS([[BKSProcessAssertion alloc] initWithPID:pid flags:flagsForState(assertionState) reason:BKSProcessAssertionReasonExtension name:@"Web content visible" withHandler:handler]);
m_assertion.get().invalidationHandler = ^() {
dispatch_async(dispatch_get_main_queue(), ^{
+ RELEASE_LOG(ProcessSuspension, "%p - ProcessAssertion() Process assertion for process with PID %d was invalidated", this, pid);
if (weakThis)
markAsInvalidated();
});
@@ -189,6 +193,8 @@
if (ProcessAssertionClient* client = this->client())
[[WKProcessAssertionBackgroundTaskManager shared] removeClient:*client];
+
+ RELEASE_LOG(ProcessSuspension, "%p - ~ProcessAssertion() Releasing process assertion", this);
[m_assertion invalidate];
}
@@ -205,6 +211,7 @@
if (m_assertionState == assertionState)
return;
+ RELEASE_LOG(ProcessSuspension, "%p - ProcessAssertion::setState(%u)", this, static_cast<unsigned>(assertionState));
m_assertionState = assertionState;
[m_assertion setFlags:flagsForState(assertionState)];
}