Title: [269109] trunk/Source/WebKit
Revision
269109
Author
[email protected]
Date
2020-10-28 10:41:12 -0700 (Wed, 28 Oct 2020)

Log Message

[Cocoa] Remove soft linking of Contacts.framework
https://bugs.webkit.org/show_bug.cgi?id=218289

Reviewed by Geoff Garen.

Since Contacts.framework does not depend on WebKit and soft linking is
discouraged, WebKit should link Contacts.framework normally.

Soft linking requires running the linker at runtime, leading to an
unwanted performance cost. By normally linking (on iOS) and weak linking
(on macOS), the linkage is declared at build time, which enables running
the linker at build/update/install time and avoiding the runtime cost.

* Configurations/WebKit.xcconfig:

On macOS, weak link the framework since Contacts.framework is not
available on the Base System.

* Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::toNSError):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (269108 => 269109)


--- trunk/Source/WebKit/ChangeLog	2020-10-28 17:40:03 UTC (rev 269108)
+++ trunk/Source/WebKit/ChangeLog	2020-10-28 17:41:12 UTC (rev 269109)
@@ -1,3 +1,26 @@
+2020-10-28  Aditya Keerthi  <[email protected]>
+
+        [Cocoa] Remove soft linking of Contacts.framework
+        https://bugs.webkit.org/show_bug.cgi?id=218289
+
+        Reviewed by Geoff Garen.
+
+        Since Contacts.framework does not depend on WebKit and soft linking is
+        discouraged, WebKit should link Contacts.framework normally.
+
+        Soft linking requires running the linker at runtime, leading to an
+        unwanted performance cost. By normally linking (on iOS) and weak linking
+        (on macOS), the linkage is declared at build time, which enables running
+        the linker at build/update/install time and avoiding the runtime cost.
+
+        * Configurations/WebKit.xcconfig:
+
+        On macOS, weak link the framework since Contacts.framework is not
+        available on the Base System.
+
+        * Platform/cocoa/PaymentAuthorizationPresenter.mm:
+        (WebKit::toNSError):
+
 2020-10-28  Adrian Perez de Castro  <[email protected]>
 
         [GTK4] Build broken with GTK 3.99.3

Modified: trunk/Source/WebKit/Configurations/WebKit.xcconfig (269108 => 269109)


--- trunk/Source/WebKit/Configurations/WebKit.xcconfig	2020-10-28 17:40:03 UTC (rev 269108)
+++ trunk/Source/WebKit/Configurations/WebKit.xcconfig	2020-10-28 17:41:12 UTC (rev 269109)
@@ -53,6 +53,11 @@
 WK_BACKBOARD_SERVICES_LDFLAGS_iphoneos = -framework BackBoardServices;
 WK_BACKBOARD_SERVICES_LDFLAGS_iphonesimulator = -framework BackBoardServices;
 
+WK_CONTACTS_LDFLAGS = $(WK_CONTACTS_LDFLAGS_$(WK_PLATFORM_NAME));
+WK_CONTACTS_LDFLAGS_iphoneos = -framework Contacts;
+WK_CONTACTS_LDFLAGS_iphonesimulator = -framework Contacts;
+WK_CONTACTS_LDFLAGS_macosx = -weak_framework Contacts;
+
 WK_RUNNINGBOARD_SERVICES_LDFLAGS = $(WK_RUNNINGBOARD_SERVICES_LDFLAGS_$(WK_COCOA_TOUCH));
 WK_RUNNINGBOARD_SERVICES_LDFLAGS_cocoatouch = -framework RunningBoardServices;
 
@@ -118,7 +123,7 @@
 WK_AUTHKIT_LDFLAGS_macosx = $(WK_AUTHKIT_LDFLAGS$(WK_MACOS_1015));
 WK_AUTHKIT_LDFLAGS_MACOS_SINCE_1015 = -framework AuthKit;
 
-FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework IOSurface -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_BACKBOARD_SERVICES_LDFLAGS) $(WK_RUNNINGBOARD_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS);
+FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework IOSurface -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_BACKBOARD_SERVICES_LDFLAGS) $(WK_CONTACTS_LDFLAGS) $(WK_RUNNINGBOARD_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS);
 
 // Prevent C++ standard library basic_stringstream, operator new, delete and their related exception types from being exported as weak symbols.
 UNEXPORTED_SYMBOL_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-unexported_symbol -Wl,__Znwm -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2EOS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1EOS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSEDn -Wl,-unexported_symbol -Wl,__ZNKSt3__18functionIFvN7WebCore12PolicyActionEEEclES2_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEE4swapERS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1ERKS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2ERKS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEE
 ED1Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEED2Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSERKS4_ -Wl,-unexported_symbol -Wl,__ZTVNSt3__117bad_function_callE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE -Wl,-unexported_symbol -Wl,__ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE -Wl,-unexported_symbol -Wl,__ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE -Wl,-unexported_symbol -Wl,__ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEE
 NS_9allocatorIcEEEE8_NS_13basic_ostreamIcS2_EE;

Modified: trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.mm (269108 => 269109)


--- trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.mm	2020-10-28 17:40:03 UTC (rev 269108)
+++ trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.mm	2020-10-28 17:41:12 UTC (rev 269109)
@@ -38,16 +38,6 @@
 
 #import <pal/cocoa/PassKitSoftLink.h>
 
-SOFT_LINK_FRAMEWORK(Contacts);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCityKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCountryKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressISOCountryCodeKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressPostalCodeKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStateKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStreetKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubAdministrativeAreaKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubLocalityKey, NSString *);
-
 namespace WebKit {
 
 // FIXME: Rather than having these free functions scattered about, Apple Pay data types should know
@@ -115,42 +105,42 @@
             
         case WebCore::PaymentError::ContactField::AddressLines:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressStreetKey();
+            postalAddressKey = CNPostalAddressStreetKey;
             break;
             
         case WebCore::PaymentError::ContactField::SubLocality:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressSubLocalityKey();
+            postalAddressKey = CNPostalAddressSubLocalityKey;
             break;
             
         case WebCore::PaymentError::ContactField::Locality:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressCityKey();
+            postalAddressKey = CNPostalAddressCityKey;
             break;
             
         case WebCore::PaymentError::ContactField::PostalCode:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressPostalCodeKey();
+            postalAddressKey = CNPostalAddressPostalCodeKey;
             break;
             
         case WebCore::PaymentError::ContactField::SubAdministrativeArea:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressSubAdministrativeAreaKey();
+            postalAddressKey = CNPostalAddressSubAdministrativeAreaKey;
             break;
             
         case WebCore::PaymentError::ContactField::AdministrativeArea:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressStateKey();
+            postalAddressKey = CNPostalAddressStateKey;
             break;
             
         case WebCore::PaymentError::ContactField::Country:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressCountryKey();
+            postalAddressKey = CNPostalAddressCountryKey;
             break;
             
         case WebCore::PaymentError::ContactField::CountryCode:
             pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressISOCountryCodeKey();
+            postalAddressKey = CNPostalAddressISOCountryCodeKey;
             break;
         }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to