Changeset 238470 in webkit
- Timestamp:
- Nov 24, 2018, 10:37:14 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/cocoa/SoftLinking.h (modified) (3 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/pal/cocoa/PassKitSoftLink.h (modified) (2 diffs)
-
WebCore/PAL/pal/ios/UIKitSoftLink.h (modified) (1 diff)
-
WebCore/editing/cocoa/DataDetection.mm (modified) (1 diff)
-
WebCore/editing/cocoa/FontAttributesCocoa.mm (modified) (2 diffs)
-
WebCore/editing/cocoa/FontShadowCocoa.mm (modified) (1 diff)
-
WebCore/platform/cocoa/DataDetectorsCoreSoftLink.h (modified) (1 diff)
-
WebCore/platform/graphics/cocoa/ColorCocoa.mm (modified) (1 diff)
-
WebCore/platform/ios/PlatformScreenIOS.mm (modified) (2 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (modified) (4 diffs)
-
WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (modified) (5 diffs)
-
WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r238469 r238470 1 2018-11-24 Andy Estes <aestes@apple.com> 2 3 [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function 4 https://bugs.webkit.org/show_bug.cgi?id=191899 5 6 Reviewed by Dean Jackson. 7 8 Currently, SOFT_LINK_CLASS_FOR_HEADER declares a class getter function that includes the 9 framework name. For example, NSView would have a class getter named 10 namespace::get_AppKit_NSViewClass(). 11 12 Including the framework name in the getter is unnecessary. Objective-C classes already exist 13 in a global namespace, so there is no need to disambiguate class names by framework. This 14 patch elides the framework name from the getter function. For example, NSView would now have 15 a getter named namespace::getNSViewClass(). 16 17 * wtf/cocoa/SoftLinking.h: 18 1 19 2018-11-24 Michael Catanzaro <mcatanzaro@igalia.com> 2 20 -
trunk/Source/WTF/wtf/cocoa/SoftLinking.h
r238434 r238470 379 379 SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, ) 380 380 381 #define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, framework,className) \381 #define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, className) \ 382 382 @class className; \ 383 383 namespace functionNamespace { \ 384 extern Class (*get _##framework##_##className##Class)(); \384 extern Class (*get##className##Class)(); \ 385 385 className *alloc##className##Instance(); \ 386 386 inline className *alloc##className##Instance() \ 387 387 { \ 388 return [get _##framework##_##className##Class() alloc]; \388 return [get##className##Class() alloc]; \ 389 389 } \ 390 390 } … … 394 394 namespace functionNamespace { \ 395 395 static Class init##className(); \ 396 export Class (*get _##framework##_##className##Class)() = init##className; \396 export Class (*get##className##Class)() = init##className; \ 397 397 static Class class##className; \ 398 398 \ … … 409 409 class##className = objc_getClass(#className); \ 410 410 RELEASE_ASSERT(class##className); \ 411 get _##framework##_##className##Class = className##Function; \411 get##className##Class = className##Function; \ 412 412 }); \ 413 413 return class##className; \ -
trunk/Source/WebCore/ChangeLog
r238466 r238470 1 2018-11-24 Andy Estes <aestes@apple.com> 2 3 [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function 4 https://bugs.webkit.org/show_bug.cgi?id=191899 5 6 Reviewed by Dean Jackson. 7 8 * editing/cocoa/DataDetection.mm: 9 * editing/cocoa/FontAttributesCocoa.mm: 10 * editing/cocoa/FontShadowCocoa.mm: 11 * platform/cocoa/DataDetectorsCoreSoftLink.h: 12 * platform/graphics/cocoa/ColorCocoa.mm: 13 * platform/ios/PlatformScreenIOS.mm: 14 1 15 2018-11-23 Jiewen Tan <jiewen_tan@apple.com> 2 16 -
trunk/Source/WebCore/PAL/ChangeLog
r238461 r238470 1 2018-11-24 Andy Estes <aestes@apple.com> 2 3 [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function 4 https://bugs.webkit.org/show_bug.cgi?id=191899 5 6 Reviewed by Dean Jackson. 7 8 * pal/cocoa/PassKitSoftLink.h: 9 * pal/ios/UIKitSoftLink.h: 10 1 11 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 12 -
trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h
r238434 r238470 33 33 SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, PassKit) 34 34 35 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKContact)36 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPassLibrary)37 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPayment)38 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentAuthorizationViewController)39 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentMethod)40 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentMerchantSession)41 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentRequest)42 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentSummaryItem)43 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKShippingMethod)35 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKContact) 36 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPassLibrary) 37 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPayment) 38 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentAuthorizationViewController) 39 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentMethod) 40 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentMerchantSession) 41 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequest) 42 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentSummaryItem) 43 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKShippingMethod) 44 44 45 45 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion)) … … 47 47 48 48 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) 49 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentAuthorizationResult)50 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentRequestPaymentMethodUpdate)51 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentRequestShippingContactUpdate)52 SOFT_LINK_CLASS_FOR_HEADER(PAL, P assKit, PKPaymentRequestShippingMethodUpdate)49 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentAuthorizationResult) 50 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequestPaymentMethodUpdate) 51 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequestShippingContactUpdate) 52 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequestShippingMethodUpdate) 53 53 54 54 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldEmailAddress, PKContactField) -
trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h
r237266 r238470 33 33 SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, UIKit) 34 34 35 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIKit,NSParagraphStyle)36 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIKit,NSShadow)37 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIKit,NSTextList)38 SOFT_LINK_CLASS_FOR_HEADER(PAL, UI Kit, UIApplication)39 SOFT_LINK_CLASS_FOR_HEADER(PAL, UI Kit, UIScreen)40 SOFT_LINK_CLASS_FOR_HEADER(PAL, UI Kit, UIColor)35 SOFT_LINK_CLASS_FOR_HEADER(PAL, NSParagraphStyle) 36 SOFT_LINK_CLASS_FOR_HEADER(PAL, NSShadow) 37 SOFT_LINK_CLASS_FOR_HEADER(PAL, NSTextList) 38 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIApplication) 39 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIScreen) 40 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIColor) 41 41 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, UIKit, UIAccessibilityIsGrayscaleEnabled, BOOL, (void), ()) 42 42 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ()) -
trunk/Source/WebCore/editing/cocoa/DataDetection.mm
r238002 r238470 644 644 lastTextNodeToUpdate->setData(lastNodeContent); 645 645 646 return [get _DataDetectorsCore_DDScannerResultClass() resultsFromCoreResults:scannerResults.get()];646 return [getDDScannerResultClass() resultsFromCoreResults:scannerResults.get()]; 647 647 } 648 648 -
trunk/Source/WebCore/editing/cocoa/FontAttributesCocoa.mm
r237266 r238470 77 77 Class textListClass = NSTextList.class; 78 78 #else 79 Class textListClass = PAL::get _UIKit_NSTextListClass();79 Class textListClass = PAL::getNSTextListClass(); 80 80 #endif 81 81 auto result = adoptNS([[textListClass alloc] initWithMarkerFormat:cocoaTextListMarkerName(style, ordered) options:0]); … … 107 107 Class paragraphStyleClass = NSParagraphStyle.class; 108 108 #else 109 Class paragraphStyleClass = PAL::get _UIKit_NSParagraphStyleClass();109 Class paragraphStyleClass = PAL::getNSParagraphStyleClass(); 110 110 #endif 111 111 auto style = adoptNS([[paragraphStyleClass defaultParagraphStyle] mutableCopy]); -
trunk/Source/WebCore/editing/cocoa/FontShadowCocoa.mm
r237266 r238470 41 41 auto shadow = adoptNS([NSShadow new]); 42 42 #elif PLATFORM(IOS_FAMILY) 43 auto shadow = adoptNS([PAL::get _UIKit_NSShadowClass() new]);43 auto shadow = adoptNS([PAL::getNSShadowClass() new]); 44 44 #endif 45 45 [shadow setShadowColor:platformColor(color)]; -
trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.h
r237266 r238470 33 33 #if PLATFORM(IOS_FAMILY) 34 34 35 SOFT_LINK_CLASS_FOR_HEADER(WebCore, D ataDetectorsCore, DDScannerResult)35 SOFT_LINK_CLASS_FOR_HEADER(WebCore, DDScannerResult) 36 36 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDScannerCreate, DDScannerRef, (DDScannerType type, DDScannerOptions options, CFErrorRef * errorRef), (type, options, errorRef)) 37 37 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDScannerScanQuery, Boolean, (DDScannerRef scanner, DDScanQueryRef query), (scanner, query)) -
trunk/Source/WebCore/platform/graphics/cocoa/ColorCocoa.mm
r237266 r238470 49 49 UIColor *platformColor(const Color& color) 50 50 { 51 return [PAL::get _UIKit_UIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color)];51 return [PAL::getUIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color)]; 52 52 } 53 53 -
trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm
r237266 r238470 130 130 FloatSize screenSize() 131 131 { 132 if (deviceHasIPadCapability() && [[PAL::get _UIKit_UIApplicationClass() sharedApplication] _isClassic])132 if (deviceHasIPadCapability() && [[PAL::getUIApplicationClass() sharedApplication] _isClassic]) 133 133 return { 320, 480 }; 134 return FloatSize([[PAL::get _UIKit_UIScreenClass() mainScreen] _referenceBounds].size);134 return FloatSize([[PAL::getUIScreenClass() mainScreen] _referenceBounds].size); 135 135 } 136 136 137 137 FloatSize availableScreenSize() 138 138 { 139 if (deviceHasIPadCapability() && [[PAL::get _UIKit_UIApplicationClass() sharedApplication] _isClassic])139 if (deviceHasIPadCapability() && [[PAL::getUIApplicationClass() sharedApplication] _isClassic]) 140 140 return { 320, 480 }; 141 return FloatSize([PAL::get _UIKit_UIScreenClass() mainScreen].bounds.size);141 return FloatSize([PAL::getUIScreenClass() mainScreen].bounds.size); 142 142 } 143 143 … … 154 154 { 155 155 if (!screen) 156 screen = [PAL::get _UIKit_UIScreenClass() mainScreen];156 screen = [PAL::getUIScreenClass() mainScreen]; 157 157 158 158 return screen.scale; -
trunk/Source/WebKit/ChangeLog
r238468 r238470 1 2018-11-24 Andy Estes <aestes@apple.com> 2 3 [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function 4 https://bugs.webkit.org/show_bug.cgi?id=191899 5 6 Reviewed by Dean Jackson. 7 8 * Shared/cocoa/WebCoreArgumentCodersCocoa.mm: 9 * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: 10 * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: 11 1 12 2018-11-23 Antti Koivisto <antti@apple.com> 2 13 -
trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
r238434 r238470 56 56 auto unarchiver = secureUnarchiverFromData(data.get()); 57 57 @try { 58 PKPayment *pkPayment = [unarchiver decodeObjectOfClass:PAL::get _PassKit_PKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];58 PKPayment *pkPayment = [unarchiver decodeObjectOfClass:PAL::getPKPaymentClass() forKey:NSKeyedArchiveRootObjectKey]; 59 59 payment = Payment(pkPayment); 60 60 } @catch (NSException *exception) { … … 107 107 auto unarchiver = secureUnarchiverFromData(data.get()); 108 108 @try { 109 PKContact *pkContact = [unarchiver decodeObjectOfClass:PAL::get _PassKit_PKContactClass() forKey:NSKeyedArchiveRootObjectKey];109 PKContact *pkContact = [unarchiver decodeObjectOfClass:PAL::getPKContactClass() forKey:NSKeyedArchiveRootObjectKey]; 110 110 paymentContact = PaymentContact(pkContact); 111 111 } @catch (NSException *exception) { … … 164 164 auto unarchiver = secureUnarchiverFromData(data.get()); 165 165 @try { 166 PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:PAL::get _PassKit_PKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey];166 PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:PAL::getPKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey]; 167 167 paymentMerchantSession = PaymentMerchantSession(pkPaymentMerchantSession); 168 168 } @catch (NSException *exception) { … … 194 194 auto unarchiver = secureUnarchiverFromData(data.get()); 195 195 @try { 196 PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:PAL::get _PassKit_PKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];196 PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:PAL::getPKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey]; 197 197 paymentMethod = PaymentMethod(pkPaymentMethod); 198 198 } @catch (NSException *exception) { -
trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
r238434 r238470 85 85 _sessionBlock = sessionBlock; 86 86 87 [PAL::get _PassKit_PKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {87 [PAL::getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) { 88 88 if (error) 89 89 LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); … … 259 259 bool WebPaymentCoordinatorProxy::platformCanMakePayments() 260 260 { 261 return [PAL::get _PassKit_PKPaymentAuthorizationViewControllerClass() canMakePayments];261 return [PAL::getPKPaymentAuthorizationViewControllerClass() canMakePayments]; 262 262 } 263 263 … … 351 351 static RetainPtr<PKPaymentSummaryItem> toPKPaymentSummaryItem(const WebCore::ApplePaySessionPaymentRequest::LineItem& lineItem) 352 352 { 353 return [PAL::get _PassKit_PKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount) type:toPKPaymentSummaryItemType(lineItem.type)];353 return [PAL::getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount) type:toPKPaymentSummaryItemType(lineItem.type)]; 354 354 } 355 355 … … 410 410 static RetainPtr<PKShippingMethod> toPKShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod) 411 411 { 412 RetainPtr<PKShippingMethod> result = [PAL::get _PassKit_PKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:toDecimalNumber(shippingMethod.amount)];412 RetainPtr<PKShippingMethod> result = [PAL::getPKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:toDecimalNumber(shippingMethod.amount)]; 413 413 [result setIdentifier:shippingMethod.identifier]; 414 414 [result setDetail:shippingMethod.detail]; … … 799 799 Vector<String> WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks() 800 800 { 801 NSArray<PKPaymentNetwork> *availableNetworks = [PAL::get _PassKit_PKPaymentRequestClass() availableNetworks];801 NSArray<PKPaymentNetwork> *availableNetworks = [PAL::getPKPaymentRequestClass() availableNetworks]; 802 802 Vector<String> result; 803 803 result.reserveInitialCapacity(availableNetworks.count); -
trunk/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
r238434 r238470 42 42 auto showPaymentUIRequestSeed = m_showPaymentUIRequestSeed; 43 43 auto weakThis = makeWeakPtr(*this); 44 [PAL::get _PassKit_PKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:BlockPtr<void(PKPaymentAuthorizationViewController *, NSError *)>::fromCallable([paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler = WTFMove(completionHandler)](PKPaymentAuthorizationViewController *viewController, NSError *error) {44 [PAL::getPKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:BlockPtr<void(PKPaymentAuthorizationViewController *, NSError *)>::fromCallable([paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler = WTFMove(completionHandler)](PKPaymentAuthorizationViewController *viewController, NSError *error) { 45 45 auto paymentCoordinatorProxy = weakThis.get(); 46 46 if (!paymentCoordinatorProxy)
Note:
See TracChangeset
for help on using the changeset viewer.