Title: [225592] trunk/Source/WebKit
- Revision
- 225592
- Author
- n_w...@apple.com
- Date
- 2017-12-06 13:02:30 -0800 (Wed, 06 Dec 2017)
Log Message
AX: [iOS] Post accessibility notification when a web process changes its suspended state
https://bugs.webkit.org/show_bug.cgi?id=180458
<rdar://problem/35869115>
Reviewed by Chris Dumez.
Post accessibility notification with the pid information when a web process
becomes suspended or resumes running.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityProcessSuspendedNotification):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (225591 => 225592)
--- trunk/Source/WebKit/ChangeLog 2017-12-06 20:51:59 UTC (rev 225591)
+++ trunk/Source/WebKit/ChangeLog 2017-12-06 21:02:30 UTC (rev 225592)
@@ -1,3 +1,21 @@
+2017-12-06 Nan Wang <n_w...@apple.com>
+
+ AX: [iOS] Post accessibility notification when a web process changes its suspended state
+ https://bugs.webkit.org/show_bug.cgi?id=180458
+ <rdar://problem/35869115>
+
+ Reviewed by Chris Dumez.
+
+ Post accessibility notification with the pid information when a web process
+ becomes suspended or resumes running.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::actualPrepareToSuspend):
+ (WebKit::WebProcess::processDidResume):
+ * WebProcess/WebProcess.h:
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::accessibilityProcessSuspendedNotification):
+
2017-12-06 Ryan Haddad <ryanhad...@apple.com>
Unreviewed build fix, removed unused lambda capture.
Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (225591 => 225592)
--- trunk/Source/WebKit/WebProcess/WebProcess.cpp 2017-12-06 20:51:59 UTC (rev 225591)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp 2017-12-06 21:02:30 UTC (rev 225592)
@@ -1332,6 +1332,10 @@
destroyRenderingResources();
#endif
+#if PLATFORM(IOS)
+ accessibilityProcessSuspendedNotification(true);
+#endif
+
markAllLayersVolatile([this, shouldAcknowledgeWhenReadyToSuspend] {
RELEASE_LOG(ProcessSuspension, "%p - WebProcess::markAllLayersVolatile() Successfuly marked all layers as volatile", this);
@@ -1418,6 +1422,10 @@
cancelMarkAllLayersVolatile();
setAllLayerTreeStatesFrozen(false);
+
+#if PLATFORM(IOS)
+ accessibilityProcessSuspendedNotification(false);
+#endif
}
void WebProcess::pageDidEnterWindow(uint64_t pageID)
Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (225591 => 225592)
--- trunk/Source/WebKit/WebProcess/WebProcess.h 2017-12-06 20:51:59 UTC (rev 225591)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h 2017-12-06 21:02:30 UTC (rev 225592)
@@ -232,6 +232,10 @@
WebCacheStorageProvider& cacheStorageProvider() { return m_cacheStorageProvider.get(); }
+#if PLATFORM(IOS)
+ void accessibilityProcessSuspendedNotification(bool);
+#endif
+
private:
WebProcess();
~WebProcess();
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (225591 => 225592)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2017-12-06 20:51:59 UTC (rev 225591)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2017-12-06 21:02:30 UTC (rev 225592)
@@ -70,9 +70,18 @@
#import <stdio.h>
#if PLATFORM(IOS)
+#import <UIKit/UIAccessibility.h>
#import <pal/spi/ios/GraphicsServicesSPI.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <AXRuntime/AXDefines.h>
+#import <AXRuntime/AXNotificationConstants.h>
+#else
+#define kAXPidStatusChangedNotification 0
#endif
+#endif
+
#if USE(OS_STATE)
#import <os/state_private.h>
#endif
@@ -523,4 +532,11 @@
return setCrashReportApplicationSpecificInformation((__bridge CFStringRef)infoString);
}
+#if PLATFORM(IOS)
+void WebProcess::accessibilityProcessSuspendedNotification(bool suspended)
+{
+ UIAccessibilityPostNotification(kAXPidStatusChangedNotification, @{ @"pid" : @(getpid()), @"suspended" : @(suspended) });
+}
+#endif
+
} // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes