[Cocoa] Stop using WKAXRegisterRemoteApp
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Oct 2015 21:32:28 +0000 (21:32 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Oct 2015 21:32:28 +0000 (21:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150283

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* platform/spi/ios/GraphicsServicesSPI.h: Added declaration of GSSystemRootDirectory.

Source/WebKit2:

* Platform/spi/mac: Added.
* Platform/spi/mac/AppKitSPI.h: Added. Includes declaration of
  +[NSAccessibilityRemoteUIElement setRemoteUIApp:].

* WebKit2.xcodeproj/project.pbxproj: Added reference to new header. Also changed the path of
  the Platform/spi/Cocoa group to the corresponding path in the source tree.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::registerWithAccessibility): Added.
(WebKit::WebProcess::platformInitializeProcess): Use new registerWithAccessibility instead
  of WKAXRegisterRemoteApp.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191249 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/spi/ios/GraphicsServicesSPI.h
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/spi/mac/AppKitSPI.h [new file with mode: 0644]
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm

index 36b7154..df4312a 100644 (file)
@@ -1,3 +1,12 @@
+2015-10-17  Dan Bernstein  <mitz@apple.com>
+
+        [Cocoa] Stop using WKAXRegisterRemoteApp
+        https://bugs.webkit.org/show_bug.cgi?id=150283
+
+        Reviewed by Alexey Proskuryakov.
+
+        * platform/spi/ios/GraphicsServicesSPI.h: Added declaration of GSSystemRootDirectory.
+
 2015-10-17  Chris Dumez  <cdumez@apple.com>
 
         td and th should use HTMLTableDataCellElement and HTMLTableHeaderCellElement interfaces
index 14c17ed..fca1bdd 100644 (file)
@@ -40,6 +40,7 @@ WTF_EXTERN_C_BEGIN
 
 void GSInitialize(void);
 uint64_t GSCurrentEventTimestamp(void);
+CFStringRef GSSystemRootDirectory(void);
 
 WTF_EXTERN_C_END
 
index 7e8fa76..13f143d 100644 (file)
@@ -1,3 +1,22 @@
+2015-10-17  Dan Bernstein  <mitz@apple.com>
+
+        [Cocoa] Stop using WKAXRegisterRemoteApp
+        https://bugs.webkit.org/show_bug.cgi?id=150283
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Platform/spi/mac: Added.
+        * Platform/spi/mac/AppKitSPI.h: Added. Includes declaration of
+          +[NSAccessibilityRemoteUIElement setRemoteUIApp:].
+
+        * WebKit2.xcodeproj/project.pbxproj: Added reference to new header. Also changed the path of
+          the Platform/spi/Cocoa group to the corresponding path in the source tree.
+
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::registerWithAccessibility): Added.
+        (WebKit::WebProcess::platformInitializeProcess): Use new registerWithAccessibility instead
+          of WKAXRegisterRemoteApp.
+
 2015-10-16  Simon Fraser  <simon.fraser@apple.com>
 
         Enhance TextStream for logging, remove subclasses, log more things
diff --git a/Source/WebKit2/Platform/spi/mac/AppKitSPI.h b/Source/WebKit2/Platform/spi/mac/AppKitSPI.h
new file mode 100644 (file)
index 0000000..ce9afd5
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AppKit/NSAccessibilityRemoteUIElement.h>
+
+#else
+
+@interface NSAccessibilityRemoteUIElement : NSObject
+
++ (void)setRemoteUIApp:(BOOL)flag;
+
+@end
+
+#endif // USE(APPLE_INTERNAL_SDK)
index d05de1f..79cc664 100644 (file)
                1A81B38018BD66AD0007FDAC /* _WKVisitedLinkStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A81B37E18BD66AD0007FDAC /* _WKVisitedLinkStore.mm */; };
                1A81B38118BD66AD0007FDAC /* _WKVisitedLinkStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A81B37F18BD66AD0007FDAC /* _WKVisitedLinkStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1A81B38518BD673A0007FDAC /* _WKVisitedLinkStoreInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A81B38418BD673A0007FDAC /* _WKVisitedLinkStoreInternal.h */; };
-               1A8B66B01BC43C860082DF77 /* PageLoadStateObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8B66AE1BC43C860082DF77 /* PageLoadStateObserver.h */; settings = {ASSET_TAGS = (); }; };
-               1A8B66B31BC45B010082DF77 /* WKBundleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8B66B11BC45B010082DF77 /* WKBundleMac.mm */; settings = {ASSET_TAGS = (); }; };
+               1A8B66B01BC43C860082DF77 /* PageLoadStateObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8B66AE1BC43C860082DF77 /* PageLoadStateObserver.h */; };
+               1A8B66B31BC45B010082DF77 /* WKBundleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8B66B11BC45B010082DF77 /* WKBundleMac.mm */; };
                1A8B66B41BC45B010082DF77 /* WKBundleMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8B66B21BC45B010082DF77 /* WKBundleMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1A8C728C1738477C000A6554 /* LocalStorageDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C728A1738477C000A6554 /* LocalStorageDatabaseTracker.cpp */; };
                1A8C728D1738477C000A6554 /* LocalStorageDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C728B1738477C000A6554 /* LocalStorageDatabaseTracker.h */; };
                37694525184FC6B600CDE21F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF5068412431861005955AE /* Security.framework */; };
                37716A5A195B910500EE8B1B /* ProcessAssertion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37716A59195B910500EE8B1B /* ProcessAssertion.cpp */; };
                377216B81A4E6BE000DCA718 /* _WKRenderingProgressEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 377216B71A4E6BE000DCA718 /* _WKRenderingProgressEvents.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               37777A0E1BD2CA11007F74B5 /* AppKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 37777A0D1BD2CA11007F74B5 /* AppKitSPI.h */; };
                377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */ = {isa = PBXBuildFile; fileRef = 377EAD4417E2C51A002D193D /* WKDeclarationSpecifiers.h */; settings = {ATTRIBUTES = (Private, ); }; };
                377EAD4817E2C77B002D193D /* WKUserContentInjectedFrames.h in Headers */ = {isa = PBXBuildFile; fileRef = 377EAD4617E2C77B002D193D /* WKUserContentInjectedFrames.h */; settings = {ATTRIBUTES = (Private, ); }; };
                377EAD4917E2C77B002D193D /* WKUserScriptInjectionTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 377EAD4717E2C77B002D193D /* WKUserScriptInjectionTime.h */; settings = {ATTRIBUTES = (Private, ); }; };
                373D122C18A4B6A80066D9CC /* WKWebProcessPlugInFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInFramePrivate.h; sourceTree = "<group>"; };
                3743925718BC4C60001C8675 /* WKUIDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUIDelegatePrivate.h; sourceTree = "<group>"; };
                374436871820E7240049579F /* WKObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKObject.mm; sourceTree = "<group>"; };
-               3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSInvocationSPI.h; path = Cocoa/NSInvocationSPI.h; sourceTree = "<group>"; };
+               3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSInvocationSPI.h; sourceTree = "<group>"; };
                375FB4731883415600BE34D4 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
                3760881C150413E900FC82C7 /* WebRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebRenderObject.cpp; sourceTree = "<group>"; };
                3760881D150413E900FC82C7 /* WebRenderObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderObject.h; sourceTree = "<group>"; };
                3769079C18F340A2001DFF04 /* APIInjectedBundleFormClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleFormClient.h; sourceTree = "<group>"; };
                37716A59195B910500EE8B1B /* ProcessAssertion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessAssertion.cpp; sourceTree = "<group>"; };
                377216B71A4E6BE000DCA718 /* _WKRenderingProgressEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKRenderingProgressEvents.h; sourceTree = "<group>"; };
+               37777A0D1BD2CA11007F74B5 /* AppKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppKitSPI.h; sourceTree = "<group>"; };
                377EAD4417E2C51A002D193D /* WKDeclarationSpecifiers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDeclarationSpecifiers.h; sourceTree = "<group>"; };
                377EAD4617E2C77B002D193D /* WKUserContentInjectedFrames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserContentInjectedFrames.h; sourceTree = "<group>"; };
                377EAD4717E2C77B002D193D /* WKUserScriptInjectionTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserScriptInjectionTime.h; sourceTree = "<group>"; };
                        children = (
                                3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */,
                        );
-                       name = Cocoa;
+                       path = Cocoa;
+                       sourceTree = "<group>";
+               };
+               37777A0C1BD2C9D6007F74B5 /* mac */ = {
+                       isa = PBXGroup;
+                       children = (
+                               37777A0D1BD2CA11007F74B5 /* AppKitSPI.h */,
+                       );
+                       path = mac;
                        sourceTree = "<group>";
                };
                37C4C08318149C2A003688B9 /* Cocoa */ = {
                        children = (
                                3754D5411B3A2998003A4C7F /* Cocoa */,
                                CE1A0BCB1A48E6C60054EF74 /* ios */,
+                               37777A0C1BD2C9D6007F74B5 /* mac */,
                        );
                        path = spi;
                        sourceTree = "<group>";
                                7C4ED3291A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.h in Headers */,
                                E19BDA8A193686A400B97F57 /* SandboxUtilities.h in Headers */,
                                1A7284471959ED100007BCE5 /* SessionStateConversion.h in Headers */,
+                               37777A0E1BD2CA11007F74B5 /* AppKitSPI.h in Headers */,
                                1AF459321946559500F9D4A2 /* WKError.h in Headers */,
                                1ADAE12E1919A5B400F48E21 /* WKPreferences.h in Headers */,
                        );
index be78732..4c8bd27 100644 (file)
 #import <stdio.h>
 #import <wtf/RAMSize.h>
 
+#if USE(APPKIT)
+#import "AppKitSPI.h"
+#endif
+
+#if PLATFORM(IOS)
+#import <WebCore/GraphicsServicesSPI.h>
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -190,9 +198,22 @@ void WebProcess::initializeProcessName(const ChildProcessInitializationParameter
 #endif
 }
 
+static void registerWithAccessibility()
+{
+#if USE(APPKIT)
+    [NSAccessibilityRemoteUIElement setRemoteUIApp:YES];
+#endif
+#if PLATFORM(IOS)
+    NSString *accessibilityBundlePath = [(NSString *)GSSystemRootDirectory() stringByAppendingString:@"/System/Library/AccessibilityBundles/WebProcessLoader.axbundle"];
+    NSError *error;
+    if (![[NSBundle bundleWithPath:accessibilityBundlePath] loadAndReturnError:&error])
+        LOG_ERROR("Failed to load accessibility bundle at %@: %@", accessibilityBundlePath, error);
+#endif
+}
+
 void WebProcess::platformInitializeProcess(const ChildProcessInitializationParameters&)
 {
-    WKAXRegisterRemoteApp();
+    registerWithAccessibility();
 
 #if ENABLE(SEC_ITEM_SHIM)
     SecItemShim::singleton().initialize(this);