⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243787 in webkit


Ignore:
Timestamp:
Apr 2, 2019, 9:58:04 PM (7 years ago)
Author:
Wenson Hsieh
Message:

[Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
https://bugs.webkit.org/show_bug.cgi?id=196284
<rdar://problem/47228232>

Reviewed by Tim Horton.

Tests for both of these APIs will be added in a subsequent patch.

  • Shared/API/Cocoa/WebKit.h:
  • UIProcess/API/APIPageConfiguration.cpp:

(API::PageConfiguration::defaultWebsitePolicies const):
(API::PageConfiguration::setDefaultWebsitePolicies):

  • UIProcess/API/APIPageConfiguration.h:
  • UIProcess/API/Cocoa/WKNavigationDelegate.h:

Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
navigation action.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _initializeWithConfiguration:]):

  • UIProcess/API/Cocoa/WKWebViewConfiguration.h:
  • UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.

(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration defaultWebpagePreferences]):
(-[WKWebViewConfiguration setDefaultWebpagePreferences:]):

  • UIProcess/API/Cocoa/WKWebpagePreferences.h:
  • UIProcess/Cocoa/NavigationState.h:
  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

Invoke the new WKWebpagePreferences-based navigation delegate method.

  • WebKit.xcodeproj/project.pbxproj:
  • mac/postprocess-framework-headers.sh:
  • mac/replace-webkit-additions-in-framework-headers.sh: Added.

Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
ensures headers attempting to include from WebKitAdditions have these additional statements removed.

Location:
trunk/Source/WebKit
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r243784 r243787  
     12019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
     4        https://bugs.webkit.org/show_bug.cgi?id=196284
     5        <rdar://problem/47228232>
     6
     7        Reviewed by Tim Horton.
     8
     9        Tests for both of these APIs will be added in a subsequent patch.
     10
     11        * Shared/API/Cocoa/WebKit.h:
     12        * UIProcess/API/APIPageConfiguration.cpp:
     13        (API::PageConfiguration::defaultWebsitePolicies const):
     14        (API::PageConfiguration::setDefaultWebsitePolicies):
     15        * UIProcess/API/APIPageConfiguration.h:
     16        * UIProcess/API/Cocoa/WKNavigationDelegate.h:
     17
     18        Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
     19        navigation action.
     20
     21        * UIProcess/API/Cocoa/WKWebView.mm:
     22        (-[WKWebView _initializeWithConfiguration:]):
     23        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
     24        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     25
     26        Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.
     27
     28        (-[WKWebViewConfiguration copyWithZone:]):
     29        (-[WKWebViewConfiguration defaultWebpagePreferences]):
     30        (-[WKWebViewConfiguration setDefaultWebpagePreferences:]):
     31        * UIProcess/API/Cocoa/WKWebpagePreferences.h:
     32        * UIProcess/Cocoa/NavigationState.h:
     33        * UIProcess/Cocoa/NavigationState.mm:
     34        (WebKit::NavigationState::setNavigationDelegate):
     35        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
     36
     37        Invoke the new WKWebpagePreferences-based navigation delegate method.
     38
     39        * WebKit.xcodeproj/project.pbxproj:
     40        * mac/postprocess-framework-headers.sh:
     41        * mac/replace-webkit-additions-in-framework-headers.sh: Added.
     42
     43        Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
     44        WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
     45        ensures headers attempting to include from WebKitAdditions have these additional statements removed.
     46
    1472019-04-02  Geoffrey Garen  <ggaren@apple.com>
    248
  • trunk/Source/WebKit/Shared/API/Cocoa/WebKit.h

    r220784 r243787  
    5353#import <WebKit/WKWebView.h>
    5454#import <WebKit/WKWebViewConfiguration.h>
     55#import <WebKit/WKWebpagePreferences.h>
    5556#import <WebKit/WKWebsiteDataRecord.h>
    5657#import <WebKit/WKWebsiteDataStore.h>
  • trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp

    r239258 r243787  
    2828
    2929#include "APIProcessPoolConfiguration.h"
     30#include "APIWebsitePolicies.h"
    3031#include "WebPageGroup.h"
    3132#include "WebPageProxy.h"
     
    165166}
    166167
     168WebsitePolicies* PageConfiguration::defaultWebsitePolicies() const
     169{
     170    return m_defaultWebsitePolicies.get();
     171}
     172
     173void PageConfiguration::setDefaultWebsitePolicies(WebsitePolicies* policies)
     174{
     175    m_defaultWebsitePolicies = policies;
     176}
     177
    167178PAL::SessionID PageConfiguration::sessionID()
    168179{
  • trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h

    r239427 r243787  
    4646class ApplicationManifest;
    4747class WebsiteDataStore;
     48class WebsitePolicies;
    4849
    4950class PageConfiguration : public ObjectImpl<Object::Type::PageConfiguration> {
     
    8182    WebsiteDataStore* websiteDataStore();
    8283    void setWebsiteDataStore(WebsiteDataStore*);
     84
     85    WebsitePolicies* defaultWebsitePolicies() const;
     86    void setDefaultWebsitePolicies(WebsitePolicies*);
    8387
    8488    // FIXME: Once PageConfigurations *always* have a data store, get rid of the separate sessionID.
     
    136140
    137141    RefPtr<WebsiteDataStore> m_websiteDataStore;
     142    RefPtr<WebsitePolicies> m_defaultWebsitePolicies;
    138143    // FIXME: We currently have to pass the session ID separately here to support the legacy private browsing session.
    139144    // Once we get rid of it we should get rid of this configuration parameter as well.
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegate.h

    r243376 r243787  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434@class WKNavigationResponse;
    3535@class WKWebView;
     36@class WKWebpagePreferences;
    3637
    3738/*! @enum WKNavigationActionPolicy
     
    7374 */
    7475- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler;
     76
     77/*! @abstract Decides whether to allow or cancel a navigation.
     78 @param webView The web view invoking the delegate method.
     79 @param navigationAction Descriptive information about the action
     80 triggering the navigation request.
     81 @param preferences The default set of webpage preferences. This may be
     82 changed by setting defaultWebpagePreferences on WKWebViewConfiguration.
     83 @param decisionHandler The policy decision handler to call to allow or cancel
     84 the navigation. The arguments are one of the constants of the enumerated type
     85 WKNavigationActionPolicy, as well as an instance of WKWebpagePreferences.
     86 @discussion If you implement this method,
     87 -webView:decidePolicyForNavigationAction:decisionHandler: will not be called.
     88 */
     89- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction withPreferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    7590
    7691/*! @abstract Decides whether to allow or cancel a navigation after its
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r243726 r243787  
    575575    pageConfiguration->setVisitedLinkStore([_configuration _visitedLinkStore]->_visitedLinkStore.get());
    576576    pageConfiguration->setWebsiteDataStore([_configuration websiteDataStore]->_websiteDataStore.get());
     577    pageConfiguration->setDefaultWebsitePolicies([_configuration defaultWebpagePreferences]->_websitePolicies.get());
    577578
    578579#if PLATFORM(MAC)
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.h

    r243376 r243787  
    11/*
    2  * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434@class WKProcessPool;
    3535@class WKUserContentController;
     36@class WKWebpagePreferences;
    3637@class WKWebsiteDataStore;
    3738@protocol WKURLSchemeHandler;
     
    129130
    130131@property (nonatomic) WKAudiovisualMediaTypes mediaTypesRequiringUserActionForPlayback WK_API_AVAILABLE(macos(10.12), ios(10.0));
     132
     133/*! @abstract The set of default webpage preferences to use when loading and rendering content.
     134 @discussion These default webpage preferences are additionally passed to the navigation delegate
     135 in -webView:decidePolicyForNavigationAction:withPreferences:decisionHandler:.
     136 */
     137@property (null_resettable, nonatomic, copy) WKWebpagePreferences *defaultWebpagePreferences WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    131138
    132139#if TARGET_OS_IPHONE
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm

    r243682 r243787  
    119119    LazyInitialized<RetainPtr<_WKVisitedLinkStore>> _visitedLinkStore;
    120120    LazyInitialized<RetainPtr<WKWebsiteDataStore>> _websiteDataStore;
     121    LazyInitialized<RetainPtr<WKWebpagePreferences>> _defaultWebpagePreferences;
    121122    WeakObjCPtr<WKWebView> _relatedWebView;
    122123    WeakObjCPtr<WKWebView> _alternateWebViewForNavigationGestures;
     
    358359    configuration.userContentController = self.userContentController;
    359360    configuration.websiteDataStore = self.websiteDataStore;
     361    configuration.defaultWebpagePreferences = self.defaultWebpagePreferences;
    360362    configuration._visitedLinkStore = self._visitedLinkStore;
    361363    configuration._relatedWebView = _relatedWebView.get().get();
     
    474476}
    475477
     478- (WKWebpagePreferences *)defaultWebpagePreferences
     479{
     480    return _defaultWebpagePreferences.get([] {
     481        return WKWebpagePreferences.defaultPreferences;
     482    });
     483}
     484
     485- (void)setDefaultWebpagePreferences:(WKWebpagePreferences *)defaultWebpagePreferences
     486{
     487    _defaultWebpagePreferences.set(defaultWebpagePreferences ?: WKWebpagePreferences.defaultPreferences);
     488}
     489
    476490static NSString *defaultApplicationNameForUserAgent()
    477491{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.h

    r243726 r243787  
    2626#import <WebKit/WKFoundation.h>
    2727
     28#if USE(APPLE_INTERNAL_SDK)
     29#import <WebKitAdditions/WKWebpagePreferencesAdditionsBefore.h>
     30#endif
     31
    2832/*! A WKWebpagePreferences object is a collection of properties that
    2933 determine the preferences to use when loading and rendering a page.
     
    3337@interface WKWebpagePreferences : NSObject
    3438
     39#if USE(APPLE_INTERNAL_SDK)
     40#import <WebKitAdditions/WKWebpagePreferencesAdditionsAfter.h>
     41#endif
     42
    3543@end
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h

    r243319 r243787  
    187187    struct {
    188188        bool webViewDecidePolicyForNavigationActionDecisionHandler : 1;
     189        bool webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler : 1;
    189190        bool webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies : 1;
    190191        bool webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies : 1;
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm

    r243753 r243787  
    3131#import "APINavigationData.h"
    3232#import "APINavigationResponse.h"
     33#import "APIPageConfiguration.h"
    3334#import "APIString.h"
    3435#import "APIURL.h"
     
    149150
    150151    m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler = [delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)];
     152    m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler = [delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:withPreferences:decisionHandler:)];
    151153    m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies = [delegate respondsToSelector:@selector(_webView:decidePolicyForNavigationAction:decisionHandler:)];
    152154    m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies = [delegate respondsToSelector:@selector(_webView:decidePolicyForNavigationAction:userInfo:decisionHandler:)];
     
    509511{
    510512    bool subframeNavigation = navigationAction->targetFrame() && !navigationAction->targetFrame()->isMainFrame();
     513    auto defaultWebsitePolicies = makeRefPtr(webPageProxy.configuration().defaultWebsitePolicies());
    511514
    512515    if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler
     516        && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler
    513517        && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies
    514518        && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies) {
    515         auto completionHandler = [webPage = makeRef(webPageProxy), listener = WTFMove(listener), navigationAction = navigationAction.copyRef()] (bool interceptedNavigation) {
     519        auto completionHandler = [webPage = makeRef(webPageProxy), listener = WTFMove(listener), navigationAction = navigationAction.copyRef(), defaultWebsitePolicies] (bool interceptedNavigation) {
    516520            if (interceptedNavigation) {
    517521                listener->ignore();
     
    520524
    521525            if (!navigationAction->targetFrame()) {
    522                 listener->use();
     526                listener->use(defaultWebsitePolicies.get());
    523527                return;
    524528            }
     
    529533                    listener->download();
    530534                else
    531                     listener->use();
     535                    listener->use(defaultWebsitePolicies.get());
    532536                return;
    533537            }
     
    549553        return;
    550554
     555    bool delegateHasWebpagePreferences = m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler;
    551556    bool delegateHasWebsitePolicies = m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies || m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies;
    552    
    553     auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), delegateHasWebsitePolicies ? @selector(_webView:decidePolicyForNavigationAction:decisionHandler:) : @selector(webView:decidePolicyForNavigationAction:decisionHandler:));
    554    
    555     auto decisionHandlerWithPolicies = [localListener = WTFMove(listener), navigationAction = navigationAction.copyRef(), checker = WTFMove(checker), webPageProxy = makeRef(webPageProxy), subframeNavigation](WKNavigationActionPolicy actionPolicy, id policiesOrPreferences) mutable {
     557
     558    auto selectorForCompletionHandlerChecker = ([&] () -> SEL {
     559        if (delegateHasWebpagePreferences)
     560            return @selector(webView:decidePolicyForNavigationAction:withPreferences:decisionHandler:);
     561        if (delegateHasWebsitePolicies)
     562            return @selector(_webView:decidePolicyForNavigationAction:decisionHandler:);
     563        return @selector(webView:decidePolicyForNavigationAction:decisionHandler:);
     564    })();
     565
     566    auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), selectorForCompletionHandlerChecker);
     567    auto decisionHandlerWithPreferencesOrPolicies = [localListener = WTFMove(listener), navigationAction = navigationAction.copyRef(), checker = WTFMove(checker), webPageProxy = makeRef(webPageProxy), subframeNavigation, defaultWebsitePolicies] (WKNavigationActionPolicy actionPolicy, id policiesOrPreferences) mutable {
    556568        if (checker->completionHandlerHasBeenCalled())
    557569            return;
     
    565577        else if (policiesOrPreferences)
    566578            [NSException raise:NSInvalidArgumentException format:@"Expected policies of class %@, but got %@", NSStringFromClass(_WKWebsitePolicies.self), [policiesOrPreferences class]];
     579        else
     580            apiWebsitePolicies = defaultWebsitePolicies;
    567581
    568582        if (apiWebsitePolicies) {
     
    570584                auto sessionID = websiteDataStore->websiteDataStore().sessionID();
    571585                if (!sessionID.isEphemeral() && sessionID != PAL::SessionID::defaultSessionID())
    572                     [NSException raise:NSInvalidArgumentException format:@"_WKWebsitePolicies.websiteDataStore must be nil, default, or non-persistent."];
     586                    [NSException raise:NSInvalidArgumentException format:@"WKWebpagePreferences._websiteDataStore must be nil, default, or non-persistent."];
    573587                if (subframeNavigation)
    574                     [NSException raise:NSInvalidArgumentException format:@"_WKWebsitePolicies.websiteDataStore must be nil for subframe navigations."];
     588                    [NSException raise:NSInvalidArgumentException format:@"WKWebpagePreferences._websiteDataStore must be nil for subframe navigations."];
    575589            }
    576590            if (!apiWebsitePolicies->customUserAgent().isNull() && subframeNavigation)
    577                 [NSException raise:NSInvalidArgumentException format:@"_WKWebsitePolicies.customUserAgent must be nil for subframe navigations."];
     591                [NSException raise:NSInvalidArgumentException format:@"WKWebpagePreferences._customUserAgent must be nil for subframe navigations."];
    578592            if (!apiWebsitePolicies->customNavigatorPlatform().isNull() && subframeNavigation)
    579                 [NSException raise:NSInvalidArgumentException format:@"_WKWebsitePolicies.customNavigatorPlatform must be nil for subframe navigations."];
     593                [NSException raise:NSInvalidArgumentException format:@"WKWebpagePreferences._customNavigatorPlatform must be nil for subframe navigations."];
    580594        }
    581595
     
    613627        }
    614628    };
    615    
    616     if (delegateHasWebsitePolicies) {
    617         auto decisionHandler = makeBlockPtr(WTFMove(decisionHandlerWithPolicies));
     629
     630    if (delegateHasWebpagePreferences)
     631        [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) withPreferences:wrapper(defaultWebsitePolicies) decisionHandler:makeBlockPtr(WTFMove(decisionHandlerWithPreferencesOrPolicies)).get()];
     632    else if (delegateHasWebsitePolicies) {
     633        auto decisionHandler = makeBlockPtr(WTFMove(decisionHandlerWithPreferencesOrPolicies));
    618634        if (m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies)
    619635            [(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) userInfo:userInfo ? static_cast<id <NSSecureCoding>>(userInfo->wrapper()) : nil decisionHandler:decisionHandler.get()];
     
    624640        }
    625641    } else {
    626         auto decisionHandlerWithoutPolicies = [decisionHandlerWithPolicies = WTFMove(decisionHandlerWithPolicies)] (WKNavigationActionPolicy actionPolicy) mutable {
    627             decisionHandlerWithPolicies(actionPolicy, nil);
     642        auto decisionHandler = [decisionHandlerWithPreferencesOrPolicies = WTFMove(decisionHandlerWithPreferencesOrPolicies)] (WKNavigationActionPolicy actionPolicy) mutable {
     643            decisionHandlerWithPreferencesOrPolicies(actionPolicy, nil);
    628644        };
    629         [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:makeBlockPtr(WTFMove(decisionHandlerWithoutPolicies)).get()];
     645        [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:makeBlockPtr(WTFMove(decisionHandler)).get()];
    630646    }
    631647}
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r243731 r243787  
    16371637                ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
    16381638                F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1639                 F438CD1C2241421400DE6DDA /* WKWebpagePreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1B224140A600DE6DDA /* WKWebpagePreferences.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1639                F438CD1C2241421400DE6DDA /* WKWebpagePreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1B224140A600DE6DDA /* WKWebpagePreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
    16401640                F438CD1F22414D4000DE6DDA /* WKWebpagePreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1E22414D4000DE6DDA /* WKWebpagePreferencesInternal.h */; };
    16411641                F438CD212241F69500DE6DDA /* WKWebpagePreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD202241F69500DE6DDA /* WKWebpagePreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    71087108                                1A8B66B21BC45B010082DF77 /* WKBundleMac.h */,
    71097109                                1A8B66B11BC45B010082DF77 /* WKBundleMac.mm */,
     7110                                7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */,
     7111                                7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */,
    71107112                                C6A4CA092252899800169289 /* WKBundlePageMac.h */,
    71117113                                C6A4CA0A2252899800169289 /* WKBundlePageMac.mm */,
    7112                                 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */,
    7113                                 7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */,
    71147114                        );
    71157115                        path = mac;
     
    97779777                                BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */,
    97789778                                1AB474D8184D43FD0051B622 /* WKBundlePageLoaderClient.h in Headers */,
     9779                                C6A4CA0B2252899800169289 /* WKBundlePageMac.h in Headers */,
    97799780                                ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */,
    97809781                                1AB474EA184D45130051B622 /* WKBundlePagePolicyClient.h in Headers */,
     
    97849785                                BCF049E711FE20F600F86A58 /* WKBundlePrivate.h in Headers */,
    97859786                                BC60C5791240A546008C5E29 /* WKBundleRangeHandle.h in Headers */,
    9786                                 C6A4CA0B2252899800169289 /* WKBundlePageMac.h in Headers */,
    97879787                                BC5D24C716CD73C5007D5461 /* WKBundleRangeHandlePrivate.h in Headers */,
    97889788                                BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */,
     
    1017710177                                375A248817E5048E00C9A086 /* Postprocess WKBase.h */,
    1017810178                                1AD98ECF191D867300CAA6DF /* Postprocess WKFoundation.h */,
     10179                                F4EFBAD522540CBB00049BA6 /* Replace WebKitAdditions in Framework Headers */,
    1017910180                                1A1D2115191D96380001619F /* Postprocess Framework Headers */,
    1018010181                                2E16B6F42019BC25008996D6 /* Copy Additional Resources */,
     
    1083510836                        shellPath = /bin/sh;
    1083610837                        shellScript = "UNLOCK_SCRIPT_PATH=\"${SRCROOT}/../../../Internal/Tools/Scripts/unlock-safari-engineering-keychain-if-needed\"\n\n[[ -x \"${UNLOCK_SCRIPT_PATH}\" ]] && exec \"${UNLOCK_SCRIPT_PATH}\"\n\nexit 0\n";
     10838                };
     10839                F4EFBAD522540CBB00049BA6 /* Replace WebKitAdditions in Framework Headers */ = {
     10840                        isa = PBXShellScriptBuildPhase;
     10841                        buildActionMask = 2147483647;
     10842                        files = (
     10843                        );
     10844                        inputPaths = (
     10845                        );
     10846                        name = "Replace WebKitAdditions in Framework Headers";
     10847                        outputPaths = (
     10848                        );
     10849                        runOnlyForDeploymentPostprocessing = 0;
     10850                        shellPath = /bin/sh;
     10851                        shellScript = "if [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" -o \"${ACTION}\" = \"installapi\" ]; then\n    for HEADERS_DIRECTORY in \"${PUBLIC_HEADERS_FOLDER_PATH}\" \"${PRIVATE_HEADERS_FOLDER_PATH}\"; do\n        for HEADER_PATH in \"${TARGET_BUILD_DIR}/${HEADERS_DIRECTORY}/\"*.h; do\n            if [[ ! -z `grep '#import <WebKitAdditions/.*\\.h>' \"${HEADER_PATH}\"` ]]; then\n                python \"${SRCROOT}/mac/replace-webkit-additions-includes.py\" \"${HEADER_PATH}\" \"${BUILT_PRODUCTS_DIR}\" \"${SDKROOT}\" || exit $?\n            fi\n        done\n    done\nfi\n";
    1083710852                };
    1083810853/* End PBXShellScriptBuildPhase section */
     
    1104911064                                2D11B7A82126A283006F8878 /* UnifiedSource44.cpp in Sources */,
    1105011065                                2D11B7A92126A283006F8878 /* UnifiedSource45-mm.mm in Sources */,
    11051                                 C6A4CA0C2252899800169289 /* WKBundlePageMac.mm in Sources */,
    1105211066                                2D11B7AA2126A283006F8878 /* UnifiedSource45.cpp in Sources */,
    1105311067                                2D11B7AB2126A283006F8878 /* UnifiedSource46-mm.mm in Sources */,
     
    1121111225                                7C361D78192803BD0036A59D /* WebUserContentControllerProxyMessageReceiver.cpp in Sources */,
    1121211226                                2D92A78F212B6AB100F493FD /* WebWheelEvent.cpp in Sources */,
     11227                                C6A4CA0C2252899800169289 /* WKBundlePageMac.mm in Sources */,
    1121311228                                2D931169212F61B200044BFE /* WKContentView.mm in Sources */,
    1121411229                                2D93116A212F61B500044BFE /* WKContentViewInteraction.mm in Sources */,
  • trunk/Source/WebKit/mac/postprocess-framework-headers.sh

    r243569 r243787  
    4949}
    5050
    51 function replace_webkit_additions_includes () {
    52     if [[ -z `grep '#import <WebKitAdditions/.*\.h>' "${1}"` ]]; then
    53         return 0
    54     fi
    55     python "$(dirname $0)/replace-webkit-additions-includes.py" "${1}" "${BUILT_PRODUCTS_DIR}" "${SDKROOT}"
    56     return $?
    57 }
    58 
    5951function rewrite_headers () {
    6052    if [[ "${WK_PLATFORM_NAME}" == "macosx" ]]; then
     
    9082        if [[ "$HEADER_PATH" -nt $TIMESTAMP_PATH ]]; then
    9183            ditto "${HEADER_PATH}" "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}"
    92             replace_webkit_additions_includes "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}"
    9384            sed -i .tmp -E "${SED_OPTIONS[@]}" "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}" || exit $?
    9485            mv "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}" "$HEADER_PATH"
Note: See TracChangeset for help on using the changeset viewer.