Changeset 157676 in webkit


Ignore:
Timestamp:
Oct 19, 2013, 1:18:11 PM (12 years ago)
Author:
mitz@apple.com
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.
Location:
trunk/Source/WebKit2
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebKit2/ChangeLog

    r157666 r157676  
     12013-10-19  Dan Bernstein  <mitz@apple.com>
     2
     3        [Cocoa] Remove some indirection that was only necessary for supporting the legacy Objective-C runtime
     4        https://bugs.webkit.org/show_bug.cgi?id=123065
     5
     6        Reviewed by Sam Weinig.
     7
     8        * UIProcess/API/mac/WKBrowsingContextController.h: Added WK_API_ENABLED guard. Removed _data
     9        ivar and WKBrowsingContextControllerData class declaration.
     10        * UIProcess/API/mac/WKBrowsingContextController.mm: Added WK_API_ENABLED guard. Removed
     11        WKBrowsingContextControllerData class and moved _pageRef ivar directly into
     12        WKBrowsingContextController, declaring it in the @implementation. Removed ivar and accessors
     13        for the loadDelegate property, letting the compiler synthesize them.
     14        (-[WKBrowsingContextController dealloc]): Removed indirection via _data.
     15        (-[WKBrowsingContextController _pageRef]): Ditto.
     16        (-[WKBrowsingContextController loadRequest:userData:]): Removed indirection via -_pageRef.
     17        (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Ditto.
     18        (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto.
     19        (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
     20        Ditto.
     21        (-[WKBrowsingContextController stopLoading]): Ditto.
     22        (-[WKBrowsingContextController reload]): Ditto.
     23        (-[WKBrowsingContextController reloadFromOrigin]): Ditto.
     24        (-[WKBrowsingContextController goForward]): Ditto.
     25        (-[WKBrowsingContextController canGoForward]): Ditto.
     26        (-[WKBrowsingContextController goBack]): Ditto.
     27        (-[WKBrowsingContextController canGoBack]): Ditto.
     28        (-[WKBrowsingContextController activeURL]): Ditto.
     29        (-[WKBrowsingContextController provisionalURL]): Ditto.
     30        (-[WKBrowsingContextController committedURL]): Ditto.
     31        (-[WKBrowsingContextController title]): Ditto.
     32        (-[WKBrowsingContextController textZoom]): Ditto.
     33        (-[WKBrowsingContextController setTextZoom:]): Ditto.
     34        (-[WKBrowsingContextController pageZoom]): Ditto.
     35        (-[WKBrowsingContextController setPageZoom:]): Ditto.
     36        (-[WKBrowsingContextController setPaginationMode:]): Ditto.
     37        (-[WKBrowsingContextController paginationMode]): Ditto.
     38        (-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Ditto.
     39        (-[WKBrowsingContextController paginationBehavesLikeColumns]): Ditto.
     40        (-[WKBrowsingContextController setPageLength:]): Ditto.
     41        (-[WKBrowsingContextController pageLength]): Ditto.
     42        (-[WKBrowsingContextController setGapBetweenPages:]): Ditto.
     43        (-[WKBrowsingContextController gapBetweenPages]): Ditto.
     44        (-[WKBrowsingContextController pageCount]): Ditto.
     45        (-[WKBrowsingContextController _initWithPageRef:]): Removed indirection via _data.
     46        * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Added WK_API_ENABLED guard.
     47        * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Ditto.
     48
     49        * UIProcess/API/mac/WKBrowsingContextGroup.h: Added WK_API_ENABLED guard. Removed _data ivar
     50        and WKBrowsingContextGroupData class declaration.
     51        * UIProcess/API/mac/WKBrowsingContextGroup.mm: Added WK_API_ENABLED guard. Removed
     52        WKBrowsingContextGroupData class and moved _pageGroupRef ivar directly info
     53        WKBrowsingContextGroup, declaring it in the @implementation.
     54        (-[WKBrowsingContextGroup initWithIdentifier:]): Removed indirection via _data.
     55        (-[WKBrowsingContextGroup _pageGroupRef]): Ditto.
     56        * UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Added WK_API_ENABLED guard.
     57
     58        * UIProcess/API/mac/WKConnection.h: Added WK_API_ENABLED guard. Removed _data ivar and
     59        WKConnectionData class declaration.
     60        * UIProcess/API/mac/WKConnection.mm: Added WK_API_ENABLED guard. Removed WKConnectionData
     61        class and moved _connectionRef ivar directly into WKConnection, declaring it in the
     62        @implementation. Removed ivar and accessors for the delegate property, letting the compiler
     63        synthesize them.
     64        (-[WKConnection dealloc]): Removed indirection via _data.
     65        (-[WKConnection sendMessageWithName:body:]): Ditto.
     66        (-[WKConnection _initWithConnectionRef:]): Ditto.
     67        * UIProcess/API/mac/WKConnectionInternal.h: Added WK_API_ENABLED guard.
     68
     69        * UIProcess/API/mac/WKProcessGroup.h: Added WK_API_ENABLED guard. Replaced forward
     70        declaration of WKConnection with an import. Removed _data ivar and WKProcessGroupData class
     71        declaration.
     72        * UIProcess/API/mac/WKProcessGroup.mm: Added WK_API_ENABLED guard. Removed
     73        WKProcessGroupData class and moved _contextRef ivar directly into WKProcessGroup, declaring
     74        it in the @implementation. Removed ivar and accessors for the delegate property, letting the
     75        compiler synthesize them.
     76        (-[WKProcessGroup initWithInjectedBundleURL:]): Removed indirection via _data.
     77        (-[WKProcessGroup dealloc]): Ditto.
     78        (-[WKProcessGroup _contextRef]): Ditto.
     79        * UIProcess/API/mac/WKProcessGroupPrivate.h: Added WK_API_ENABLED guard.
     80
    1812013-10-19  Andreas Kling  <akling@apple.com>
    282
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h

    r155770 r157676  
    2626#import <Foundation/Foundation.h>
    2727#import <WebKit2/WKDeclarationSpecifiers.h>
     28#import <WebKit2/WKFoundation.h>
    2829
    29 @class WKBrowsingContextControllerData;
     30#if WK_API_ENABLED
     31
    3032@protocol WKBrowsingContextLoadDelegate;
    3133
    3234WK_EXPORT
    33 @interface WKBrowsingContextController : NSObject {
    34 @private
    35     WKBrowsingContextControllerData *_data;
    36 }
     35@interface WKBrowsingContextController : NSObject
    3736
    3837#pragma mark Delegates
     
    119118
    120119@end
     120
     121#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm

    r157648 r157676  
    2929#import "WKBrowsingContextControllerInternal.h"
    3030
     31#if WK_API_ENABLED
     32
    3133#import "ObjCObjectGraph.h"
    3234#import "WKErrorCF.h"
     
    5860}
    5961
    60 @interface WKBrowsingContextControllerData : NSObject {
    61 @public
     62@implementation WKBrowsingContextController {
    6263    // Underlying WKPageRef.
    6364    WKRetainPtr<WKPageRef> _pageRef;
    64    
    65     // Delegate for load callbacks.
    66     id<WKBrowsingContextLoadDelegate> _loadDelegate;
    67 }
    68 @end
    69 
    70 @implementation WKBrowsingContextControllerData
    71 @end
    72 
    73 
    74 @implementation WKBrowsingContextController
     65}
    7566
    7667- (void)dealloc
    7768{
    78     WKPageSetPageLoaderClient(_data->_pageRef.get(), 0);
    79 
    80     [_data release];
     69    WKPageSetPageLoaderClient(_pageRef.get(), 0);
     70
    8171    [super dealloc];
    8272}
     
    8474- (WKPageRef)_pageRef
    8575{
    86     return _data->_pageRef.get();
    87 }
    88 
    89 #pragma mark Delegates
    90 
    91 - (id<WKBrowsingContextLoadDelegate>)loadDelegate
    92 {
    93     return _data->_loadDelegate;
    94 }
    95 
    96 - (void)setLoadDelegate:(id<WKBrowsingContextLoadDelegate>)loadDelegate
    97 {
    98     _data->_loadDelegate = loadDelegate;
     76    return _pageRef.get();
    9977}
    10078
     
    134112        wkUserData = ObjCObjectGraph::create(userData);
    135113
    136     WKPageLoadURLRequestWithUserData(self._pageRef, wkRequest.get(), (WKTypeRef)wkUserData.get());
     114    WKPageLoadURLRequestWithUserData(_pageRef.get(), wkRequest.get(), (WKTypeRef)wkUserData.get());
    137115}
    138116
     
    154132        wkUserData = ObjCObjectGraph::create(userData);
    155133
    156     WKPageLoadFileWithUserData(self._pageRef, wkURL.get(), wkAllowedDirectory.get(), (WKTypeRef)wkUserData.get());
     134    WKPageLoadFileWithUserData(_pageRef.get(), wkURL.get(), wkAllowedDirectory.get(), (WKTypeRef)wkUserData.get());
    157135}
    158136
     
    176154        wkUserData = ObjCObjectGraph::create(userData);
    177155
    178     WKPageLoadHTMLStringWithUserData(self._pageRef, wkHTMLString.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
     156    WKPageLoadHTMLStringWithUserData(_pageRef.get(), wkHTMLString.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
    179157}
    180158
     
    213191        wkUserData = ObjCObjectGraph::create(userData);
    214192
    215     WKPageLoadDataWithUserData(self._pageRef, toAPI(wkData.get()), wkMIMEType.get(), wkEncodingName.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
     193    WKPageLoadDataWithUserData(_pageRef.get(), toAPI(wkData.get()), wkMIMEType.get(), wkEncodingName.get(), wkBaseURL.get(), (WKTypeRef)wkUserData.get());
    216194}
    217195
    218196- (void)stopLoading
    219197{
    220     WKPageStopLoading(self._pageRef);
     198    WKPageStopLoading(_pageRef.get());
    221199}
    222200
    223201- (void)reload
    224202{
    225     WKPageReload(self._pageRef);
     203    WKPageReload(_pageRef.get());
    226204}
    227205
    228206- (void)reloadFromOrigin
    229207{
    230     WKPageReloadFromOrigin(self._pageRef);
     208    WKPageReloadFromOrigin(_pageRef.get());
    231209}
    232210
     
    235213- (void)goForward
    236214{
    237     WKPageGoForward(self._pageRef);
     215    WKPageGoForward(_pageRef.get());
    238216}
    239217
    240218- (BOOL)canGoForward
    241219{
    242     return WKPageCanGoForward(self._pageRef);
     220    return WKPageCanGoForward(_pageRef.get());
    243221}
    244222
    245223- (void)goBack
    246224{
    247     WKPageGoBack(self._pageRef);
     225    WKPageGoBack(_pageRef.get());
    248226}
    249227
    250228- (BOOL)canGoBack
    251229{
    252     return WKPageCanGoBack(self._pageRef);
     230    return WKPageCanGoBack(_pageRef.get());
    253231}
    254232
     
    258236- (NSURL *)activeURL
    259237{
    260     return autoreleased(WKPageCopyActiveURL(self._pageRef));
     238    return autoreleased(WKPageCopyActiveURL(_pageRef.get()));
    261239}
    262240
    263241- (NSURL *)provisionalURL
    264242{
    265     return autoreleased(WKPageCopyProvisionalURL(self._pageRef));
     243    return autoreleased(WKPageCopyProvisionalURL(_pageRef.get()));
    266244}
    267245
    268246- (NSURL *)committedURL
    269247{
    270     return autoreleased(WKPageCopyCommittedURL(self._pageRef));
     248    return autoreleased(WKPageCopyCommittedURL(_pageRef.get()));
    271249}
    272250
     
    275253- (NSString *)title
    276254{
    277     return autoreleased(WKPageCopyTitle(self._pageRef));
     255    return autoreleased(WKPageCopyTitle(_pageRef.get()));
    278256}
    279257
     
    282260- (CGFloat)textZoom
    283261{
    284     return WKPageGetTextZoomFactor(self._pageRef);
     262    return WKPageGetTextZoomFactor(_pageRef.get());
    285263}
    286264
    287265- (void)setTextZoom:(CGFloat)textZoom
    288266{
    289     return WKPageSetTextZoomFactor(self._pageRef, textZoom);
     267    return WKPageSetTextZoomFactor(_pageRef.get(), textZoom);
    290268}
    291269
    292270- (CGFloat)pageZoom
    293271{
    294     return WKPageGetPageZoomFactor(self._pageRef);
     272    return WKPageGetPageZoomFactor(_pageRef.get());
    295273}
    296274
    297275- (void)setPageZoom:(CGFloat)pageZoom
    298276{
    299     return WKPageSetPageZoomFactor(self._pageRef, pageZoom);
     277    return WKPageSetPageZoomFactor(_pageRef.get(), pageZoom);
    300278}
    301279
     
    327305    }
    328306
    329     WKPageSetPaginationMode(self._pageRef, mode);
     307    WKPageSetPaginationMode(_pageRef.get(), mode);
    330308}
    331309
    332310- (WKBrowsingContextPaginationMode)paginationMode
    333311{
    334     switch (WKPageGetPaginationMode(self._pageRef)) {
     312    switch (WKPageGetPaginationMode(_pageRef.get())) {
    335313    case kWKPaginationModeUnpaginated:
    336314        return WKPaginationModeUnpaginated;
     
    351329- (void)setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns
    352330{
    353     WKPageSetPaginationBehavesLikeColumns(self._pageRef, behavesLikeColumns);
     331    WKPageSetPaginationBehavesLikeColumns(_pageRef.get(), behavesLikeColumns);
    354332}
    355333
    356334- (BOOL)paginationBehavesLikeColumns
    357335{
    358     return WKPageGetPaginationBehavesLikeColumns(self._pageRef);
     336    return WKPageGetPaginationBehavesLikeColumns(_pageRef.get());
    359337}
    360338
    361339- (void)setPageLength:(CGFloat)pageLength
    362340{
    363     WKPageSetPageLength(self._pageRef, pageLength);
     341    WKPageSetPageLength(_pageRef.get(), pageLength);
    364342}
    365343
    366344- (CGFloat)pageLength
    367345{
    368     return WKPageGetPageLength(self._pageRef);
     346    return WKPageGetPageLength(_pageRef.get());
    369347}
    370348
    371349- (void)setGapBetweenPages:(CGFloat)gapBetweenPages
    372350{
    373     WKPageSetGapBetweenPages(self._pageRef, gapBetweenPages);
     351    WKPageSetGapBetweenPages(_pageRef.get(), gapBetweenPages);
    374352}
    375353
    376354- (CGFloat)gapBetweenPages
    377355{
    378     return WKPageGetGapBetweenPages(self._pageRef);
     356    return WKPageGetGapBetweenPages(_pageRef.get());
    379357}
    380358
    381359- (NSUInteger)pageCount
    382360{
    383     return WKPageGetPageCount(self._pageRef);
     361    return WKPageGetPageCount(_pageRef.get());
    384362}
    385363
     
    478456        return nil;
    479457
    480     _data = [[WKBrowsingContextControllerData alloc] init];
    481     _data->_pageRef = pageRef;
     458    _pageRef = pageRef;
    482459
    483460    setUpPageLoaderClient(self, pageRef);
     
    498475 
    499476@end
     477
     478#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h

    r144777 r157676  
    2626#import <WebKit2/WKBrowsingContextController.h>
    2727
     28#if WK_API_ENABLED
     29
    2830@interface WKBrowsingContextController (Internal)
    2931
     
    3739
    3840@end
     41
     42#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h

    r155770 r157676  
    2727#import <WebKit2/WKBase.h>
    2828
     29#if WK_API_ENABLED
     30
    2931enum {
    3032    WKPaginationModeUnpaginated,
     
    5153
    5254@end
     55
     56#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h

    r155770 r157676  
    2626#import <Foundation/Foundation.h>
    2727#import <WebKit2/WKDeclarationSpecifiers.h>
     28#import <WebKit2/WKFoundation.h>
    2829#import <WebKit2/WKUserScriptInjectionTime.h>
    2930
    30 @class WKBrowsingContextGroupData;
     31#if WK_API_ENABLED
    3132
    3233WK_EXPORT
    33 @interface WKBrowsingContextGroup : NSObject {
    34 @private
    35     WKBrowsingContextGroupData *_data;
    36 }
     34@interface WKBrowsingContextGroup : NSObject
    3735
    3836- (id)initWithIdentifier:(NSString *)identifier;
     
    6058
    6159@end
     60
     61#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm

    r148689 r157676  
    2828#import "WKBrowsingContextGroupPrivate.h"
    2929
     30#if WK_API_ENABLED
     31
    3032#import "WKArray.h"
    3133#import "WKPageGroup.h"
     
    3739#import <wtf/Vector.h>
    3840
    39 @interface WKBrowsingContextGroupData : NSObject {
    40 @public
     41@implementation WKBrowsingContextGroup {
    4142    WKRetainPtr<WKPageGroupRef> _pageGroupRef;
    4243}
    43 @end
    44 
    45 @implementation WKBrowsingContextGroupData
    46 @end
    47 
    48 @implementation WKBrowsingContextGroup
    4944
    5045- (id)initWithIdentifier:(NSString *)identifier
     
    5449        return nil;
    5550
    56     _data = [[WKBrowsingContextGroupData alloc] init];
    57     _data->_pageGroupRef = adoptWK(WKPageGroupCreateWithIdentifier(adoptWK(WKStringCreateWithCFString((CFStringRef)identifier)).get()));
     51    _pageGroupRef = adoptWK(WKPageGroupCreateWithIdentifier(adoptWK(WKStringCreateWithCFString((CFStringRef)identifier)).get()));
    5852
    5953    // Give the WKBrowsingContextGroup a identifier-less preferences, so that they
     
    6155    // confusing to users of the API.
    6256    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    63     WKPageGroupSetPreferences(_data->_pageGroupRef.get(), preferences.get());
     57    WKPageGroupSetPreferences(_pageGroupRef.get(), preferences.get());
    6458
    6559    return self;
    66 }
    67 
    68 - (void)dealloc
    69 {
    70     [_data release];
    71     [super dealloc];
    7260}
    7361
     
    164152- (WKPageGroupRef)_pageGroupRef
    165153{
    166     return _data->_pageGroupRef.get();
     154    return _pageGroupRef.get();
    167155}
    168156
    169157@end
     158
     159#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupPrivate.h

    r155770 r157676  
    2727#import <WebKit2/WKBase.h>
    2828
     29#if WK_API_ENABLED
     30
    2931@interface WKBrowsingContextGroup (Private)
    3032
     
    3234
    3335@end
     36
     37#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.h

    r155770 r157676  
    2626#import <Foundation/Foundation.h>
    2727#import <WebKit2/WKDeclarationSpecifiers.h>
     28#import <WebKit2/WKFoundation.h>
    2829
    29 @class WKConnection, WKConnectionData;
     30#if WK_API_ENABLED
     31
     32@class WKConnection;
    3033
    3134@protocol WKConnectionDelegate <NSObject>
     
    3740
    3841WK_EXPORT
    39 @interface WKConnection : NSObject {
    40 @private
    41     WKConnectionData *_data;
    42 }
     42@interface WKConnection : NSObject
    4343
    4444- (void)sendMessageWithName:(NSString *)messageName body:(id)messageBody;
     
    4949
    5050@end
     51
     52#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.mm

    r149255 r157676  
    2828#import "WKConnectionInternal.h"
    2929
     30#if WK_API_ENABLED
     31
    3032#import "ObjCObjectGraph.h"
    3133#import "WKConnectionRef.h"
     
    3840using namespace WebKit;
    3941
    40 @interface WKConnectionData : NSObject {
    41 @public
     42@implementation WKConnection {
    4243    // Underlying connection object.
    4344    WKRetainPtr<WKConnectionRef> _connectionRef;
    44 
    45     // Delegate for callbacks.
    46     id<WKConnectionDelegate> _delegate;
    4745}
    48 @end
    49 
    50 @implementation WKConnectionData
    51 @end
    52 
    53 @implementation WKConnection
    5446
    5547- (void)dealloc
    5648{
    57     WKConnectionSetConnectionClient(_data->_connectionRef.get(), 0);
     49    WKConnectionSetConnectionClient(_connectionRef.get(), 0);
    5850
    59     [_data release];
    6051    [super dealloc];
    6152}
     
    6657    RefPtr<ObjCObjectGraph> wkMessageBody = ObjCObjectGraph::create(messageBody);
    6758
    68     WKConnectionPostMessage(_data->_connectionRef.get(), wkMessageName.get(), (WKTypeRef)wkMessageBody.get());
    69 }
    70 
    71 #pragma mark Delegates
    72 
    73 - (id<WKConnectionDelegate>)delegate
    74 {
    75     return _data->_delegate;
    76 }
    77 
    78 - (void)setDelegate:(id<WKConnectionDelegate>)delegate
    79 {
    80     _data->_delegate = delegate;
     59    WKConnectionPostMessage(_connectionRef.get(), wkMessageName.get(), (WKTypeRef)wkMessageBody.get());
    8160}
    8261
     
    123102        return nil;
    124103
    125     _data = [[WKConnectionData alloc] init];
    126     _data->_connectionRef = connectionRef;
     104    _connectionRef = connectionRef;
    127105
    128     setUpClient(self, _data->_connectionRef.get());
     106    setUpClient(self, _connectionRef.get());
    129107
    130108    return self;
     
    132110
    133111@end
     112
     113#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h

    r155770 r157676  
    2727#import <WebKit2/WKBase.h>
    2828
     29#if WK_API_ENABLED
     30
    2931@interface WKConnection (Internal)
    3032
     
    3234
    3335@end
     36
     37#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.h

    r155770 r157676  
    2525
    2626#import <Foundation/Foundation.h>
     27#import <WebKit2/WKConnection.h>
    2728#import <WebKit2/WKDeclarationSpecifiers.h>
     29#import <WebKit2/WKFoundation.h>
    2830
    29 @class WKProcessGroup, WKProcessGroupData, WKConnection;
     31#if WK_API_ENABLED
     32
     33@class WKProcessGroup;
    3034
    3135@protocol WKProcessGroupDelegate <NSObject>
     
    4145
    4246WK_EXPORT
    43 @interface WKProcessGroup : NSObject {
    44 @private
    45     WKProcessGroupData *_data;
    46 }
     47@interface WKProcessGroup : NSObject
    4748
    4849- (id)initWithInjectedBundleURL:(NSURL *)bundleURL;
    49 
    5050
    5151#pragma mark Delegates
     
    5454
    5555@end
     56
     57#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm

    r148376 r157676  
    2828#import "WKProcessGroupPrivate.h"
    2929
     30#if WK_API_ENABLED
     31
    3032#import "ObjCObjectGraph.h"
    3133#import "WKConnectionInternal.h"
     
    3537#import <wtf/RetainPtr.h>
    3638
    37 @interface WKProcessGroupData : NSObject {
    38 @public
     39@implementation WKProcessGroup {
    3940    // Underlying context object.
    4041    WKRetainPtr<WKContextRef> _contextRef;
    41 
    42     // Delegate for callbacks.
    43     id<WKProcessGroupDelegate> _delegate;
    4442}
    45 @end
    46 
    47 @implementation WKProcessGroupData
    48 @end
    49 
    50 @implementation WKProcessGroup
    5143
    5244static void didCreateConnection(WKContextRef, WKConnectionRef connectionRef, const void* clientInfo)
     
    10698        return nil;
    10799
    108     _data = [[WKProcessGroupData alloc] init];
    109    
    110100    if (bundleURL)
    111         _data->_contextRef = adoptWK(WKContextCreateWithInjectedBundlePath(adoptWK(WKStringCreateWithCFString((CFStringRef)[bundleURL path])).get()));
     101        _contextRef = adoptWK(WKContextCreateWithInjectedBundlePath(adoptWK(WKStringCreateWithCFString((CFStringRef)[bundleURL path])).get()));
    112102    else
    113         _data->_contextRef = adoptWK(WKContextCreate());
     103        _contextRef = adoptWK(WKContextCreate());
    114104
    115     setUpConnectionClient(self, _data->_contextRef.get());
    116     setUpInectedBundleClient(self, _data->_contextRef.get());
     105    setUpConnectionClient(self, _contextRef.get());
     106    setUpInectedBundleClient(self, _contextRef.get());
    117107
    118108    return self;
     
    121111- (void)dealloc
    122112{
    123     WKContextSetConnectionClient(_data->_contextRef.get(), 0);
    124     WKContextSetInjectedBundleClient(_data->_contextRef.get(), 0);
     113    WKContextSetConnectionClient(_contextRef.get(), 0);
     114    WKContextSetInjectedBundleClient(_contextRef.get(), 0);
    125115
    126     [_data release];
    127116    [super dealloc];
    128 }
    129 
    130 - (id<WKProcessGroupDelegate>)delegate
    131 {
    132     return _data->_delegate;
    133 }
    134 
    135 - (void)setDelegate:(id<WKProcessGroupDelegate>)delegate
    136 {
    137     _data->_delegate = delegate;
    138117}
    139118
     
    144123- (WKContextRef)_contextRef
    145124{
    146     return _data->_contextRef.get();
     125    return _contextRef.get();
    147126}
    148127
    149128@end
     129
     130#endif // WK_API_ENABLED
  • TabularUnified trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroupPrivate.h

    r155770 r157676  
    2727#import <WebKit2/WKBase.h>
    2828
     29#if WK_API_ENABLED
     30
    2931@interface WKProcessGroup (Private)
    3032
     
    3234
    3335@end
     36
     37#endif // WK_API_ENABLED
Note: See TracChangeset for help on using the changeset viewer.