Changeset 243787 in webkit
- Timestamp:
- Apr 2, 2019, 9:58:04 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 13 edited
-
ChangeLog (modified) (1 diff)
-
Shared/API/Cocoa/WebKit.h (modified) (1 diff)
-
UIProcess/API/APIPageConfiguration.cpp (modified) (2 diffs)
-
UIProcess/API/APIPageConfiguration.h (modified) (3 diffs)
-
UIProcess/API/Cocoa/WKNavigationDelegate.h (modified) (3 diffs)
-
UIProcess/API/Cocoa/WKWebView.mm (modified) (1 diff)
-
UIProcess/API/Cocoa/WKWebViewConfiguration.h (modified) (3 diffs)
-
UIProcess/API/Cocoa/WKWebViewConfiguration.mm (modified) (3 diffs)
-
UIProcess/API/Cocoa/WKWebpagePreferences.h (modified) (2 diffs)
-
UIProcess/Cocoa/NavigationState.h (modified) (1 diff)
-
UIProcess/Cocoa/NavigationState.mm (modified) (10 diffs)
-
WebKit.xcodeproj/project.pbxproj (modified) (8 diffs)
-
mac/postprocess-framework-headers.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243784 r243787 1 2019-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 1 47 2019-04-02 Geoffrey Garen <ggaren@apple.com> 2 48 -
trunk/Source/WebKit/Shared/API/Cocoa/WebKit.h
r220784 r243787 53 53 #import <WebKit/WKWebView.h> 54 54 #import <WebKit/WKWebViewConfiguration.h> 55 #import <WebKit/WKWebpagePreferences.h> 55 56 #import <WebKit/WKWebsiteDataRecord.h> 56 57 #import <WebKit/WKWebsiteDataStore.h> -
trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp
r239258 r243787 28 28 29 29 #include "APIProcessPoolConfiguration.h" 30 #include "APIWebsitePolicies.h" 30 31 #include "WebPageGroup.h" 31 32 #include "WebPageProxy.h" … … 165 166 } 166 167 168 WebsitePolicies* PageConfiguration::defaultWebsitePolicies() const 169 { 170 return m_defaultWebsitePolicies.get(); 171 } 172 173 void PageConfiguration::setDefaultWebsitePolicies(WebsitePolicies* policies) 174 { 175 m_defaultWebsitePolicies = policies; 176 } 177 167 178 PAL::SessionID PageConfiguration::sessionID() 168 179 { -
trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h
r239427 r243787 46 46 class ApplicationManifest; 47 47 class WebsiteDataStore; 48 class WebsitePolicies; 48 49 49 50 class PageConfiguration : public ObjectImpl<Object::Type::PageConfiguration> { … … 81 82 WebsiteDataStore* websiteDataStore(); 82 83 void setWebsiteDataStore(WebsiteDataStore*); 84 85 WebsitePolicies* defaultWebsitePolicies() const; 86 void setDefaultWebsitePolicies(WebsitePolicies*); 83 87 84 88 // FIXME: Once PageConfigurations *always* have a data store, get rid of the separate sessionID. … … 136 140 137 141 RefPtr<WebsiteDataStore> m_websiteDataStore; 142 RefPtr<WebsitePolicies> m_defaultWebsitePolicies; 138 143 // FIXME: We currently have to pass the session ID separately here to support the legacy private browsing session. 139 144 // 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 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 @class WKNavigationResponse; 35 35 @class WKWebView; 36 @class WKWebpagePreferences; 36 37 37 38 /*! @enum WKNavigationActionPolicy … … 73 74 */ 74 75 - (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)); 75 90 76 91 /*! @abstract Decides whether to allow or cancel a navigation after its -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r243726 r243787 575 575 pageConfiguration->setVisitedLinkStore([_configuration _visitedLinkStore]->_visitedLinkStore.get()); 576 576 pageConfiguration->setWebsiteDataStore([_configuration websiteDataStore]->_websiteDataStore.get()); 577 pageConfiguration->setDefaultWebsitePolicies([_configuration defaultWebpagePreferences]->_websitePolicies.get()); 577 578 578 579 #if PLATFORM(MAC) -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.h
r243376 r243787 1 1 /* 2 * Copyright (C) 2014-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2014-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 @class WKProcessPool; 35 35 @class WKUserContentController; 36 @class WKWebpagePreferences; 36 37 @class WKWebsiteDataStore; 37 38 @protocol WKURLSchemeHandler; … … 129 130 130 131 @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)); 131 138 132 139 #if TARGET_OS_IPHONE -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
r243682 r243787 119 119 LazyInitialized<RetainPtr<_WKVisitedLinkStore>> _visitedLinkStore; 120 120 LazyInitialized<RetainPtr<WKWebsiteDataStore>> _websiteDataStore; 121 LazyInitialized<RetainPtr<WKWebpagePreferences>> _defaultWebpagePreferences; 121 122 WeakObjCPtr<WKWebView> _relatedWebView; 122 123 WeakObjCPtr<WKWebView> _alternateWebViewForNavigationGestures; … … 358 359 configuration.userContentController = self.userContentController; 359 360 configuration.websiteDataStore = self.websiteDataStore; 361 configuration.defaultWebpagePreferences = self.defaultWebpagePreferences; 360 362 configuration._visitedLinkStore = self._visitedLinkStore; 361 363 configuration._relatedWebView = _relatedWebView.get().get(); … … 474 476 } 475 477 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 476 490 static NSString *defaultApplicationNameForUserAgent() 477 491 { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.h
r243726 r243787 26 26 #import <WebKit/WKFoundation.h> 27 27 28 #if USE(APPLE_INTERNAL_SDK) 29 #import <WebKitAdditions/WKWebpagePreferencesAdditionsBefore.h> 30 #endif 31 28 32 /*! A WKWebpagePreferences object is a collection of properties that 29 33 determine the preferences to use when loading and rendering a page. … … 33 37 @interface WKWebpagePreferences : NSObject 34 38 39 #if USE(APPLE_INTERNAL_SDK) 40 #import <WebKitAdditions/WKWebpagePreferencesAdditionsAfter.h> 41 #endif 42 35 43 @end -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h
r243319 r243787 187 187 struct { 188 188 bool webViewDecidePolicyForNavigationActionDecisionHandler : 1; 189 bool webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler : 1; 189 190 bool webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies : 1; 190 191 bool webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies : 1; -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
r243753 r243787 31 31 #import "APINavigationData.h" 32 32 #import "APINavigationResponse.h" 33 #import "APIPageConfiguration.h" 33 34 #import "APIString.h" 34 35 #import "APIURL.h" … … 149 150 150 151 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler = [delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]; 152 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler = [delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:withPreferences:decisionHandler:)]; 151 153 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies = [delegate respondsToSelector:@selector(_webView:decidePolicyForNavigationAction:decisionHandler:)]; 152 154 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies = [delegate respondsToSelector:@selector(_webView:decidePolicyForNavigationAction:userInfo:decisionHandler:)]; … … 509 511 { 510 512 bool subframeNavigation = navigationAction->targetFrame() && !navigationAction->targetFrame()->isMainFrame(); 513 auto defaultWebsitePolicies = makeRefPtr(webPageProxy.configuration().defaultWebsitePolicies()); 511 514 512 515 if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler 516 && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler 513 517 && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies 514 518 && !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) { 516 520 if (interceptedNavigation) { 517 521 listener->ignore(); … … 520 524 521 525 if (!navigationAction->targetFrame()) { 522 listener->use( );526 listener->use(defaultWebsitePolicies.get()); 523 527 return; 524 528 } … … 529 533 listener->download(); 530 534 else 531 listener->use( );535 listener->use(defaultWebsitePolicies.get()); 532 536 return; 533 537 } … … 549 553 return; 550 554 555 bool delegateHasWebpagePreferences = m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler; 551 556 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 { 556 568 if (checker->completionHandlerHasBeenCalled()) 557 569 return; … … 565 577 else if (policiesOrPreferences) 566 578 [NSException raise:NSInvalidArgumentException format:@"Expected policies of class %@, but got %@", NSStringFromClass(_WKWebsitePolicies.self), [policiesOrPreferences class]]; 579 else 580 apiWebsitePolicies = defaultWebsitePolicies; 567 581 568 582 if (apiWebsitePolicies) { … … 570 584 auto sessionID = websiteDataStore->websiteDataStore().sessionID(); 571 585 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."]; 573 587 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."]; 575 589 } 576 590 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."]; 578 592 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."]; 580 594 } 581 595 … … 613 627 } 614 628 }; 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)); 618 634 if (m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies) 619 635 [(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) userInfo:userInfo ? static_cast<id <NSSecureCoding>>(userInfo->wrapper()) : nil decisionHandler:decisionHandler.get()]; … … 624 640 } 625 641 } else { 626 auto decisionHandler WithoutPolicies = [decisionHandlerWithPolicies = WTFMove(decisionHandlerWithPolicies)] (WKNavigationActionPolicy actionPolicy) mutable {627 decisionHandlerWithP olicies(actionPolicy, nil);642 auto decisionHandler = [decisionHandlerWithPreferencesOrPolicies = WTFMove(decisionHandlerWithPreferencesOrPolicies)] (WKNavigationActionPolicy actionPolicy) mutable { 643 decisionHandlerWithPreferencesOrPolicies(actionPolicy, nil); 628 644 }; 629 [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:makeBlockPtr(WTFMove(decisionHandler WithoutPolicies)).get()];645 [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:makeBlockPtr(WTFMove(decisionHandler)).get()]; 630 646 } 631 647 } -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r243731 r243787 1637 1637 ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1638 1638 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 = (P rivate, ); }; };1639 F438CD1C2241421400DE6DDA /* WKWebpagePreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1B224140A600DE6DDA /* WKWebpagePreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1640 1640 F438CD1F22414D4000DE6DDA /* WKWebpagePreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1E22414D4000DE6DDA /* WKWebpagePreferencesInternal.h */; }; 1641 1641 F438CD212241F69500DE6DDA /* WKWebpagePreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD202241F69500DE6DDA /* WKWebpagePreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7108 7108 1A8B66B21BC45B010082DF77 /* WKBundleMac.h */, 7109 7109 1A8B66B11BC45B010082DF77 /* WKBundleMac.mm */, 7110 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */, 7111 7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */, 7110 7112 C6A4CA092252899800169289 /* WKBundlePageMac.h */, 7111 7113 C6A4CA0A2252899800169289 /* WKBundlePageMac.mm */, 7112 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */,7113 7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */,7114 7114 ); 7115 7115 path = mac; … … 9777 9777 BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */, 9778 9778 1AB474D8184D43FD0051B622 /* WKBundlePageLoaderClient.h in Headers */, 9779 C6A4CA0B2252899800169289 /* WKBundlePageMac.h in Headers */, 9779 9780 ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */, 9780 9781 1AB474EA184D45130051B622 /* WKBundlePagePolicyClient.h in Headers */, … … 9784 9785 BCF049E711FE20F600F86A58 /* WKBundlePrivate.h in Headers */, 9785 9786 BC60C5791240A546008C5E29 /* WKBundleRangeHandle.h in Headers */, 9786 C6A4CA0B2252899800169289 /* WKBundlePageMac.h in Headers */,9787 9787 BC5D24C716CD73C5007D5461 /* WKBundleRangeHandlePrivate.h in Headers */, 9788 9788 BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */, … … 10177 10177 375A248817E5048E00C9A086 /* Postprocess WKBase.h */, 10178 10178 1AD98ECF191D867300CAA6DF /* Postprocess WKFoundation.h */, 10179 F4EFBAD522540CBB00049BA6 /* Replace WebKitAdditions in Framework Headers */, 10179 10180 1A1D2115191D96380001619F /* Postprocess Framework Headers */, 10180 10181 2E16B6F42019BC25008996D6 /* Copy Additional Resources */, … … 10835 10836 shellPath = /bin/sh; 10836 10837 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"; 10837 10852 }; 10838 10853 /* End PBXShellScriptBuildPhase section */ … … 11049 11064 2D11B7A82126A283006F8878 /* UnifiedSource44.cpp in Sources */, 11050 11065 2D11B7A92126A283006F8878 /* UnifiedSource45-mm.mm in Sources */, 11051 C6A4CA0C2252899800169289 /* WKBundlePageMac.mm in Sources */,11052 11066 2D11B7AA2126A283006F8878 /* UnifiedSource45.cpp in Sources */, 11053 11067 2D11B7AB2126A283006F8878 /* UnifiedSource46-mm.mm in Sources */, … … 11211 11225 7C361D78192803BD0036A59D /* WebUserContentControllerProxyMessageReceiver.cpp in Sources */, 11212 11226 2D92A78F212B6AB100F493FD /* WebWheelEvent.cpp in Sources */, 11227 C6A4CA0C2252899800169289 /* WKBundlePageMac.mm in Sources */, 11213 11228 2D931169212F61B200044BFE /* WKContentView.mm in Sources */, 11214 11229 2D93116A212F61B500044BFE /* WKContentViewInteraction.mm in Sources */, -
trunk/Source/WebKit/mac/postprocess-framework-headers.sh
r243569 r243787 49 49 } 50 50 51 function replace_webkit_additions_includes () {52 if [[ -z `grep '#import <WebKitAdditions/.*\.h>' "${1}"` ]]; then53 return 054 fi55 python "$(dirname $0)/replace-webkit-additions-includes.py" "${1}" "${BUILT_PRODUCTS_DIR}" "${SDKROOT}"56 return $?57 }58 59 51 function rewrite_headers () { 60 52 if [[ "${WK_PLATFORM_NAME}" == "macosx" ]]; then … … 90 82 if [[ "$HEADER_PATH" -nt $TIMESTAMP_PATH ]]; then 91 83 ditto "${HEADER_PATH}" "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}" 92 replace_webkit_additions_includes "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}"93 84 sed -i .tmp -E "${SED_OPTIONS[@]}" "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}" || exit $? 94 85 mv "${TARGET_TEMP_DIR}/${HEADER_PATH##*/}" "$HEADER_PATH"
Note:
See TracChangeset
for help on using the changeset viewer.