Title: [280865] trunk/Source/WebKit
Revision
280865
Author
andresg...@apple.com
Date
2021-08-10 14:37:20 -0700 (Tue, 10 Aug 2021)

Log Message

Notify accessibility that WebProcess is suspended when in process cache.
https://bugs.webkit.org/show_bug.cgi?id=228936
rdar://80911502

Reviewed by Chris Dumez.

Need to notify accessibility clients that a WebProcess in the process
cache is suspended. Otherwise accessibility clients may continue making
requests to the cached Webprocess and be waiting indefinitely for a
suspended process.
Deleted WebProcess::accessibilityProcessSuspendedNotification and
instead use IPC::AccessibilityProcessSuspendedNotification

* Platform/IPC/Connection.h:
* Platform/IPC/cocoa/ConnectionCocoa.mm:
(IPC::AccessibilityProcessSuspendedNotification):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setIsInProcessCache):
(WebKit::WebProcess::prepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityProcessSuspendedNotification): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (280864 => 280865)


--- trunk/Source/WebKit/ChangeLog	2021-08-10 21:35:31 UTC (rev 280864)
+++ trunk/Source/WebKit/ChangeLog	2021-08-10 21:37:20 UTC (rev 280865)
@@ -1,3 +1,29 @@
+2021-08-10  Andres Gonzalez  <andresg...@apple.com>
+
+        Notify accessibility that WebProcess is suspended when in process cache.
+        https://bugs.webkit.org/show_bug.cgi?id=228936
+        rdar://80911502
+
+        Reviewed by Chris Dumez.
+
+        Need to notify accessibility clients that a WebProcess in the process
+        cache is suspended. Otherwise accessibility clients may continue making
+        requests to the cached Webprocess and be waiting indefinitely for a
+        suspended process.
+        Deleted WebProcess::accessibilityProcessSuspendedNotification and
+        instead use IPC::AccessibilityProcessSuspendedNotification
+
+        * Platform/IPC/Connection.h:
+        * Platform/IPC/cocoa/ConnectionCocoa.mm:
+        (IPC::AccessibilityProcessSuspendedNotification):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::setIsInProcessCache):
+        (WebKit::WebProcess::prepareToSuspend):
+        (WebKit::WebProcess::processDidResume):
+        * WebProcess/WebProcess.h:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::accessibilityProcessSuspendedNotification): Deleted.
+
 2021-08-10  Kimmo Kinnunen  <kkinnu...@apple.com>
 
         Scripts/generate-derived-sources.sh: line 19: [: binary operator expected while building Source/WebKit

Modified: trunk/Source/WebKit/Platform/IPC/Connection.h (280864 => 280865)


--- trunk/Source/WebKit/Platform/IPC/Connection.h	2021-08-10 21:35:31 UTC (rev 280864)
+++ trunk/Source/WebKit/Platform/IPC/Connection.h	2021-08-10 21:37:20 UTC (rev 280865)
@@ -656,4 +656,6 @@
     static std::atomic<unsigned> unboundedSynchronousIPCCount;
 };
 
+void AccessibilityProcessSuspendedNotification(bool suspended);
+
 } // namespace IPC

Modified: trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm (280864 => 280865)


--- trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm	2021-08-10 21:35:31 UTC (rev 280864)
+++ trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm	2021-08-10 21:37:20 UTC (rev 280865)
@@ -615,8 +615,8 @@
 
     return false;
 }
-    
-static void AccessibilityProcessSuspendedNotification(bool suspended)
+
+void AccessibilityProcessSuspendedNotification(bool suspended)
 {
 #if PLATFORM(MAC)
     _AXUIElementNotifyProcessSuspendStatus(suspended ? AXSuspendStatusSuspended : AXSuspendStatusRunning);
@@ -626,7 +626,7 @@
     UNUSED_PARAM(suspended);
 #endif
 }
-    
+
 void Connection::willSendSyncMessage(OptionSet<SendSyncOption> sendSyncOptions)
 {
     if (sendSyncOptions.contains(IPC::SendSyncOption::InformPlatformProcessWillSuspend) && WebCore::AXObjectCache::accessibilityEnabled())

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (280864 => 280865)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-08-10 21:35:31 UTC (rev 280864)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-08-10 21:37:20 UTC (rev 280865)
@@ -628,6 +628,8 @@
     }
 
     updateProcessName(IsInProcessInitialization::No);
+
+    IPC::AccessibilityProcessSuspendedNotification(isInProcessCache);
 #else
     UNUSED_PARAM(isInProcessCache);
 #endif
@@ -1518,7 +1520,7 @@
     SQLiteDatabase::setIsDatabaseOpeningForbidden(true);
     if (DatabaseTracker::isInitialized())
         DatabaseTracker::singleton().closeAllDatabases(CurrentQueryBehavior::Interrupt);
-    accessibilityProcessSuspendedNotification(true);
+    IPC::AccessibilityProcessSuspendedNotification(true);
     updateFreezerStatus();
 #endif
 
@@ -1580,7 +1582,7 @@
 #if PLATFORM(IOS_FAMILY)
     m_webSQLiteDatabaseTracker.setIsSuspended(false);
     SQLiteDatabase::setIsDatabaseOpeningForbidden(false);
-    accessibilityProcessSuspendedNotification(false);
+    IPC::AccessibilityProcessSuspendedNotification(false);
 #endif
 
 #if ENABLE(VIDEO)

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (280864 => 280865)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2021-08-10 21:35:31 UTC (rev 280864)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2021-08-10 21:37:20 UTC (rev 280865)
@@ -340,10 +340,6 @@
     WebCookieJar& cookieJar() { return m_cookieJar.get(); }
     WebSocketChannelManager& webSocketChannelManager() { return m_webSocketChannelManager; }
 
-#if PLATFORM(IOS_FAMILY)
-    void accessibilityProcessSuspendedNotification(bool);
-#endif
-
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     float backlightLevel() const { return m_backlightLevel; }
 #endif

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (280864 => 280865)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-08-10 21:35:31 UTC (rev 280864)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-08-10 21:37:20 UTC (rev 280865)
@@ -939,11 +939,6 @@
 }
 
 #if PLATFORM(IOS_FAMILY)
-void WebProcess::accessibilityProcessSuspendedNotification(bool suspended)
-{
-    UIAccessibilityPostNotification(kAXPidStatusChangedNotification, @{ @"pid" : @(getpid()), @"suspended" : @(suspended) });
-}
-
 void WebProcess::userInterfaceIdiomDidChange(bool isPhoneOrWatch)
 {
     WebKit::setCurrentUserInterfaceIdiomIsPhoneOrWatch(isPhoneOrWatch);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to