[Cocoa] Put most of the Cocoa API behind WK_API_ENABLED guards
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Nov 2013 20:52:04 +0000 (20:52 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Nov 2013 20:52:04 +0000 (20:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=124850

Reviewed by Brady Eidson.

Source/WebKit2:

Guarded all Cocoa API headers and implementatiosn with WK_API_ENABLED. Left the WKView class
unguarded, but limited its API.

* Shared/API/Cocoa/WKFoundation.h: Replaced OBJ_VISIBLE with an explicit attribute.
* Shared/API/Cocoa/WKRemoteObjectCoder.mm: Moved #if WK_API_ENABLED before the rest of the
imports.
* Shared/API/Cocoa/WKRemoteObjectInterface.mm: Ditto.
* Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Ditto.
* Shared/API/Cocoa/WKRemoteObjectRegistryPrivate.h: Ditto.
* UIProcess/API/mac/WKBrowsingContextController.h: Guarded all declarations with
WK_API_ENABLED, changed to use WK_API_CLASS instead of WK_EXPORT.
* UIProcess/API/mac/WKBrowsingContextController.mm: Guarded everything with WK_API_ENABLED.
(-[WKBrowsingContextController dealloc]):
(-[WKBrowsingContextController setPolicyDelegate:]):
(-[WKBrowsingContextController backForwardList]):
(didChangeBackForwardList):
(setUpPageLoaderClient):
(setUpPagePolicyClient):
(-[WKBrowsingContextController _initWithPageRef:]):
* UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Ditto.
* UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Ditto.
* UIProcess/API/mac/WKBrowsingContextGroup.h: Guarded all declarations with WK_API_ENABLED,
chanegd to use WK_API_CLASS instead of WK_EXPORT.
* UIProcess/API/mac/WKBrowsingContextGroup.mm: Removed redundant import, guarded everything
with WK_API_ENABLED.
* UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Guarded with WK_API_ENABLED.
* UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: Added necessary import.
* UIProcess/API/mac/WKConnection.h: Guarded all declarations with WK_API_ENABLED, chanegd to
use WK_API_CLASS instead of WK_EXPORT.
* UIProcess/API/mac/WKConnection.mm: Guarded everything with WK_API_ENABLED.
(-[WKConnection remoteObjectRegistry]):
(didReceiveMessage):
* UIProcess/API/mac/WKConnectionInternal.h: Guarded the delcarations with WK_API_ENABLED.
* UIProcess/API/mac/WKProcessGroup.h: Ditto. Also changed to use WK_API_CLASS instead of
WK_EXPORT.
* UIProcess/API/mac/WKProcessGroup.mm: Guarded everything with WK_API_ENABLED.
(-[WKProcessGroup initWithInjectedBundleURL:]):
* UIProcess/API/mac/WKProcessGroupPrivate.h: Guarded the declarations with WK_API_ENABLED.
* UIProcess/API/mac/WKTypeRefWrapper.h: Moved #if WK_API_ENABLED before the rest of the
imports, changed to use WK_API_CLASS instead of WK_EXPORT.
* UIProcess/API/mac/WKTypeRefWrapper.mm: Removed empty line after #import "config.h".
* UIProcess/API/mac/WKView.h: Added #if WK_API_ENABLED around API that uses other Cocoa API
types.
* UIProcess/API/mac/WKView.mm: Added #if WK_API_ENABLED around implementations of methods
that are only declared when the API is enabled.
* UIProcess/API/mac/WKViewInternal.h: Reordered imports.
* UIProcess/mac/WKFullScreenWindowController.mm: Added comment to #endif.
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess): Guarded use of
WKBrowsingContextController with WK_API_ENABLED.
(WebKit::WebContext::platformInitializeNetworkProcess): Ditto.
* UIProcess/mac/WebContextMenuProxyMac.mm: Removed newline between imports.
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Moved #if WK_API_ENABLED before the
rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: Removed newline after #import
"config.h".
* WebProcess/InjectedBundle/API/mac/WKDOMElement.h: Moved #if WK_API_ENABLED before the
rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
* WebProcess/InjectedBundle/API/mac/WKDOMElement.mm: Removed newline after #import
"config.h".
* WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm: Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMNode.h: Moved #if WK_API_ENABLED before the
rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
* WebProcess/InjectedBundle/API/mac/WKDOMNode.mm: Removed redundant import.
* WebProcess/InjectedBundle/API/mac/WKDOMRange.h:  Moved #if WK_API_ENABLED before the
rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: Removed newline and redundant import.
* WebProcess/InjectedBundle/API/mac/WKDOMText.h: Moved #if WK_API_ENABLED before the
rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
* WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h: Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm: Removed newline after
#import "config.h".
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h: Moved #if WK_API_ENABLED before
the rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm: Removed newline and redundant
imports.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:  Moved #if
WK_API_ENABLED before the rest of the imports, and changed to use WK_API_CLASS instead of
WK_EXPORT.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: Removed
newline after #import "config.h".

Tools:

Added #if WK_API_ENABLED guards around tests that use the Objective-C API.

* TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm:

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

52 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/Cocoa/WKFoundation.h
Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm
Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectInterface.mm
Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectRegistry.mm
Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectRegistryPrivate.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupPrivate.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h
Source/WebKit2/UIProcess/API/mac/WKConnection.h
Source/WebKit2/UIProcess/API/mac/WKConnection.mm
Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h
Source/WebKit2/UIProcess/API/mac/WKProcessGroup.h
Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm
Source/WebKit2/UIProcess/API/mac/WKProcessGroupPrivate.h
Source/WebKit2/UIProcess/API/mac/WKTypeRefWrapper.h
Source/WebKit2/UIProcess/API/mac/WKTypeRefWrapper.mm
Source/WebKit2/UIProcess/API/mac/WKView.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
Source/WebKit2/UIProcess/mac/WebContextMac.mm
Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMDocument.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMElement.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMElement.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm

index a6f4ef3..01bca8c 100644 (file)
@@ -1,3 +1,92 @@
+2013-11-25  Dan Bernstein  <mitz@apple.com>
+
+        [Cocoa] Put most of the Cocoa API behind WK_API_ENABLED guards
+        https://bugs.webkit.org/show_bug.cgi?id=124850
+
+        Reviewed by Brady Eidson.
+
+        Guarded all Cocoa API headers and implementatiosn with WK_API_ENABLED. Left the WKView class
+        unguarded, but limited its API.
+
+        * Shared/API/Cocoa/WKFoundation.h: Replaced OBJ_VISIBLE with an explicit attribute.
+        * Shared/API/Cocoa/WKRemoteObjectCoder.mm: Moved #if WK_API_ENABLED before the rest of the
+        imports.
+        * Shared/API/Cocoa/WKRemoteObjectInterface.mm: Ditto.
+        * Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Ditto.
+        * Shared/API/Cocoa/WKRemoteObjectRegistryPrivate.h: Ditto.
+        * UIProcess/API/mac/WKBrowsingContextController.h: Guarded all declarations with
+        WK_API_ENABLED, changed to use WK_API_CLASS instead of WK_EXPORT.
+        * UIProcess/API/mac/WKBrowsingContextController.mm: Guarded everything with WK_API_ENABLED.
+        (-[WKBrowsingContextController dealloc]):
+        (-[WKBrowsingContextController setPolicyDelegate:]):
+        (-[WKBrowsingContextController backForwardList]):
+        (didChangeBackForwardList):
+        (setUpPageLoaderClient):
+        (setUpPagePolicyClient):
+        (-[WKBrowsingContextController _initWithPageRef:]):
+        * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Ditto.
+        * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Ditto.
+        * UIProcess/API/mac/WKBrowsingContextGroup.h: Guarded all declarations with WK_API_ENABLED,
+        chanegd to use WK_API_CLASS instead of WK_EXPORT.
+        * UIProcess/API/mac/WKBrowsingContextGroup.mm: Removed redundant import, guarded everything
+        with WK_API_ENABLED.
+        * UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Guarded with WK_API_ENABLED.
+        * UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: Added necessary import.
+        * UIProcess/API/mac/WKConnection.h: Guarded all declarations with WK_API_ENABLED, chanegd to
+        use WK_API_CLASS instead of WK_EXPORT.
+        * UIProcess/API/mac/WKConnection.mm: Guarded everything with WK_API_ENABLED.
+        (-[WKConnection remoteObjectRegistry]):
+        (didReceiveMessage):
+        * UIProcess/API/mac/WKConnectionInternal.h: Guarded the delcarations with WK_API_ENABLED.
+        * UIProcess/API/mac/WKProcessGroup.h: Ditto. Also changed to use WK_API_CLASS instead of
+        WK_EXPORT.
+        * UIProcess/API/mac/WKProcessGroup.mm: Guarded everything with WK_API_ENABLED.
+        (-[WKProcessGroup initWithInjectedBundleURL:]):
+        * UIProcess/API/mac/WKProcessGroupPrivate.h: Guarded the declarations with WK_API_ENABLED.
+        * UIProcess/API/mac/WKTypeRefWrapper.h: Moved #if WK_API_ENABLED before the rest of the
+        imports, changed to use WK_API_CLASS instead of WK_EXPORT.
+        * UIProcess/API/mac/WKTypeRefWrapper.mm: Removed empty line after #import "config.h".
+        * UIProcess/API/mac/WKView.h: Added #if WK_API_ENABLED around API that uses other Cocoa API
+        types.
+        * UIProcess/API/mac/WKView.mm: Added #if WK_API_ENABLED around implementations of methods
+        that are only declared when the API is enabled.
+        * UIProcess/API/mac/WKViewInternal.h: Reordered imports.
+        * UIProcess/mac/WKFullScreenWindowController.mm: Added comment to #endif.
+        * UIProcess/mac/WebContextMac.mm:
+        (WebKit::WebContext::platformInitializeWebProcess): Guarded use of
+        WKBrowsingContextController with WK_API_ENABLED.
+        (WebKit::WebContext::platformInitializeNetworkProcess): Ditto.
+        * UIProcess/mac/WebContextMenuProxyMac.mm: Removed newline between imports.
+        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Moved #if WK_API_ENABLED before the
+        rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
+        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: Removed newline after #import
+        "config.h".
+        * WebProcess/InjectedBundle/API/mac/WKDOMElement.h: Moved #if WK_API_ENABLED before the
+        rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
+        * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm: Removed newline after #import
+        "config.h".
+        * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm: Ditto.
+        * WebProcess/InjectedBundle/API/mac/WKDOMNode.h: Moved #if WK_API_ENABLED before the
+        rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
+        * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm: Removed redundant import.
+        * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:  Moved #if WK_API_ENABLED before the
+        rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
+        * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: Removed newline and redundant import.
+        * WebProcess/InjectedBundle/API/mac/WKDOMText.h: Moved #if WK_API_ENABLED before the
+        rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
+        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h: Ditto.
+        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm: Removed newline after
+        #import "config.h".
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h: Moved #if WK_API_ENABLED before
+        the rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm: Removed newline and redundant
+        imports.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:  Moved #if
+        WK_API_ENABLED before the rest of the imports, and changed to use WK_API_CLASS instead of
+        WK_EXPORT.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: Removed
+        newline after #import "config.h".
+
 2013-11-22  Sam Weinig  <sam@webkit.org>
 
         WebPageGroup's should keep track of what processes they are being used by
index 91d6d38..662c3d9 100644 (file)
@@ -31,6 +31,6 @@
 #define WK_API_CLASS NS_CLASS_AVAILABLE_IOS(7_0)
 #else
 #define WK_API_ENABLED (defined(__clang__) && defined(__APPLE__) && !defined(__i386__))
-#define WK_API_CLASS OBJC_VISIBLE
+#define WK_API_CLASS __attribute__((visibility("default")))
 #endif
 #endif
index 9956b97..9c60651 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "WKRemoteObjectCoder.h"
 
+#if WK_API_ENABLED
+
 #import "APIArray.h"
 #import "MutableDictionary.h"
 #import "WKRemoteObjectInterfaceInternal.h"
@@ -37,8 +39,6 @@
 #import <wtf/TemporaryChange.h>
 #import <wtf/text/CString.h>
 
-#if WK_API_ENABLED
-
 static const char* const classNameKey = "$class";
 static const char* const objectStreamKey = "$objectStream";
 
index 7f02ba0..350d117 100644 (file)
 #import "config.h"
 #import "WKRemoteObjectInterface.h"
 
+#if WK_API_ENABLED
+
 #import <objc/runtime.h>
 #import <wtf/HashMap.h>
 #import <wtf/Vector.h>
 #import <wtf/RetainPtr.h>
 
-#if WK_API_ENABLED
-
 extern "C"
 const char *_protocol_getMethodTypeEncoding(Protocol *p, SEL sel, BOOL isRequiredMethod, BOOL isInstanceMethod);
 
index a3588c6..54d102e 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "WKRemoteObjectRegistryInternal.h"
 
+#if WK_API_ENABLED
+
 #import "Connection.h"
 #import "ImmutableDictionary.h"
 #import "MutableDictionary.h"
@@ -36,8 +38,6 @@
 #import "WKSharedAPICast.h"
 #import "WebConnection.h"
 
-#if WK_API_ENABLED
-
 const char* const messageName = "WKRemoteObjectRegistryMessage";
 
 const char* const encodedInvocationKey = "encodedInvocation";
index 87cbed9..d5cfc87 100644 (file)
  */
 
 #import <WebKit2/WKFoundation.h>
-#import <WebKit2/WKRemoteObjectRegistry.h>
-
-#import <WebKit2/WKBase.h>
 
 #if WK_API_ENABLED
 
+#import <WebKit2/WKBase.h>
+#import <WebKit2/WKRemoteObjectRegistry.h>
+
 @interface WKRemoteObjectRegistry (WKPrivate)
 
 - (id)_initWithConnectionRef:(WKConnectionRef)connectionRef;
@@ -37,4 +37,4 @@
 
 @end
 
-#endif
+#endif // WK_API_ENABLED
index d04a177..6a77729 100644 (file)
  */
 
 #import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 #import <WebKit2/WKFoundation.h>
 
+#if WK_API_ENABLED
+
 @class WKBrowsingContextControllerData;
 @class WKBackForwardList;
 @class WKBackForwardListItem;
@@ -34,7 +35,7 @@
 @protocol WKBrowsingContextLoadDelegate;
 @protocol WKBrowsingContextPolicyDelegate;
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKBrowsingContextController : NSObject {
 @private
     WKBrowsingContextControllerData *_data;
@@ -44,10 +45,8 @@ WK_EXPORT
 
 @property (assign) id <WKBrowsingContextLoadDelegate> loadDelegate;
 
-#if WK_API_ENABLED
 @property (assign) id <WKBrowsingContextPolicyDelegate> policyDelegate;
 @property (assign) id <WKBrowsingContextHistoryDelegate> historyDelegate;
-#endif
 
 #pragma mark Loading
 
@@ -99,11 +98,9 @@ WK_EXPORT
 /* Whether there is a previous page in the back/forward list. */
 @property(readonly) BOOL canGoBack;
 
-#if WK_API_ENABLED
 - (void)goToBackForwardListItem:(WKBackForwardListItem *)item;
 
 @property(readonly) WKBackForwardList *backForwardList;
-#endif // WK_API_ENABLED
 
 #pragma mark Active Load Introspection
 
@@ -135,3 +132,5 @@ WK_EXPORT
 @property CGFloat pageZoom;
 
 @end
+
+#endif // WK_API_ENABLED
index edce242..cea7799 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "WKBrowsingContextControllerInternal.h"
 
+#if WK_API_ENABLED
+
 #import "ObjCObjectGraph.h"
 #import "WKBackForwardListInternal.h"
 #import "WKBackForwardListItemInternal.h"
@@ -54,8 +56,6 @@
 
 using namespace WebKit;
 
-#if WK_API_ENABLED
-
 class PageLoadStateObserver : public PageLoadState::Observer {
 public:
     PageLoadStateObserver(WKBrowsingContextController *controller)
@@ -77,8 +77,6 @@ private:
     WKBrowsingContextController *m_controller;
 };
 
-#endif
-
 static inline NSString *autoreleased(WKStringRef string)
 {
     return string ? CFBridgingRelease(WKStringCopyCFString(kCFAllocatorDefault, adoptWK(string).get())) : nil;
@@ -110,12 +108,10 @@ NSString * const WKActionCanShowMIMETypeKey = @"WKActionCanShowMIMETypeKey";
     id <WKBrowsingContextLoadDelegateInternal> _loadDelegateInternal;
 #endif // PLATFORM(IOS)
 
-#if WK_API_ENABLED
     // Delegate for policy callbacks.
     id<WKBrowsingContextPolicyDelegate> _policyDelegate;
 
     std::unique_ptr<PageLoadStateObserver> _pageLoadStateObserver;
-#endif
 }
 @end
 
@@ -126,15 +122,9 @@ NSString * const WKActionCanShowMIMETypeKey = @"WKActionCanShowMIMETypeKey";
 
 - (void)dealloc
 {
-#if WK_API_ENABLED
     toImpl(_data->_pageRef.get())->pageLoadState().removeObserver(*_data->_pageLoadStateObserver);
-#endif
-
     WKPageSetPageLoaderClient(_data->_pageRef.get(), nullptr);
-
-#if WK_API_ENABLED
     WKPageSetPagePolicyClient(_data->_pageRef.get(), nullptr);
-#endif
 
     [_data release];
     [super dealloc];
@@ -157,7 +147,6 @@ NSString * const WKActionCanShowMIMETypeKey = @"WKActionCanShowMIMETypeKey";
     _data->_loadDelegate = loadDelegate;
 }
 
-#if WK_API_ENABLED
 - (id<WKBrowsingContextPolicyDelegate>)policyDelegate
 {
     return _data->_policyDelegate;
@@ -167,7 +156,6 @@ NSString * const WKActionCanShowMIMETypeKey = @"WKActionCanShowMIMETypeKey";
 {
     _data->_policyDelegate = policyDelegate;
 }
-#endif
 
 #pragma mark Loading
 
@@ -323,7 +311,6 @@ static void releaseNSData(unsigned char*, const void* data)
     return WKPageCanGoBack(self._pageRef);
 }
 
-#if WK_API_ENABLED
 - (void)goToBackForwardListItem:(WKBackForwardListItem *)item
 {
     toImpl(self._pageRef)->goToBackForwardItem(&item._item);
@@ -337,7 +324,6 @@ static void releaseNSData(unsigned char*, const void* data)
 
     return wrapper(*list);
 }
-#endif // WK_API_ENABLED
 
 #pragma mark Active Load Introspection
 
@@ -479,15 +465,11 @@ static void releaseNSData(unsigned char*, const void* data)
     return WKPageGetPageCount(self._pageRef);
 }
 
-#if WK_API_ENABLED
-
 - (WKBrowsingContextHandle *)handle
 {
     return [[[WKBrowsingContextHandle alloc] _initWithPageID:toImpl(self._pageRef)->pageID()] autorelease];
 }
 
-#endif
-
 @end
 
 @implementation WKBrowsingContextController (Internal)
@@ -581,7 +563,6 @@ static void didFinishProgress(WKPageRef page, const void* clientInfo)
         [browsingContext.loadDelegate browsingContextControllerDidFinishProgress:browsingContext];
 }
 
-#if WK_API_ENABLED
 static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo)
 {
     WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
@@ -592,7 +573,6 @@ static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef ad
     NSArray *removed = removedItems ? wrapper(*toImpl(removedItems)) : nil;
     [browsingContext.loadDelegate browsingContextControllerDidChangeBackForwardList:browsingContext addedItem:added removedItems:removed];
 }
-#endif // WK_API_ENABLED
 
 static void setUpPageLoaderClient(WKBrowsingContextController *browsingContext, WKPageRef pageRef)
 {
@@ -611,15 +591,11 @@ static void setUpPageLoaderClient(WKBrowsingContextController *browsingContext,
     loaderClient.didStartProgress = didStartProgress;
     loaderClient.didChangeProgress = didChangeProgress;
     loaderClient.didFinishProgress = didFinishProgress;
-
-#if WK_API_ENABLED
     loaderClient.didChangeBackForwardList = didChangeBackForwardList;
-#endif
 
     WKPageSetPageLoaderClient(pageRef, &loaderClient);
 }
 
-#if WK_API_ENABLED
 static WKPolicyDecisionHandler makePolicyDecisionBlock(WKFramePolicyListenerRef listener)
 {
     WKRetain(listener); // Released in the decision handler below.
@@ -709,7 +685,6 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
 
     WKPageSetPagePolicyClient(pageRef, &policyClient);
 }
-#endif
 
 #if PLATFORM(IOS)
 - (id <WKBrowsingContextLoadDelegateInternal>)loadDelegateInternal
@@ -734,16 +709,11 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
     _data = [[WKBrowsingContextControllerData alloc] init];
     _data->_pageRef = pageRef;
 
-#if WK_API_ENABLED
     _data->_pageLoadStateObserver = std::make_unique<PageLoadStateObserver>(self);
     toImpl(_data->_pageRef.get())->pageLoadState().addObserver(*_data->_pageLoadStateObserver);
-#endif
 
     setUpPageLoaderClient(self, pageRef);
-
-#if WK_API_ENABLED
     setUpPagePolicyClient(self, pageRef);
-#endif
 
     return self;
 }
@@ -760,3 +730,5 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
 }
  
 @end
+
+#endif // WK_API_ENABLED
index 16d07ff..33b64c1 100644 (file)
@@ -25,6 +25,8 @@
 
 #import "WKBrowsingContextControllerPrivate.h"
 
+#if WK_API_ENABLED
+
 #if PLATFORM(IOS)
 @protocol WKBrowsingContextLoadDelegateInternal <NSObject>
 @optional
@@ -47,3 +49,5 @@
 + (NSMutableSet *)customSchemes;
 
 @end
+
+#endif // WK_API_ENABLED
index ea82e0e..3f32051 100644 (file)
@@ -24,6 +24,9 @@
  */
 
 #import <WebKit2/WKBrowsingContextController.h>
+
+#if WK_API_ENABLED
+
 #import <WebKit2/WKBase.h>
 
 typedef NS_ENUM(NSUInteger, WKBrowsingContextPaginationMode) {
@@ -52,8 +55,8 @@ typedef NS_ENUM(NSUInteger, WKBrowsingContextPaginationMode) {
 
 @property (readonly) NSUInteger pageCount;
 
-#if WK_API_ENABLED
 @property (nonatomic, readonly) WKBrowsingContextHandle *handle;
-#endif
 
 @end
+
+#endif // WK_API_ENABLED
index 1d2153b..66ca0c8 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#import <WebKit2/WKFoundation.h>
+
+#if WK_API_ENABLED
+
 #import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 #import <WebKit2/WKUserScriptInjectionTime.h>
 
 @class WKBrowsingContextGroupData;
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKBrowsingContextGroup : NSObject {
 @private
     WKBrowsingContextGroupData *_data;
@@ -59,3 +62,5 @@ WK_EXPORT
 @property BOOL allowsPlugIns;
 
 @end
+
+#endif // WK_API_ENABLED
index 7e66312..93e686d 100644 (file)
  */
 
 #import "config.h"
-#import "WKBrowsingContextGroup.h"
 #import "WKBrowsingContextGroupPrivate.h"
 
+#if WK_API_ENABLED
+
 #import "APIArray.h"
 #import "WKArray.h"
 #import "WKPageGroup.h"
@@ -172,3 +173,5 @@ static WKRetainPtr<WKArrayRef> createWKArray(NSArray *array)
 }
 
 @end
+
+#endif // WK_API_ENABLED
index abede31..e74513e 100644 (file)
@@ -24,6 +24,9 @@
  */
 
 #import <WebKit2/WKBrowsingContextGroup.h>
+
+#if WK_API_ENABLED
+
 #import <WebKit2/WKBase.h>
 
 @interface WKBrowsingContextGroup (Private)
@@ -31,3 +34,5 @@
 @property(readonly) WKPageGroupRef _pageGroupRef;
 
 @end
+
+#endif // WK_API_ENABLED
index d7894a6..1e869ca 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #import <Foundation/Foundation.h>
+#import <WebKit2/WKDeclarationSpecifiers.h>
 
 @class WKBrowsingContextController;
 
index 8b1fa7f..e6fa3e1 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 #import <WebKit2/WKFoundation.h>
 
+#if WK_API_ENABLED
+
+#import <Foundation/Foundation.h>
+
 @class WKConnection;
 @class WKConnectionData;
 @class WKRemoteObjectRegistry;
@@ -38,7 +40,7 @@
 
 @end
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKConnection : NSObject {
 @private
     WKConnectionData *_data;
@@ -48,10 +50,8 @@ WK_EXPORT
 
 @property(assign) id <WKConnectionDelegate> delegate;
 
-#if WK_API_ENABLED
-
 @property (nonatomic, readonly) WKRemoteObjectRegistry *remoteObjectRegistry;
 
-#endif
-
 @end
+
+#endif // WK_API_ENABLED
index 1aba5d5..a1da0ff 100644 (file)
  */
 
 #import "config.h"
-#import "WKConnection.h"
 #import "WKConnectionInternal.h"
 
+#if WK_API_ENABLED
+
 #import "ObjCObjectGraph.h"
 #import "WKConnectionRef.h"
 #import "WKData.h"
@@ -46,9 +47,7 @@ using namespace WebKit;
     // Delegate for callbacks.
     id<WKConnectionDelegate> _delegate;
 
-#if WK_API_ENABLED
     RetainPtr<WKRemoteObjectRegistry> _remoteObjectRegistry;
-#endif
 }
 @end
 
@@ -83,7 +82,6 @@ using namespace WebKit;
     _data->_delegate = delegate;
 }
 
-#if WK_API_ENABLED
 - (WKRemoteObjectRegistry *)remoteObjectRegistry
 {
     if (!_data->_remoteObjectRegistry)
@@ -91,7 +89,6 @@ using namespace WebKit;
 
     return _data->_remoteObjectRegistry.get();
 }
-#endif
 
 @end
 
@@ -101,10 +98,8 @@ static void didReceiveMessage(WKConnectionRef, WKStringRef messageName, WKTypeRe
 {
     WKConnection *connection = (WKConnection *)clientInfo;
 
-#if WK_API_ENABLED
     if ([connection->_data->_remoteObjectRegistry _handleMessageWithName:messageName body:messageBody])
         return;
-#endif
 
     if ([connection.delegate respondsToSelector:@selector(connection:didReceiveMessageWithName:body:)]) {
         RetainPtr<CFStringRef> nsMessageName = adoptCF(WKStringCopyCFString(kCFAllocatorDefault, messageName));
@@ -150,3 +145,5 @@ static void setUpClient(WKConnection *connection, WKConnectionRef connectionRef)
 }
 
 @end
+
+#endif // WK_API_ENABLED
index f033d14..32fb1cb 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit2/WKConnection.h>
+#import "WKConnection.h"
+
+#if WK_API_ENABLED
+
 #import <WebKit2/WKBase.h>
 
 @interface WKConnection (Internal)
@@ -31,3 +34,5 @@
 - (id)_initWithConnectionRef:(WKConnectionRef)connectionRef;
 
 @end
+
+#endif // WK_API_ENABLED
index a18bd95..0792018 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#import <WebKit2/WKFoundation.h>
+
+#if WK_API_ENABLED
+
 #import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 
 @class WKProcessGroup, WKProcessGroupData, WKConnection;
 
@@ -39,7 +42,7 @@
 
 @end
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKProcessGroup : NSObject {
 @private
     WKProcessGroupData *_data;
@@ -53,3 +56,5 @@ WK_EXPORT
 @property(assign) id<WKProcessGroupDelegate> delegate;
 
 @end
+
+#endif // WK_API_ENABLED
index f5a6c87..bbd54c1 100644 (file)
  */
 
 #import "config.h"
-#import "WKProcessGroup.h"
 #import "WKProcessGroupPrivate.h"
 
+#if WK_API_ENABLED
+
 #import "APINavigationData.h"
 #import "ObjCObjectGraph.h"
 #import "WKAPICast.h"
@@ -114,8 +115,6 @@ static void setUpInectedBundleClient(WKProcessGroup *processGroup, WKContextRef
     WKContextSetInjectedBundleClient(contextRef, &injectedBundleClient);
 }
 
-#if WK_API_ENABLED
-
 static void didNavigateWithNavigationData(WKContextRef, WKPageRef pageRef, WKNavigationDataRef navigationDataRef, WKFrameRef frameRef, const void*)
 {
     if (!toImpl(frameRef)->isMainFrame())
@@ -171,8 +170,6 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
     WKContextSetHistoryClient(contextRef, &historyClient);
 }
 
-#endif // WK_API_ENABLED
-
 - (id)init
 {
     return [self initWithInjectedBundleURL:nil];
@@ -198,9 +195,7 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
 
     setUpConnectionClient(self, _data->_contextRef.get());
     setUpInectedBundleClient(self, _data->_contextRef.get());
-#if WK_API_ENABLED
     setUpHistoryClient(self, _data->_contextRef.get());
-#endif
 
     return self;
 }
@@ -244,3 +239,5 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
 #endif // PLATFORM(IOS)
 
 @end
+
+#endif // WK_API_ENABLED
index bbae48d..0ac4f05 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <TargetConditionals.h>
-
 #import <WebKit2/WKProcessGroup.h>
+
+#if WK_API_ENABLED
+
 #import <WebKit2/WKBase.h>
 
 #if TARGET_OS_IPHONE
@@ -40,3 +41,5 @@
 #endif
 
 @end
+
+#endif // WK_API_ENABLED
index 6b5fc3d..a579ac2 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Foundation/Foundation.h>
-#import <WebKit2/WKBase.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
-WK_EXPORT
+#import <Foundation/Foundation.h>
+#import <WebKit2/WKBase.h>
+
+WK_API_CLASS
 @interface WKTypeRefWrapper : NSObject
 
 - (id)initWithObject:(WKTypeRef)object;
index e9a3bac..222b12b 100644 (file)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <TargetConditionals.h>
+#import <WebKit2/WKFoundation.h>
 
 #if TARGET_OS_IPHONE
 #import <UIKit/UIKit.h>
@@ -49,6 +49,8 @@ WK_EXPORT
     unsigned _unused;
 }
 
+#if WK_API_ENABLED
+
 #if TARGET_OS_IPHONE
 - (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup;
 - (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup relatedToView:(WKView *)relatedView;
@@ -59,6 +61,8 @@ WK_EXPORT
 
 @property(readonly) WKBrowsingContextController *browsingContextController;
 
+#endif // WK_API_ENABLED
+
 @property BOOL drawsBackground;
 @property BOOL drawsTransparentBackground;
 
index 5779b1f..dc0297f 100644 (file)
@@ -265,6 +265,8 @@ struct WKViewInterpretKeyEventsParameters {
 
 @implementation WKView
 
+#if WK_API_ENABLED
+
 - (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup
 {
     return [self initWithFrame:frame contextRef:processGroup._contextRef pageGroupRef:browsingContextGroup._pageGroupRef relatedToPage:nil];
@@ -275,6 +277,8 @@ struct WKViewInterpretKeyEventsParameters {
     return [self initWithFrame:frame contextRef:processGroup._contextRef pageGroupRef:browsingContextGroup._pageGroupRef relatedToPage:relatedView ? toAPI(relatedView->_data->_page.get()) : nil];
 }
 
+#endif // WK_API_ENABLED
+
 - (void)dealloc
 {
     _data->_page->close();
@@ -292,6 +296,8 @@ struct WKViewInterpretKeyEventsParameters {
     [super dealloc];
 }
 
+#if WK_API_ENABLED
+
 - (WKBrowsingContextController *)browsingContextController
 {
     if (!_data->_browsingContextController)
@@ -299,6 +305,8 @@ struct WKViewInterpretKeyEventsParameters {
     return _data->_browsingContextController.get();
 }
 
+#endif // WK_API_ENABLED
+
 - (void)setDrawsBackground:(BOOL)drawsBackground
 {
     _data->_page->setDrawsBackground(drawsBackground);
index 059712d..00079a7 100644 (file)
@@ -23,8 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "PluginComplexTextInputState.h"
 #import "WKView.h"
+
+#import "PluginComplexTextInputState.h"
 #import "WebFindOptions.h"
 #import <wtf/Forward.h>
 #import <wtf/Vector.h>
index 08028fd..5f042dd 100644 (file)
@@ -659,4 +659,4 @@ static NSRect windowFrameFromApparentFrames(NSRect screenFrame, NSRect initialFr
 }
 @end
 
-#endif
+#endif // ENABLE(FULLSCREEN_API) && !PLATFORM(IOS)
index 32eb732..6d744d2 100644 (file)
@@ -310,7 +310,7 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
 #if ENABLE(NETWORK_PROCESS)
     if (!m_usesNetworkProcess) {
 #endif
-#if ENABLE(CUSTOM_PROTOCOLS)
+#if ENABLE(CUSTOM_PROTOCOLS) && WK_API_ENABLED
         for (NSString *scheme in [WKBrowsingContextController customSchemes])
             parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
 #endif
@@ -329,8 +329,10 @@ void WebContext::platformInitializeNetworkProcess(NetworkProcessCreationParamete
     parameters.parentProcessName = [[NSProcessInfo processInfo] processName];
     parameters.uiProcessBundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
 
+#if WK_API_ENABLED
     for (NSString *scheme in [WKBrowsingContextController customSchemes])
         parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
+#endif
 
     parameters.httpProxy = [[NSUserDefaults standardUserDefaults] stringForKey:WebKit2HTTPProxyDefaultsKey];
     parameters.httpsProxy = [[NSUserDefaults standardUserDefaults] stringForKey:WebKit2HTTPSProxyDefaultsKey];
index 257b88f..664b28c 100644 (file)
@@ -30,7 +30,6 @@
 #import "StringUtilities.h"
 #import "WebContextMenuItemData.h"
 #import "WKView.h"
-
 #import <WebCore/IntRect.h>
 #import <WebKitSystemInterface.h>
 
index 8962c38..e46c729 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit2/WKDOMNode.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
+#import <WebKit2/WKDOMNode.h>
+
 @class WKDOMElement;
 @class WKDOMText;
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKDOMDocument : WKDOMNode
 
 - (WKDOMElement *)createElement:(NSString *)tagName;
@@ -42,4 +43,3 @@ WK_EXPORT
 @end
 
 #endif // WK_API_ENABLED
-
index 67ea63b..33c4328 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit2/WKDOMNode.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
-WK_EXPORT
+#import <WebKit2/WKDOMNode.h>
+
+WK_API_CLASS
 @interface WKDOMElement : WKDOMNode
 
 - (BOOL)hasAttribute:(NSString *)attribute;
index b2bb7af..af7d6ed 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
+#import <Foundation/Foundation.h>
+
 @class WKDOMDocument;
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKDOMNode : NSObject
 
 - (void)insertNode:(WKDOMNode *)node before:(WKDOMNode *)refNode;
index 7e13d7e..f210abf 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
+#import <Foundation/Foundation.h>
+
 @class WKDOMNode, WKDOMDocument;
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKDOMRange : NSObject
 
 - (id)initWithDocument:(WKDOMDocument *)document;
index ee272b3..2a90366 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit2/WKDOMNode.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
-WK_EXPORT
+#import <WebKit2/WKDOMNode.h>
+
+WK_API_CLASS
 @interface WKDOMText : WKDOMNode
 
 @property(nonatomic, copy) NSString *data;
index a0182bf..0b16454 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
+#import <Foundation/Foundation.h>
+
 @class WKDOMRange;
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKDOMTextIterator : NSObject
 
 - (id)initWithRange:(WKDOMRange *)range;
index d89e9aa..b8967b2 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Foundation/Foundation.h>
-#import <WebKit2/WKBase.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
+#import <Foundation/Foundation.h>
+#import <WebKit2/WKBase.h>
+
 @class WKConnection;
 @class WKWebProcessPlugInController;
 @class WKWebProcessPlugInBrowserContextController;
@@ -43,7 +44,7 @@
 
 @end
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKWebProcessPlugInController : NSObject
 
 @property(readonly) WKConnection *connection;
index f6815a1..ce33549 100644 (file)
@@ -24,9 +24,6 @@
  */
 
 #import "config.h"
-
-#import "WKWebProcessPlugIn.h"
-#import "WKWebProcessPlugInPrivate.h"
 #import "WKWebProcessPlugInInternal.h"
 
 #if WK_API_ENABLED
index 226598f..fc69738 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Foundation/Foundation.h>
-#import <WebKit2/WKDeclarationSpecifiers.h>
 #import <WebKit2/WKFoundation.h>
 
 #if WK_API_ENABLED
 
+#import <Foundation/Foundation.h>
+
 @class WKDOMDocument;
 @class WKDOMRange;
 
-WK_EXPORT
+WK_API_CLASS
 @interface WKWebProcessPlugInBrowserContextController : NSObject
 
 @property(readonly) WKDOMDocument *mainFrameDocument;
index 01840b7..a62f889 100644 (file)
@@ -1,3 +1,20 @@
+2013-11-25  Dan Bernstein  <mitz@apple.com>
+
+        [Cocoa] Put most of the Cocoa API behind WK_API_ENABLED guards
+        https://bugs.webkit.org/show_bug.cgi?id=124850
+
+        Reviewed by Brady Eidson.
+
+        Added #if WK_API_ENABLED guards around tests that use the Objective-C API.
+
+        * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm:
+
 2013-11-25  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r159752 and r159754.
index 461cd75..c03b125 100644 (file)
@@ -37,6 +37,8 @@
 #import <WebKit2/WKViewPrivate.h>
 #import <wtf/RetainPtr.h>
 
+#if WK_API_ENABLED
+
 static bool testFinished = false;
 
 namespace TestWebKitAPI {
@@ -67,3 +69,5 @@ TEST(WebKit2CustomProtocolsTest, SyncXHR)
 }
 
 } // namespace TestWebKitAPI
+
+#endif // WK_API_ENABLED
index bf932cd..60bd827 100644 (file)
@@ -31,6 +31,8 @@
 #import <WebKit2/WebKit2.h>
 #import <wtf/RetainPtr.h>
 
+#if WK_API_ENABLED
+
 static bool testFinished = false;
 
 namespace TestWebKitAPI {
@@ -56,3 +58,5 @@ TEST(WebKit2CustomProtocolsTest, LoadInvalidScheme)
 }
 
 } // namespace TestWebKitAPI
+
+#endif // WK_API_ENABLED
index 3701cd4..a30d999 100644 (file)
@@ -32,6 +32,8 @@
 #import <WebKit2/WebKit2.h>
 #import <wtf/RetainPtr.h>
 
+#if WK_API_ENABLED
+
 static bool testFinished = false;
 
 namespace TestWebKitAPI {
@@ -53,3 +55,5 @@ TEST(WebKit2CustomProtocolsTest, MainResource)
 }
 
 } // namespace TestWebKitAPI
+
+#endif // WK_API_ENABLED
index 0e86aaa..eec3497 100644 (file)
@@ -33,6 +33,8 @@
 #import <WebKit2/WebKit2.h>
 #import <WebKit2/WKViewPrivate.h>
 
+#if WK_API_ENABLED
+
 static bool testFinished = false;
 
 namespace TestWebKitAPI {
@@ -55,3 +57,5 @@ TEST(WebKit2, PreventImageLoadWithAutoResizingTest)
 }
 
 } // namespace TestWebKitAPI
+
+#endif // WK_API_ENABLED
index 0258963..a6b3f87 100644 (file)
@@ -34,6 +34,7 @@
 #import <WebKit2/WKViewPrivate.h>
 #import <WebKit2/WebKit2.h>
 
+#if WK_API_ENABLED
 
 static bool testFinished = false;
 static NSString *htmlString = @"<body style='background-color: red'>";
@@ -228,3 +229,5 @@ TEST_F(WebKit2UserContentTest, RemoveAllUserScripts)
     
     TestWebKitAPI::Util::run(&testFinished);
 }
+
+#endif // WK_API_ENABLED
index fbd87bd..13b5098 100644 (file)
@@ -28,6 +28,8 @@
 
 #import <WebKit2/WKBrowsingContextGroup.h>
 
+#if WK_API_ENABLED
+
 TEST(WKBrowsingContextGroupTest, GetSetJavaScriptEnabled)
 {
     WKBrowsingContextGroup *browsingContextGroup = [[WKBrowsingContextGroup alloc] initWithIdentifier:@"TestIdentifier"];
@@ -53,3 +55,5 @@ TEST(WKBrowsingContextGroupTest, GetSetPluginsEnabled)
 
     [browsingContextGroup release];
 }
+
+#endif // WK_API_ENABLED
index 6cadf0b..193a0db 100644 (file)
@@ -35,6 +35,8 @@
 
 #import "PlatformUtilities.h"
 
+#if WK_API_ENABLED
+
 namespace {
 
 class WKBrowsingContextLoadDelegateTest : public ::testing::Test { 
@@ -227,3 +229,5 @@ TEST_F(WKBrowsingContextLoadDelegateTest, SimpleLoadFail)
     view.browsingContextController.loadDelegate = nil;
     [loadDelegate release];
 }
+
+#endif // WK_API_ENABLED