Diff
Modified: trunk/Source/WebKit/ChangeLog (250110 => 250111)
--- trunk/Source/WebKit/ChangeLog 2019-09-19 23:55:36 UTC (rev 250110)
+++ trunk/Source/WebKit/ChangeLog 2019-09-20 00:11:57 UTC (rev 250111)
@@ -1,5 +1,19 @@
2019-09-19 Chris Dumez <[email protected]>
+ Add better logging for when the view visibility state changes
+ https://bugs.webkit.org/show_bug.cgi?id=202008
+
+ Reviewed by Geoffrey Garen.
+
+ * UIProcess/ApplicationStateTracker.mm:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::updateActivityState):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::applicationDidEnterBackground):
+ (WebKit::WebPageProxy::applicationWillEnterForeground):
+
+2019-09-19 Chris Dumez <[email protected]>
+
Regression(r248832): Unable to quicklook HTML files in Mail
https://bugs.webkit.org/show_bug.cgi?id=202012
<rdar://problem/55285295>
Modified: trunk/Source/WebKit/UIProcess/ApplicationStateTracker.mm (250110 => 250111)
--- trunk/Source/WebKit/UIProcess/ApplicationStateTracker.mm 2019-09-19 23:55:36 UTC (rev 250110)
+++ trunk/Source/WebKit/UIProcess/ApplicationStateTracker.mm 2019-09-20 00:11:57 UTC (rev 250111)
@@ -105,11 +105,14 @@
switch (applicationType(window)) {
case ApplicationType::Application: {
m_isInBackground = application.applicationState == UIApplicationStateBackground;
+ RELEASE_LOG(ProcessSuspension, "%p - ApplicationStateTracker::ApplicationStateTracker(): m_isInBackground: %d", this, m_isInBackground);
#if HAVE(UISCENE)
m_didEnterBackgroundObserver = [notificationCenter addObserverForName:UISceneDidEnterBackgroundNotification object:window.windowScene queue:nil usingBlock:[this](NSNotification *) {
+ RELEASE_LOG(ProcessSuspension, "%p - ApplicationStateTracker: UISceneDidEnterBackground", this);
#else
m_didEnterBackgroundObserver = [notificationCenter addObserverForName:UIApplicationDidEnterBackgroundNotification object:application queue:nil usingBlock:[this](NSNotification *) {
+ RELEASE_LOG(ProcessSuspension, "%p - ApplicationStateTracker: UIApplicationDidEnterBackground", this);
#endif
applicationDidEnterBackground();
}];
@@ -116,8 +119,10 @@
#if HAVE(UISCENE)
m_willEnterForegroundObserver = [notificationCenter addObserverForName:UISceneWillEnterForegroundNotification object:window.windowScene queue:nil usingBlock:[this](NSNotification *) {
+ RELEASE_LOG(ProcessSuspension, "%p - ApplicationStateTracker: UISceneWillEnterForeground", this);
#else
m_willEnterForegroundObserver = [notificationCenter addObserverForName:UIApplicationWillEnterForegroundNotification object:application queue:nil usingBlock:[this](NSNotification *) {
+ RELEASE_LOG(ProcessSuspension, "%p - ApplicationStateTracker: UIApplicationWillEnterForeground", this);
#endif
applicationWillEnterForeground();
}];
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (250110 => 250111)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-09-19 23:55:36 UTC (rev 250110)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-09-20 00:11:57 UTC (rev 250111)
@@ -1726,13 +1726,19 @@
void WebPageProxy::updateActivityState(OptionSet<ActivityState::Flag> flagsToUpdate)
{
+ bool wasVisible = isViewVisible();
m_activityState.remove(flagsToUpdate);
if (flagsToUpdate & ActivityState::IsFocused && pageClient().isViewFocused())
m_activityState.add(ActivityState::IsFocused);
if (flagsToUpdate & ActivityState::WindowIsActive && pageClient().isViewWindowActive())
m_activityState.add(ActivityState::WindowIsActive);
- if (flagsToUpdate & ActivityState::IsVisible && pageClient().isViewVisible())
- m_activityState.add(ActivityState::IsVisible);
+ if (flagsToUpdate & ActivityState::IsVisible) {
+ bool isNowVisible = pageClient().isViewVisible();
+ if (isNowVisible)
+ m_activityState.add(ActivityState::IsVisible);
+ if (wasVisible != isNowVisible)
+ RELEASE_LOG_IF_ALLOWED(ViewState, "updateActivityState: view visibility state changed %d -> %d", wasVisible, isNowVisible);
+ }
if (flagsToUpdate & ActivityState::IsVisibleOrOccluded && pageClient().isViewVisibleOrOccluded())
m_activityState.add(ActivityState::IsVisibleOrOccluded);
if (flagsToUpdate & ActivityState::IsInWindow && pageClient().isViewInWindow())
Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (250110 => 250111)
--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2019-09-19 23:55:36 UTC (rev 250110)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2019-09-20 00:11:57 UTC (rev 250111)
@@ -74,6 +74,8 @@
#import <wtf/text/WTFString.h>
#endif
+#define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [pageProxyID=%llu, webPageID=%llu, PID=%i] WebPageProxy::" fmt, this, m_identifier.toUInt64(), m_webPageID.toUInt64(), m_process->processIdentifier(), ##__VA_ARGS__)
+
namespace WebKit {
using namespace WebCore;
@@ -647,6 +649,8 @@
void WebPageProxy::applicationDidEnterBackground()
{
bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock];
+
+ RELEASE_LOG_IF_ALLOWED(ViewState, "applicationDidEnterBackground: isSuspendedUnderLock? %d", isSuspendedUnderLock);
#if !PLATFORM(WATCHOS)
// We normally delay process suspension when the app is backgrounded until the current page load completes. However,
@@ -674,6 +678,8 @@
void WebPageProxy::applicationWillEnterForeground()
{
bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock];
+ RELEASE_LOG_IF_ALLOWED(ViewState, "applicationWillEnterForeground: isSuspendedUnderLock? %d", isSuspendedUnderLock);
+
m_process->send(Messages::WebPage::ApplicationWillEnterForeground(isSuspendedUnderLock), m_webPageID);
m_process->send(Messages::WebPage::HardwareKeyboardAvailabilityChanged(isInHardwareKeyboardMode()), m_webPageID);
}
@@ -1467,4 +1473,6 @@
} // namespace WebKit
+#undef RELEASE_LOG_IF_ALLOWED
+
#endif // PLATFORM(IOS_FAMILY)