Changeset 169356 in webkit


Ignore:
Timestamp:
May 26, 2014 11:00:47 AM (10 years ago)
Author:
mitz@apple.com
Message:

[Cocoa] Rewrite WK_DESIGNATED_INITIALIZER in installed headers
https://bugs.webkit.org/show_bug.cgi?id=133290

Reviewed by Anders Carlsson.

  • Shared/API/Cocoa/WKFoundation.h: When WK_API_AVAILABILITY_ENABLED is defined, don’t

provide definitions of WK_DESIGNATED_INITIALIZER and WK_UNAVAILABLE, since those macros will
be rewritten out of the headers. When WK_API_AVAILABILITY_ENABLED isn’t defined, provide
definitions of the other two macros as appropriate for the target OS.

  • UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Removed WK_DESIGNATED_INITIALIZER from a

category method declaration.

  • UIProcess/API/Cocoa/WKWebView.h: Mark the superclass designated initializer

-initWithCoder: as unavailable.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView initWithCoder:]): Override this designated initializer of the superclass by
returning nil.

  • mac/rewrite-availability-macros.sh: Rewrite WK_DESIGNATED_INITIALIZER to

NS_DESIGNATED_INITIALIZER and WK_UNAVAILABLE to NS_UNAVAILABLE. Also make sure to process
all headers if the script has changed since the last time it was run.

Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r169355 r169356  
     12014-05-26  Dan Bernstein  <mitz@apple.com>
     2
     3        [Cocoa] Rewrite WK_DESIGNATED_INITIALIZER in installed headers
     4        https://bugs.webkit.org/show_bug.cgi?id=133290
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Shared/API/Cocoa/WKFoundation.h: When WK_API_AVAILABILITY_ENABLED is defined, don’t
     9        provide definitions of WK_DESIGNATED_INITIALIZER and WK_UNAVAILABLE, since those macros will
     10        be rewritten out of the headers. When WK_API_AVAILABILITY_ENABLED isn’t defined, provide
     11        definitions of the other two macros as appropriate for the target OS.
     12        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Removed WK_DESIGNATED_INITIALIZER from a
     13        category method declaration.
     14        * UIProcess/API/Cocoa/WKWebView.h: Mark the superclass designated initializer
     15        -initWithCoder: as unavailable.
     16        * UIProcess/API/Cocoa/WKWebView.mm:
     17        (-[WKWebView initWithCoder:]): Override this designated initializer of the superclass by
     18        returning nil.
     19        * mac/rewrite-availability-macros.sh: Rewrite WK_DESIGNATED_INITIALIZER to
     20        NS_DESIGNATED_INITIALIZER and WK_UNAVAILABLE to NS_UNAVAILABLE. Also make sure to process
     21        all headers if the script has changed since the last time it was run.
     22
    1232014-05-26  Commit Queue  <commit-queue@webkit.org>
    224
  • trunk/Source/WebKit2/Shared/API/Cocoa/WKFoundation.h

    r168768 r169356  
    4848#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 1090
    4949
     50#define WK_DESIGNATED_INITIALIZER
     51#define WK_UNAVAILABLE
     52
    5053#ifdef __OBJC__
    5154#import <Foundation/Foundation.h>
     
    5356#endif
    5457
     58#else
     59
     60#define WK_DESIGNATED_INITIALIZER NS_DESIGNATED_INITIALIZER
     61#define WK_UNAVAILABLE NS_UNAVAILABLE
     62
    5563#endif
    5664
    5765#endif
    58 
    59 #define WK_DESIGNATED_INITIALIZER
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h

    r168541 r169356  
    3333@interface WKProcessPool (WKPrivate)
    3434
    35 - (instancetype)_initWithConfiguration:(_WKProcessPoolConfiguration *)configuration __attribute__((objc_method_family(init))) WK_DESIGNATED_INITIALIZER;
     35- (instancetype)_initWithConfiguration:(_WKProcessPoolConfiguration *)configuration __attribute__((objc_method_family(init)));
    3636
    3737@property (nonatomic, readonly) _WKProcessPoolConfiguration *_configuration;
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h

    r168566 r169356  
    8080- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration WK_DESIGNATED_INITIALIZER;
    8181
     82- (instancetype)initWithCoder:(NSCoder *)coder WK_UNAVAILABLE;
     83
    8284/*! @abstract Navigates to the given NSURLRequest.
    8385 @param request The NSURLRequest to navigate to.
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r169326 r169356  
    269269}
    270270
     271- (instancetype)initWithCoder:(NSCoder *)coder
     272{
     273    [self release];
     274    return nil;
     275}
     276
    271277- (void)dealloc
    272278{
  • trunk/Source/WebKit2/mac/rewrite-availability-macros.sh

    r168566 r169356  
    3131TIMESTAMP_PATH=${TARGET_TEMP_DIR}/${0##*/}
    3232
     33if [[ $0 -nt $TIMESTAMP_PATH ]]; then
     34    rm "${TIMESTAMP_PATH}";
     35fi
     36
    3337function rewrite_headers () {
    3438    for HEADER_PATH in $1/*.h; do
    3539        if [[ $HEADER_PATH -nt $TIMESTAMP_PATH ]]; then
    36             sed -e s/^WK_CLASS_AVAILABLE/NS_CLASS_AVAILABLE/ -e s/WK_AVAILABLE/NS_AVAILABLE/ -e s/WK_ENUM_AVAILABLE/NS_ENUM_AVAILABLE/ ${HEADER_PATH} > ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_;
     40            sed -e s/^WK_CLASS_AVAILABLE/NS_CLASS_AVAILABLE/ -e s/WK_AVAILABLE/NS_AVAILABLE/ -e s/WK_DESIGNATED_INITIALIZER/NS_DESIGNATED_INITIALIZER/ -e s/WK_ENUM_AVAILABLE/NS_ENUM_AVAILABLE/ -e s/WK_UNAVAILABLE/NS_UNAVAILABLE/ ${HEADER_PATH} > ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_;
    3741            mv ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} $HEADER_PATH;
    3842        fi
Note: See TracChangeset for help on using the changeset viewer.