Changeset 225592 in webkit


Ignore:
Timestamp:
Dec 6, 2017 1:02:30 PM (6 years ago)
Author:
n_wang@apple.com
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):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r225590 r225592  
     12017-12-06  Nan Wang  <n_wang@apple.com>
     2
     3        AX: [iOS] Post accessibility notification when a web process changes its suspended state
     4        https://bugs.webkit.org/show_bug.cgi?id=180458
     5        <rdar://problem/35869115>
     6
     7        Reviewed by Chris Dumez.
     8
     9        Post accessibility notification with the pid information when a web process
     10        becomes suspended or resumes running.
     11
     12        * WebProcess/WebProcess.cpp:
     13        (WebKit::WebProcess::actualPrepareToSuspend):
     14        (WebKit::WebProcess::processDidResume):
     15        * WebProcess/WebProcess.h:
     16        * WebProcess/cocoa/WebProcessCocoa.mm:
     17        (WebKit::WebProcess::accessibilityProcessSuspendedNotification):
     18
    1192017-12-06  Ryan Haddad  <ryanhaddad@apple.com>
    220
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r225289 r225592  
    13331333#endif
    13341334
     1335#if PLATFORM(IOS)
     1336    accessibilityProcessSuspendedNotification(true);
     1337#endif
     1338
    13351339    markAllLayersVolatile([this, shouldAcknowledgeWhenReadyToSuspend] {
    13361340        RELEASE_LOG(ProcessSuspension, "%p - WebProcess::markAllLayersVolatile() Successfuly marked all layers as volatile", this);
     
    14191423    cancelMarkAllLayersVolatile();
    14201424    setAllLayerTreeStatesFrozen(false);
     1425   
     1426#if PLATFORM(IOS)
     1427    accessibilityProcessSuspendedNotification(false);
     1428#endif
    14211429}
    14221430
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r225289 r225592  
    233233    WebCacheStorageProvider& cacheStorageProvider() { return m_cacheStorageProvider.get(); }
    234234
     235#if PLATFORM(IOS)
     236    void accessibilityProcessSuspendedNotification(bool);
     237#endif
     238
    235239private:
    236240    WebProcess();
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r224806 r225592  
    7171
    7272#if PLATFORM(IOS)
     73#import <UIKit/UIAccessibility.h>
    7374#import <pal/spi/ios/GraphicsServicesSPI.h>
     75
     76#if USE(APPLE_INTERNAL_SDK)
     77#import <AXRuntime/AXDefines.h>
     78#import <AXRuntime/AXNotificationConstants.h>
     79#else
     80#define kAXPidStatusChangedNotification 0
     81#endif
     82
    7483#endif
    7584
     
    524533}
    525534
     535#if PLATFORM(IOS)
     536void WebProcess::accessibilityProcessSuspendedNotification(bool suspended)
     537{
     538    UIAccessibilityPostNotification(kAXPidStatusChangedNotification, @{ @"pid" : @(getpid()), @"suspended" : @(suspended) });
     539}
     540#endif
     541
    526542} // namespace WebKit
Note: See TracChangeset for help on using the changeset viewer.