Title: [157676] trunk/Source/WebKit2
Revision
157676
Author
m...@apple.com
Date
2013-10-19 13:18:11 -0700 (Sat, 19 Oct 2013)

Log Message

[Cocoa] Remove some indirection that was only necessary for supporting the legacy Objective-C runtime
https://bugs.webkit.org/show_bug.cgi?id=123065

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKBrowsingContextController.h: Added WK_API_ENABLED guard. Removed _data
ivar and WKBrowsingContextControllerData class declaration.
* UIProcess/API/mac/WKBrowsingContextController.mm: Added WK_API_ENABLED guard. Removed
WKBrowsingContextControllerData class and moved _pageRef ivar directly into
WKBrowsingContextController, declaring it in the @implementation. Removed ivar and accessors
for the loadDelegate property, letting the compiler synthesize them.
(-[WKBrowsingContextController dealloc]): Removed indirection via _data.
(-[WKBrowsingContextController _pageRef]): Ditto.
(-[WKBrowsingContextController loadRequest:userData:]): Removed indirection via -_pageRef.
(-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Ditto.
(-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto.
(-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
Ditto.
(-[WKBrowsingContextController stopLoading]): Ditto.
(-[WKBrowsingContextController reload]): Ditto.
(-[WKBrowsingContextController reloadFromOrigin]): Ditto.
(-[WKBrowsingContextController goForward]): Ditto.
(-[WKBrowsingContextController canGoForward]): Ditto.
(-[WKBrowsingContextController goBack]): Ditto.
(-[WKBrowsingContextController canGoBack]): Ditto.
(-[WKBrowsingContextController activeURL]): Ditto.
(-[WKBrowsingContextController provisionalURL]): Ditto.
(-[WKBrowsingContextController committedURL]): Ditto.
(-[WKBrowsingContextController title]): Ditto.
(-[WKBrowsingContextController textZoom]): Ditto.
(-[WKBrowsingContextController setTextZoom:]): Ditto.
(-[WKBrowsingContextController pageZoom]): Ditto.
(-[WKBrowsingContextController setPageZoom:]): Ditto.
(-[WKBrowsingContextController setPaginationMode:]): Ditto.
(-[WKBrowsingContextController paginationMode]): Ditto.
(-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Ditto.
(-[WKBrowsingContextController paginationBehavesLikeColumns]): Ditto.
(-[WKBrowsingContextController setPageLength:]): Ditto.
(-[WKBrowsingContextController pageLength]): Ditto.
(-[WKBrowsingContextController setGapBetweenPages:]): Ditto.
(-[WKBrowsingContextController gapBetweenPages]): Ditto.
(-[WKBrowsingContextController pageCount]): Ditto.
(-[WKBrowsingContextController _initWithPageRef:]): Removed indirection via _data.
* UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Added WK_API_ENABLED guard.
* UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Ditto.

* UIProcess/API/mac/WKBrowsingContextGroup.h: Added WK_API_ENABLED guard. Removed _data ivar
and WKBrowsingContextGroupData class declaration.
* UIProcess/API/mac/WKBrowsingContextGroup.mm: Added WK_API_ENABLED guard. Removed
WKBrowsingContextGroupData class and moved _pageGroupRef ivar directly info
WKBrowsingContextGroup, declaring it in the @implementation.
(-[WKBrowsingContextGroup initWithIdentifier:]): Removed indirection via _data.
(-[WKBrowsingContextGroup _pageGroupRef]): Ditto.
* UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Added WK_API_ENABLED guard.

* UIProcess/API/mac/WKConnection.h: Added WK_API_ENABLED guard. Removed _data ivar and
WKConnectionData class declaration.
* UIProcess/API/mac/WKConnection.mm: Added WK_API_ENABLED guard. Removed WKConnectionData
class and moved _connectionRef ivar directly into WKConnection, declaring it in the
@implementation. Removed ivar and accessors for the delegate property, letting the compiler
synthesize them.
(-[WKConnection dealloc]): Removed indirection via _data.
(-[WKConnection sendMessageWithName:body:]): Ditto.
(-[WKConnection _initWithConnectionRef:]): Ditto.
* UIProcess/API/mac/WKConnectionInternal.h: Added WK_API_ENABLED guard.

* UIProcess/API/mac/WKProcessGroup.h: Added WK_API_ENABLED guard. Replaced forward
declaration of WKConnection with an import. Removed _data ivar and WKProcessGroupData class
declaration.
* UIProcess/API/mac/WKProcessGroup.mm: Added WK_API_ENABLED guard. Removed
WKProcessGroupData class and moved _contextRef ivar directly into WKProcessGroup, declaring
it in the @implementation. Removed ivar and accessors for the delegate property, letting the
compiler synthesize them.
(-[WKProcessGroup initWithInjectedBundleURL:]): Removed indirection via _data.
(-[WKProcessGroup dealloc]): Ditto.
(-[WKProcessGroup _contextRef]): Ditto.
* UIProcess/API/mac/WKProcessGroupPrivate.h: Added WK_API_ENABLED guard.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (157675 => 157676)


--- trunk/Source/WebKit2/ChangeLog	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/ChangeLog	2013-10-19 20:18:11 UTC (rev 157676)
@@ -1,3 +1,83 @@
+2013-10-19  Dan Bernstein  <m...@apple.com>
+
+        [Cocoa] Remove some indirection that was only necessary for supporting the legacy Objective-C runtime
+        https://bugs.webkit.org/show_bug.cgi?id=123065
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/mac/WKBrowsingContextController.h: Added WK_API_ENABLED guard. Removed _data
+        ivar and WKBrowsingContextControllerData class declaration.
+        * UIProcess/API/mac/WKBrowsingContextController.mm: Added WK_API_ENABLED guard. Removed
+        WKBrowsingContextControllerData class and moved _pageRef ivar directly into
+        WKBrowsingContextController, declaring it in the @implementation. Removed ivar and accessors
+        for the loadDelegate property, letting the compiler synthesize them.
+        (-[WKBrowsingContextController dealloc]): Removed indirection via _data.
+        (-[WKBrowsingContextController _pageRef]): Ditto.
+        (-[WKBrowsingContextController loadRequest:userData:]): Removed indirection via -_pageRef.
+        (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Ditto.
+        (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto.
+        (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
+        Ditto.
+        (-[WKBrowsingContextController stopLoading]): Ditto.
+        (-[WKBrowsingContextController reload]): Ditto.
+        (-[WKBrowsingContextController reloadFromOrigin]): Ditto.
+        (-[WKBrowsingContextController goForward]): Ditto.
+        (-[WKBrowsingContextController canGoForward]): Ditto.
+        (-[WKBrowsingContextController goBack]): Ditto.
+        (-[WKBrowsingContextController canGoBack]): Ditto.
+        (-[WKBrowsingContextController activeURL]): Ditto.
+        (-[WKBrowsingContextController provisionalURL]): Ditto.
+        (-[WKBrowsingContextController committedURL]): Ditto.
+        (-[WKBrowsingContextController title]): Ditto.
+        (-[WKBrowsingContextController textZoom]): Ditto.
+        (-[WKBrowsingContextController setTextZoom:]): Ditto.
+        (-[WKBrowsingContextController pageZoom]): Ditto.
+        (-[WKBrowsingContextController setPageZoom:]): Ditto.
+        (-[WKBrowsingContextController setPaginationMode:]): Ditto.
+        (-[WKBrowsingContextController paginationMode]): Ditto.
+        (-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Ditto.
+        (-[WKBrowsingContextController paginationBehavesLikeColumns]): Ditto.
+        (-[WKBrowsingContextController setPageLength:]): Ditto.
+        (-[WKBrowsingContextController pageLength]): Ditto.
+        (-[WKBrowsingContextController setGapBetweenPages:]): Ditto.
+        (-[WKBrowsingContextController gapBetweenPages]): Ditto.
+        (-[WKBrowsingContextController pageCount]): Ditto.
+        (-[WKBrowsingContextController _initWithPageRef:]): Removed indirection via _data.
+        * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Added WK_API_ENABLED guard.
+        * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Ditto.
+
+        * UIProcess/API/mac/WKBrowsingContextGroup.h: Added WK_API_ENABLED guard. Removed _data ivar
+        and WKBrowsingContextGroupData class declaration.
+        * UIProcess/API/mac/WKBrowsingContextGroup.mm: Added WK_API_ENABLED guard. Removed
+        WKBrowsingContextGroupData class and moved _pageGroupRef ivar directly info
+        WKBrowsingContextGroup, declaring it in the @implementation.
+        (-[WKBrowsingContextGroup initWithIdentifier:]): Removed indirection via _data.
+        (-[WKBrowsingContextGroup _pageGroupRef]): Ditto.
+        * UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Added WK_API_ENABLED guard.
+
+        * UIProcess/API/mac/WKConnection.h: Added WK_API_ENABLED guard. Removed _data ivar and
+        WKConnectionData class declaration.
+        * UIProcess/API/mac/WKConnection.mm: Added WK_API_ENABLED guard. Removed WKConnectionData
+        class and moved _connectionRef ivar directly into WKConnection, declaring it in the
+        @implementation. Removed ivar and accessors for the delegate property, letting the compiler
+        synthesize them.
+        (-[WKConnection dealloc]): Removed indirection via _data.
+        (-[WKConnection sendMessageWithName:body:]): Ditto.
+        (-[WKConnection _initWithConnectionRef:]): Ditto.
+        * UIProcess/API/mac/WKConnectionInternal.h: Added WK_API_ENABLED guard.
+
+        * UIProcess/API/mac/WKProcessGroup.h: Added WK_API_ENABLED guard. Replaced forward
+        declaration of WKConnection with an import. Removed _data ivar and WKProcessGroupData class
+        declaration.
+        * UIProcess/API/mac/WKProcessGroup.mm: Added WK_API_ENABLED guard. Removed
+        WKProcessGroupData class and moved _contextRef ivar directly into WKProcessGroup, declaring
+        it in the @implementation. Removed ivar and accessors for the delegate property, letting the
+        compiler synthesize them.
+        (-[WKProcessGroup initWithInjectedBundleURL:]): Removed indirection via _data.
+        (-[WKProcessGroup dealloc]): Ditto.
+        (-[WKProcessGroup _contextRef]): Ditto.
+        * UIProcess/API/mac/WKProcessGroupPrivate.h: Added WK_API_ENABLED guard.
+
 2013-10-19  Andreas Kling  <akl...@apple.com>
 
         Attempt to get Lion building.

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -25,15 +25,14 @@
 
 #import <Foundation/Foundation.h>
 #import <WebKit2/WKDeclarationSpecifiers.h>
+#import <WebKit2/WKFoundation.h>
 
-@class WKBrowsingContextControllerData;
+#if WK_API_ENABLED
+
 @protocol WKBrowsingContextLoadDelegate;
 
 WK_EXPORT
-@interface WKBrowsingContextController : NSObject {
-@private
-    WKBrowsingContextControllerData *_data;
-}
+@interface WKBrowsingContextController : NSObject
 
 #pragma mark Delegates
 
@@ -118,3 +117,5 @@
 @property CGFloat pageZoom;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm	2013-10-19 20:18:11 UTC (rev 157676)
@@ -28,6 +28,8 @@
 #import "WKBrowsingContextControllerPrivate.h"
 #import "WKBrowsingContextControllerInternal.h"
 
+#if WK_API_ENABLED
+
 #import "ObjCObjectGraph.h"
 #import "WKErrorCF.h"
 #import "WKFrame.h"
@@ -57,47 +59,23 @@
     return url ? CFBridgingRelease(WKURLCopyCFURL(kCFAllocatorDefault, adoptWK(url).get())) : nil;
 }
 
-@interface WKBrowsingContextControllerData : NSObject {
-@public
+@implementation WKBrowsingContextController {
     // Underlying WKPageRef.
     WKRetainPtr<WKPageRef> _pageRef;
-    
-    // Delegate for load callbacks.
-    id<WKBrowsingContextLoadDelegate> _loadDelegate;
 }
-@end
 
-@implementation WKBrowsingContextControllerData
-@end
-
-
-@implementation WKBrowsingContextController
-
 - (void)dealloc
 {
-    WKPageSetPageLoaderClient(_data->_pageRef.get(), 0);
+    WKPageSetPageLoaderClient(_pageRef.get(), 0);
 
-    [_data release];
     [super dealloc];
 }
 
 - (WKPageRef)_pageRef
 {
-    return _data->_pageRef.get();
+    return _pageRef.get();
 }
 
-#pragma mark Delegates
-
-- (id<WKBrowsingContextLoadDelegate>)loadDelegate
-{
-    return _data->_loadDelegate;
-}
-
-- (void)setLoadDelegate:(id<WKBrowsingContextLoadDelegate>)loadDelegate
-{
-    _data->_loadDelegate = loadDelegate;
-}
-
 #pragma mark Loading
 
 + (void)registerSchemeForCustomProtocol:(NSString *)scheme
@@ -133,7 +111,7 @@
     if (userData)
         wkUserData = ObjCObjectGraph::create(userData);
 
-    WKPageLoadURLRequestWithUserData(self._pageRef, wkRequest.get(), (WKTypeRef)wkUserData.get());
+    WKPageLoadURLRequestWithUserData(_pageRef.get(), wkRequest.get(), (WKTypeRef)wkUserData.get());
 }
 
 - (void)loadFileURL:(NSURL *)URL restrictToFilesWithin:(NSURL *)allowedDirectory
@@ -153,7 +131,7 @@
     if (userData)
         wkUserData = ObjCObjectGraph::create(userData);
 
-    WKPageLoadFileWithUserData(self._pageRef, wkURL.get(), wkAllowedDirectory.get(), (WKTypeRef)wkUserData.get());
+    WKPageLoadFileWithUserData(_pageRef.get(), wkURL.get(), wkAllowedDirectory.get(), (WKTypeRef)wkUserData.get());
 }
 
 - (void)loadHTMLString:(NSString *)HTMLString baseURL:(NSURL *)baseURL
@@ -175,7 +153,7 @@
     if (userData)
         wkUserData = ObjCObjectGraph::create(userData);
 
-    WKPageLoadHTMLStringWithUserData(self._pageRef, wkHTMLString.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
+    WKPageLoadHTMLStringWithUserData(_pageRef.get(), wkHTMLString.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
 }
 
 - (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL
@@ -212,44 +190,44 @@
     if (userData)
         wkUserData = ObjCObjectGraph::create(userData);
 
-    WKPageLoadDataWithUserData(self._pageRef, toAPI(wkData.get()), wkMIMEType.get(), wkEncodingName.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
+    WKPageLoadDataWithUserData(_pageRef.get(), toAPI(wkData.get()), wkMIMEType.get(), wkEncodingName.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
 }
 
 - (void)stopLoading
 {
-    WKPageStopLoading(self._pageRef);
+    WKPageStopLoading(_pageRef.get());
 }
 
 - (void)reload
 {
-    WKPageReload(self._pageRef);
+    WKPageReload(_pageRef.get());
 }
 
 - (void)reloadFromOrigin
 {
-    WKPageReloadFromOrigin(self._pageRef);
+    WKPageReloadFromOrigin(_pageRef.get());
 }
 
 #pragma mark Back/Forward
 
 - (void)goForward
 {
-    WKPageGoForward(self._pageRef);
+    WKPageGoForward(_pageRef.get());
 }
 
 - (BOOL)canGoForward
 {
-    return WKPageCanGoForward(self._pageRef);
+    return WKPageCanGoForward(_pageRef.get());
 }
 
 - (void)goBack
 {
-    WKPageGoBack(self._pageRef);
+    WKPageGoBack(_pageRef.get());
 }
 
 - (BOOL)canGoBack
 {
-    return WKPageCanGoBack(self._pageRef);
+    return WKPageCanGoBack(_pageRef.get());
 }
 
 
@@ -257,46 +235,46 @@
 
 - (NSURL *)activeURL
 {
-    return autoreleased(WKPageCopyActiveURL(self._pageRef));
+    return autoreleased(WKPageCopyActiveURL(_pageRef.get()));
 }
 
 - (NSURL *)provisionalURL
 {
-    return autoreleased(WKPageCopyProvisionalURL(self._pageRef));
+    return autoreleased(WKPageCopyProvisionalURL(_pageRef.get()));
 }
 
 - (NSURL *)committedURL
 {
-    return autoreleased(WKPageCopyCommittedURL(self._pageRef));
+    return autoreleased(WKPageCopyCommittedURL(_pageRef.get()));
 }
 
 #pragma mark Active Document Introspection
 
 - (NSString *)title
 {
-    return autoreleased(WKPageCopyTitle(self._pageRef));
+    return autoreleased(WKPageCopyTitle(_pageRef.get()));
 }
 
 #pragma mark Zoom
 
 - (CGFloat)textZoom
 {
-    return WKPageGetTextZoomFactor(self._pageRef);
+    return WKPageGetTextZoomFactor(_pageRef.get());
 }
 
 - (void)setTextZoom:(CGFloat)textZoom
 {
-    return WKPageSetTextZoomFactor(self._pageRef, textZoom);
+    return WKPageSetTextZoomFactor(_pageRef.get(), textZoom);
 }
 
 - (CGFloat)pageZoom
 {
-    return WKPageGetPageZoomFactor(self._pageRef);
+    return WKPageGetPageZoomFactor(_pageRef.get());
 }
 
 - (void)setPageZoom:(CGFloat)pageZoom
 {
-    return WKPageSetPageZoomFactor(self._pageRef, pageZoom);
+    return WKPageSetPageZoomFactor(_pageRef.get(), pageZoom);
 }
 
 @end
@@ -326,12 +304,12 @@
         return;
     }
 
-    WKPageSetPaginationMode(self._pageRef, mode);
+    WKPageSetPaginationMode(_pageRef.get(), mode);
 }
 
 - (WKBrowsingContextPaginationMode)paginationMode
 {
-    switch (WKPageGetPaginationMode(self._pageRef)) {
+    switch (WKPageGetPaginationMode(_pageRef.get())) {
     case kWKPaginationModeUnpaginated:
         return WKPaginationModeUnpaginated;
     case kWKPaginationModeLeftToRight:
@@ -350,37 +328,37 @@
 
 - (void)setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns
 {
-    WKPageSetPaginationBehavesLikeColumns(self._pageRef, behavesLikeColumns);
+    WKPageSetPaginationBehavesLikeColumns(_pageRef.get(), behavesLikeColumns);
 }
 
 - (BOOL)paginationBehavesLikeColumns
 {
-    return WKPageGetPaginationBehavesLikeColumns(self._pageRef);
+    return WKPageGetPaginationBehavesLikeColumns(_pageRef.get());
 }
 
 - (void)setPageLength:(CGFloat)pageLength
 {
-    WKPageSetPageLength(self._pageRef, pageLength);
+    WKPageSetPageLength(_pageRef.get(), pageLength);
 }
 
 - (CGFloat)pageLength
 {
-    return WKPageGetPageLength(self._pageRef);
+    return WKPageGetPageLength(_pageRef.get());
 }
 
 - (void)setGapBetweenPages:(CGFloat)gapBetweenPages
 {
-    WKPageSetGapBetweenPages(self._pageRef, gapBetweenPages);
+    WKPageSetGapBetweenPages(_pageRef.get(), gapBetweenPages);
 }
 
 - (CGFloat)gapBetweenPages
 {
-    return WKPageGetGapBetweenPages(self._pageRef);
+    return WKPageGetGapBetweenPages(_pageRef.get());
 }
 
 - (NSUInteger)pageCount
 {
-    return WKPageGetPageCount(self._pageRef);
+    return WKPageGetPageCount(_pageRef.get());
 }
 
 @end
@@ -477,8 +455,7 @@
     if (!self)
         return nil;
 
-    _data = [[WKBrowsingContextControllerData alloc] init];
-    _data->_pageRef = pageRef;
+    _pageRef = pageRef;
 
     setUpPageLoaderClient(self, pageRef);
 
@@ -497,3 +474,5 @@
 }
  
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -25,6 +25,8 @@
 
 #import <WebKit2/WKBrowsingContextController.h>
 
+#if WK_API_ENABLED
+
 @interface WKBrowsingContextController (Internal)
 
 /* This should only be called from associate view. */
@@ -36,3 +38,5 @@
 + (NSMutableSet *)customSchemes;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -26,6 +26,8 @@
 #import <WebKit2/WKBrowsingContextController.h>
 #import <WebKit2/WKBase.h>
 
+#if WK_API_ENABLED
+
 enum {
     WKPaginationModeUnpaginated,
     WKPaginationModeLeftToRight,
@@ -50,3 +52,5 @@
 @property(readonly) NSUInteger pageCount;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -25,15 +25,13 @@
 
 #import <Foundation/Foundation.h>
 #import <WebKit2/WKDeclarationSpecifiers.h>
+#import <WebKit2/WKFoundation.h>
 #import <WebKit2/WKUserScriptInjectionTime.h>
 
-@class WKBrowsingContextGroupData;
+#if WK_API_ENABLED
 
 WK_EXPORT
-@interface WKBrowsingContextGroup : NSObject {
-@private
-    WKBrowsingContextGroupData *_data;
-}
+@interface WKBrowsingContextGroup : NSObject
 
 - (id)initWithIdentifier:(NSString *)identifier;
 
@@ -59,3 +57,5 @@
 @property BOOL allowsPlugIns;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm	2013-10-19 20:18:11 UTC (rev 157676)
@@ -27,6 +27,8 @@
 #import "WKBrowsingContextGroup.h"
 #import "WKBrowsingContextGroupPrivate.h"
 
+#if WK_API_ENABLED
+
 #import "WKArray.h"
 #import "WKPageGroup.h"
 #import "WKPreferences.h"
@@ -36,41 +38,27 @@
 #import "WKURLCF.h"
 #import <wtf/Vector.h>
 
-@interface WKBrowsingContextGroupData : NSObject {
-@public
+@implementation WKBrowsingContextGroup {
     WKRetainPtr<WKPageGroupRef> _pageGroupRef;
 }
-@end
 
-@implementation WKBrowsingContextGroupData
-@end
-
-@implementation WKBrowsingContextGroup
-
 - (id)initWithIdentifier:(NSString *)identifier
 {
     self = [super init];
     if (!self)
         return nil;
 
-    _data = [[WKBrowsingContextGroupData alloc] init];
-    _data->_pageGroupRef = adoptWK(WKPageGroupCreateWithIdentifier(adoptWK(WKStringCreateWithCFString((CFStringRef)identifier)).get()));
+    _pageGroupRef = adoptWK(WKPageGroupCreateWithIdentifier(adoptWK(WKStringCreateWithCFString((CFStringRef)identifier)).get()));
 
     // Give the WKBrowsingContextGroup a identifier-less preferences, so that they
     // don't get automatically written to the disk. The automatic writing has proven
     // confusing to users of the API.
     WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
-    WKPageGroupSetPreferences(_data->_pageGroupRef.get(), preferences.get());
+    WKPageGroupSetPreferences(_pageGroupRef.get(), preferences.get());
 
     return self;
 }
 
-- (void)dealloc
-{
-    [_data release];
-    [super dealloc];
-}
-
 - (BOOL)allowsJavaScript
 {
     return WKPreferencesGetJavaScriptEnabled(WKPageGroupGetPreferences(self._pageGroupRef));
@@ -163,7 +151,9 @@
 
 - (WKPageGroupRef)_pageGroupRef
 {
-    return _data->_pageGroupRef.get();
+    return _pageGroupRef.get();
 }
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupPrivate.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupPrivate.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupPrivate.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -26,8 +26,12 @@
 #import <WebKit2/WKBrowsingContextGroup.h>
 #import <WebKit2/WKBase.h>
 
+#if WK_API_ENABLED
+
 @interface WKBrowsingContextGroup (Private)
 
 @property(readonly) WKPageGroupRef _pageGroupRef;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -25,9 +25,12 @@
 
 #import <Foundation/Foundation.h>
 #import <WebKit2/WKDeclarationSpecifiers.h>
+#import <WebKit2/WKFoundation.h>
 
-@class WKConnection, WKConnectionData;
+#if WK_API_ENABLED
 
+@class WKConnection;
+
 @protocol WKConnectionDelegate <NSObject>
 
 - (void)connection:(WKConnection *)connection didReceiveMessageWithName:(NSString *)messageName body:(id)messageBody;
@@ -36,10 +39,7 @@
 @end
 
 WK_EXPORT
-@interface WKConnection : NSObject {
-@private
-    WKConnectionData *_data;
-}
+@interface WKConnection : NSObject
 
 - (void)sendMessageWithName:(NSString *)messageName body:(id)messageBody;
 
@@ -48,3 +48,5 @@
 @property(assign) id<WKConnectionDelegate> delegate;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.mm (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.mm	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.mm	2013-10-19 20:18:11 UTC (rev 157676)
@@ -27,6 +27,8 @@
 #import "WKConnection.h"
 #import "WKConnectionInternal.h"
 
+#if WK_API_ENABLED
+
 #import "ObjCObjectGraph.h"
 #import "WKConnectionRef.h"
 #import "WKData.h"
@@ -37,26 +39,15 @@
 
 using namespace WebKit;
 
-@interface WKConnectionData : NSObject {
-@public
+@implementation WKConnection {
     // Underlying connection object.
     WKRetainPtr<WKConnectionRef> _connectionRef;
-
-    // Delegate for callbacks.
-    id<WKConnectionDelegate> _delegate;
 }
-@end
 
-@implementation WKConnectionData
-@end
-
-@implementation WKConnection
-
 - (void)dealloc
 {
-    WKConnectionSetConnectionClient(_data->_connectionRef.get(), 0);
+    WKConnectionSetConnectionClient(_connectionRef.get(), 0);
 
-    [_data release];
     [super dealloc];
 }
 
@@ -65,21 +56,9 @@
     WKRetainPtr<WKStringRef> wkMessageName = adoptWK(WKStringCreateWithCFString((CFStringRef)messageName));
     RefPtr<ObjCObjectGraph> wkMessageBody = ObjCObjectGraph::create(messageBody);
 
-    WKConnectionPostMessage(_data->_connectionRef.get(), wkMessageName.get(), (WKTypeRef)wkMessageBody.get());
+    WKConnectionPostMessage(_connectionRef.get(), wkMessageName.get(), (WKTypeRef)wkMessageBody.get());
 }
 
-#pragma mark Delegates
-
-- (id<WKConnectionDelegate>)delegate
-{
-    return _data->_delegate;
-}
-
-- (void)setDelegate:(id<WKConnectionDelegate>)delegate
-{
-    _data->_delegate = delegate;
-}
-
 @end
 
 @implementation WKConnection (Internal)
@@ -122,12 +101,13 @@
     if (!self)
         return nil;
 
-    _data = [[WKConnectionData alloc] init];
-    _data->_connectionRef = connectionRef;
+    _connectionRef = connectionRef;
 
-    setUpClient(self, _data->_connectionRef.get());
+    setUpClient(self, _connectionRef.get());
 
     return self;
 }
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -26,8 +26,12 @@
 #import <WebKit2/WKConnection.h>
 #import <WebKit2/WKBase.h>
 
+#if WK_API_ENABLED
+
 @interface WKConnection (Internal)
 
 - (id)_initWithConnectionRef:(WKConnectionRef)connectionRef;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -24,10 +24,14 @@
  */
 
 #import <Foundation/Foundation.h>
+#import <WebKit2/WKConnection.h>
 #import <WebKit2/WKDeclarationSpecifiers.h>
+#import <WebKit2/WKFoundation.h>
 
-@class WKProcessGroup, WKProcessGroupData, WKConnection;
+#if WK_API_ENABLED
 
+@class WKProcessGroup;
+
 @protocol WKProcessGroupDelegate <NSObject>
 @optional
 
@@ -40,16 +44,14 @@
 @end
 
 WK_EXPORT
-@interface WKProcessGroup : NSObject {
-@private
-    WKProcessGroupData *_data;
-}
+@interface WKProcessGroup : NSObject
 
 - (id)initWithInjectedBundleURL:(NSURL *)bundleURL;
 
-
 #pragma mark Delegates
 
 @property(assign) id<WKProcessGroupDelegate> delegate;
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm	2013-10-19 20:18:11 UTC (rev 157676)
@@ -27,6 +27,8 @@
 #import "WKProcessGroup.h"
 #import "WKProcessGroupPrivate.h"
 
+#if WK_API_ENABLED
+
 #import "ObjCObjectGraph.h"
 #import "WKConnectionInternal.h"
 #import "WKContext.h"
@@ -34,21 +36,11 @@
 #import "WKStringCF.h"
 #import <wtf/RetainPtr.h>
 
-@interface WKProcessGroupData : NSObject {
-@public
+@implementation WKProcessGroup {
     // Underlying context object.
     WKRetainPtr<WKContextRef> _contextRef;
-
-    // Delegate for callbacks.
-    id<WKProcessGroupDelegate> _delegate;
 }
-@end
 
-@implementation WKProcessGroupData
-@end
-
-@implementation WKProcessGroup
-
 static void didCreateConnection(WKContextRef, WKConnectionRef connectionRef, const void* clientInfo)
 {
     WKProcessGroup *processGroup = (WKProcessGroup *)clientInfo;
@@ -105,45 +97,34 @@
     if (!self)
         return nil;
 
-    _data = [[WKProcessGroupData alloc] init];
-    
     if (bundleURL)
-        _data->_contextRef = adoptWK(WKContextCreateWithInjectedBundlePath(adoptWK(WKStringCreateWithCFString((CFStringRef)[bundleURL path])).get()));
+        _contextRef = adoptWK(WKContextCreateWithInjectedBundlePath(adoptWK(WKStringCreateWithCFString((CFStringRef)[bundleURL path])).get()));
     else
-        _data->_contextRef = adoptWK(WKContextCreate());
+        _contextRef = adoptWK(WKContextCreate());
 
-    setUpConnectionClient(self, _data->_contextRef.get());
-    setUpInectedBundleClient(self, _data->_contextRef.get());
+    setUpConnectionClient(self, _contextRef.get());
+    setUpInectedBundleClient(self, _contextRef.get());
 
     return self;
 }
 
 - (void)dealloc
 {
-    WKContextSetConnectionClient(_data->_contextRef.get(), 0);
-    WKContextSetInjectedBundleClient(_data->_contextRef.get(), 0);
+    WKContextSetConnectionClient(_contextRef.get(), 0);
+    WKContextSetInjectedBundleClient(_contextRef.get(), 0);
 
-    [_data release];
     [super dealloc];
 }
 
-- (id<WKProcessGroupDelegate>)delegate
-{
-    return _data->_delegate;
-}
-
-- (void)setDelegate:(id<WKProcessGroupDelegate>)delegate
-{
-    _data->_delegate = delegate;
-}
-
 @end
 
 @implementation WKProcessGroup (Private)
 
 - (WKContextRef)_contextRef
 {
-    return _data->_contextRef.get();
+    return _contextRef.get();
 }
 
 @end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroupPrivate.h (157675 => 157676)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroupPrivate.h	2013-10-19 20:11:36 UTC (rev 157675)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroupPrivate.h	2013-10-19 20:18:11 UTC (rev 157676)
@@ -26,8 +26,12 @@
 #import <WebKit2/WKProcessGroup.h>
 #import <WebKit2/WKBase.h>
 
+#if WK_API_ENABLED
+
 @interface WKProcessGroup (Private)
 
 @property(readonly) WKContextRef _contextRef;
 
 @end
+
+#endif // WK_API_ENABLED
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to