Diff
Modified: trunk/Source/WebKit/ChangeLog (278534 => 278535)
--- trunk/Source/WebKit/ChangeLog 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/ChangeLog 2021-06-06 14:44:44 UTC (rev 278535)
@@ -1,3 +1,53 @@
+2021-06-06 David Kilzer <[email protected]>
+
+ Weak external symbols found in WebKit.framework with Release+Coverage configuration
+ <https://webkit.org/b/226668>
+ <rdar://problem/78890081>
+
+ Reviewed by Darin Adler.
+
+ * Configurations/WebKit.xcconfig:
+ (UNEXPORTED_SYMBOL_LDFLAGS):
+ - Remove std::function<> symbols as those were replaced
+ by WTF::Function<> a while ago.
+
+ * Shared/Cocoa/DefaultWebBrowserChecks.mm:
+ (WebKit::determineITPStateInternal):
+ (WebKit::doesParentProcessHaveITPEnabled):
+ - Switch to use TCCSoftLink.h.
+
+ * Shared/Cocoa/TCCSoftLink.h: Add.
+ * Shared/Cocoa/TCCSoftLink.mm: Add.
+ - Implement a single place for soft-linking to
+ TCC.framework.
+
+ * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
+ (WebKit::XPCServiceInitializerDelegate::getProcessIdentifier):
+ - Change ProcessIdentifier to WebCore::ProcessIdentifier
+ to fix the build since this source file no longer gets
+ `using namespace WebCore;` from another source file
+ after changes to SourcesCocoa.txt.
+
+ * SourcesCocoa.txt:
+ - Add DefaultWebBrowserChecks.mm since it no longer
+ contains any SOFT_LINK macros.
+ - Add new TCCSoftLink.mm file.
+
+ * UIProcess/Cocoa/MediaPermissionUtilities.mm:
+ (WebKit::checkUsageDescriptionStringForType):
+ * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
+ (WebKit::WebProcessProxy::isAXAuthenticated):
+ * UIProcess/ios/WKActionSheetAssistant.mm:
+ (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
+ (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
+ - Switch to use TCCSoftLink.h.
+
+ * WebKit.xcodeproj/project.pbxproj:
+ - Add TCCSoftLink.{h,mm} to the project.
+ - Remove DefaultWebBrowserChecks.mm from the
+ WebKit.framework target after adding it to
+ SourcesCocoa.txt.
+
2021-06-05 Chris Dumez <[email protected]>
Use `const uint8_t*` type more consistently to store bytes in WebKit
Modified: trunk/Source/WebKit/Configurations/WebKit.xcconfig (278534 => 278535)
--- trunk/Source/WebKit/Configurations/WebKit.xcconfig 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/Configurations/WebKit.xcconfig 2021-06-06 14:44:44 UTC (rev 278535)
@@ -146,7 +146,7 @@
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 -framework Metal $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_BACKBOARD_SERVICES_LDFLAGS) $(WK_RUNNINGBOARD_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CONTACTS_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBNETWORKEXTENSION_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_UNIFORM_TYPE_IDENTIFIERS_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS) $(WK_COORDINATOR_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__18functionIFvN7WebCore12PolicyActionEEED1Ev -Wl,-u
nexported_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_traitsIcEENS_9allocato
rIcEEEE8_NS_13basic_ostreamIcS2_EE;
+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,__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_traitsIcEENS_9allocatorIcEEEE8_NS_13basic_ostreamIcS2_EE;
LIBWEBRTC_LIBRARY_DIR = $(LIBWEBRTC_LIBRARY_DIR_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH));
LIBWEBRTC_LIBRARY_DIR_COCOA_TOUCH_YES = $(WEBCORE_FRAMEWORKS_DIR)/WebCore.framework/Frameworks
Modified: trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm (278534 => 278535)
--- trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm 2021-06-06 14:44:44 UTC (rev 278535)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,7 +29,7 @@
#import "AuxiliaryProcess.h"
#import "Connection.h"
#import "Logging.h"
-#import "TCCSPI.h"
+#import "TCCSoftLink.h"
#import <WebCore/RegistrableDomain.h>
#import <WebCore/RuntimeApplicationChecks.h>
#import <WebCore/VersionChecks.h>
@@ -37,17 +37,10 @@
#import <wtf/NeverDestroyed.h>
#import <wtf/RobinHoodHashMap.h>
#import <wtf/RunLoop.h>
-#import <wtf/SoftLinking.h>
#import <wtf/WorkQueue.h>
#import <wtf/cocoa/Entitlements.h>
#import <wtf/text/StringHash.h>
-SOFT_LINK_PRIVATE_FRAMEWORK(TCC)
-SOFT_LINK(TCC, TCCAccessPreflight, TCCAccessPreflightResult, (CFStringRef service, CFDictionaryRef options), (service, options))
-SOFT_LINK(TCC, TCCAccessPreflightWithAuditToken, TCCAccessPreflightResult, (CFStringRef service, audit_token_t token, CFDictionaryRef options), (service, token, options))
-SOFT_LINK_CONSTANT(TCC, kTCCServiceWebKitIntelligentTrackingPrevention, CFStringRef)
-
-
namespace WebKit {
static bool isFullWebBrowser(const String&);
@@ -119,7 +112,7 @@
TCCAccessPreflightResult result = kTCCAccessPreflightDenied;
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
- result = TCCAccessPreflight(getkTCCServiceWebKitIntelligentTrackingPrevention(), nullptr);
+ result = TCCAccessPreflight(get_TCC_kTCCServiceWebKitIntelligentTrackingPrevention(), nullptr);
#endif
return result != kTCCAccessPreflightDenied;
}
@@ -185,7 +178,7 @@
RELEASE_LOG_ERROR(IPC, "Unable to get parent process audit token");
return;
}
- result = TCCAccessPreflightWithAuditToken(getkTCCServiceWebKitIntelligentTrackingPrevention(), auditToken.value(), nullptr);
+ result = TCCAccessPreflightWithAuditToken(get_TCC_kTCCServiceWebKitIntelligentTrackingPrevention(), auditToken.value(), nullptr);
#endif
itpEnabled = result != kTCCAccessPreflightDenied;
});
Added: trunk/Source/WebKit/Shared/Cocoa/TCCSoftLink.h (0 => 278535)
--- trunk/Source/WebKit/Shared/Cocoa/TCCSoftLink.h (rev 0)
+++ trunk/Source/WebKit/Shared/Cocoa/TCCSoftLink.h 2021-06-06 14:44:44 UTC (rev 278535)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#import "TCCSPI.h"
+
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(WebKit, TCC)
+
+SOFT_LINK_CONSTANT_FOR_HEADER(WebKit, TCC, kTCCServiceAccessibility, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_HEADER(WebKit, TCC, kTCCServiceCamera, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_HEADER(WebKit, TCC, kTCCServiceMicrophone, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_HEADER(WebKit, TCC, kTCCServicePhotos, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_HEADER(WebKit, TCC, kTCCServiceWebKitIntelligentTrackingPrevention, CFStringRef)
+
+SOFT_LINK_FUNCTION_FOR_HEADER(WebKit, TCC, TCCAccessCheckAuditToken, Boolean, (CFStringRef service, audit_token_t auditToken, CFDictionaryRef options), (service, auditToken, options))
+#define TCCAccessCheckAuditToken WebKit::softLink_TCC_TCCAccessCheckAuditToken
+SOFT_LINK_FUNCTION_FOR_HEADER(WebKit, TCC, TCCAccessPreflight, TCCAccessPreflightResult, (CFStringRef service, CFDictionaryRef options), (service, options))
+#define TCCAccessPreflight WebKit::softLink_TCC_TCCAccessPreflight
+SOFT_LINK_FUNCTION_FOR_HEADER(WebKit, TCC, TCCAccessPreflightWithAuditToken, TCCAccessPreflightResult, (CFStringRef service, audit_token_t token, CFDictionaryRef options), (service, token, options))
+#define TCCAccessPreflightWithAuditToken WebKit::softLink_TCC_TCCAccessPreflightWithAuditToken
Added: trunk/Source/WebKit/Shared/Cocoa/TCCSoftLink.mm (0 => 278535)
--- trunk/Source/WebKit/Shared/Cocoa/TCCSoftLink.mm (rev 0)
+++ trunk/Source/WebKit/Shared/Cocoa/TCCSoftLink.mm 2021-06-06 14:44:44 UTC (rev 278535)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#import "TCCSPI.h"
+
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(WebKit, TCC)
+
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebKit, TCC, kTCCServiceAccessibility, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebKit, TCC, kTCCServiceCamera, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebKit, TCC, kTCCServiceMicrophone, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebKit, TCC, kTCCServicePhotos, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebKit, TCC, kTCCServiceWebKitIntelligentTrackingPrevention, CFStringRef)
+
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebKit, TCC, TCCAccessCheckAuditToken, Boolean, (CFStringRef service, audit_token_t auditToken, CFDictionaryRef options), (service, auditToken, options))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebKit, TCC, TCCAccessPreflight, TCCAccessPreflightResult, (CFStringRef service, CFDictionaryRef options), (service, options))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebKit, TCC, TCCAccessPreflightWithAuditToken, TCCAccessPreflightResult, (CFStringRef service, audit_token_t token, CFDictionaryRef options), (service, token, options))
Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm (278534 => 278535)
--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm 2021-06-06 14:44:44 UTC (rev 278535)
@@ -88,13 +88,13 @@
return version.has_value();
}
-bool XPCServiceInitializerDelegate::getProcessIdentifier(ProcessIdentifier& identifier)
+bool XPCServiceInitializerDelegate::getProcessIdentifier(WebCore::ProcessIdentifier& identifier)
{
auto parsedIdentifier = parseInteger<uint64_t>(xpc_dictionary_get_string(m_initializerMessage, "process-identifier"));
if (!parsedIdentifier)
return false;
- identifier = makeObjectIdentifier<ProcessIdentifierType>(*parsedIdentifier);
+ identifier = makeObjectIdentifier<WebCore::ProcessIdentifierType>(*parsedIdentifier);
return true;
}
Modified: trunk/Source/WebKit/SourcesCocoa.txt (278534 => 278535)
--- trunk/Source/WebKit/SourcesCocoa.txt 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/SourcesCocoa.txt 2021-06-06 14:44:44 UTC (rev 278535)
@@ -161,6 +161,7 @@
Shared/Cocoa/CompletionHandlerCallChecker.mm
Shared/Cocoa/CoreTextHelpers.mm
Shared/Cocoa/DataDetectionResult.mm
+Shared/Cocoa/DefaultWebBrowserChecks.mm
Shared/Cocoa/InsertTextOptions.cpp
Shared/Cocoa/LoadParametersCocoa.mm
Shared/Cocoa/PDFKitSoftLink.mm
@@ -168,6 +169,7 @@
Shared/Cocoa/SandboxInitialiationParametersCocoa.mm
Shared/Cocoa/SandboxUtilities.mm
Shared/Cocoa/SharedRingBufferStorage.cpp
+Shared/Cocoa/TCCSoftLink.mm
Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
Shared/Cocoa/WebErrorsCocoa.mm
Shared/Cocoa/WebKit2InitializeCocoa.mm
Modified: trunk/Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm (278534 => 278535)
--- trunk/Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm 2021-06-06 14:44:44 UTC (rev 278535)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,26 +27,19 @@
#import "MediaPermissionUtilities.h"
#import "SandboxUtilities.h"
-#import "TCCSPI.h"
+#import "TCCSoftLink.h"
#import "WKWebViewInternal.h"
#import "WebPageProxy.h"
#import <WebCore/LocalizedStrings.h>
#import <WebCore/SecurityOriginData.h>
#import <mutex>
+#import <pal/cocoa/AVFoundationSoftLink.h>
+#import <pal/cocoa/SpeechSoftLink.h>
#import <wtf/BlockPtr.h>
-#import <wtf/SoftLinking.h>
#import <wtf/URLHelpers.h>
#import <wtf/spi/cf/CFBundleSPI.h>
#import <wtf/spi/darwin/SandboxSPI.h>
-#import <pal/cocoa/AVFoundationSoftLink.h>
-#import <pal/cocoa/SpeechSoftLink.h>
-
-SOFT_LINK_PRIVATE_FRAMEWORK(TCC)
-SOFT_LINK(TCC, TCCAccessPreflight, TCCAccessPreflightResult, (CFStringRef service, CFDictionaryRef options), (service, options))
-SOFT_LINK_CONSTANT(TCC, kTCCServiceMicrophone, CFStringRef)
-SOFT_LINK_CONSTANT(TCC, kTCCServiceCamera, CFStringRef)
-
namespace WebKit {
bool checkSandboxRequirementForType(MediaPermissionType type)
@@ -88,7 +81,7 @@
switch (type) {
case MediaPermissionType::Audio:
- static TCCAccessPreflightResult audioAccess = TCCAccessPreflight(getkTCCServiceMicrophone(), NULL);
+ static TCCAccessPreflightResult audioAccess = TCCAccessPreflight(get_TCC_kTCCServiceMicrophone(), NULL);
if (audioAccess == kTCCAccessPreflightGranted)
return true;
std::call_once(audioDescriptionFlag, [] {
@@ -96,7 +89,7 @@
});
return hasMicrophoneDescriptionString;
case MediaPermissionType::Video:
- static TCCAccessPreflightResult videoAccess = TCCAccessPreflight(getkTCCServiceCamera(), NULL);
+ static TCCAccessPreflightResult videoAccess = TCCAccessPreflight(get_TCC_kTCCServiceCamera(), NULL);
if (videoAccess == kTCCAccessPreflightGranted)
return true;
std::call_once(videoDescriptionFlag, [] {
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm (278534 => 278535)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm 2021-06-06 14:44:44 UTC (rev 278535)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,6 +37,7 @@
#import "WKTypeRefWrapper.h"
#import "WebProcessMessages.h"
#import "WebProcessPool.h"
+#import <pal/cf/AudioToolboxSoftLink.h>
#import <sys/sysctl.h>
#import <wtf/NeverDestroyed.h>
#import <wtf/Scope.h>
@@ -52,15 +53,9 @@
#endif
#if PLATFORM(MAC)
-#import <wtf/SoftLinking.h>
-
-SOFT_LINK_PRIVATE_FRAMEWORK(TCC)
-SOFT_LINK(TCC, TCCAccessCheckAuditToken, Boolean, (CFStringRef service, audit_token_t auditToken, CFDictionaryRef options), (service, auditToken, options))
-SOFT_LINK_CONSTANT(TCC, kTCCServiceAccessibility, CFStringRef)
+#include "TCCSoftLink.h"
#endif
-#import <pal/cf/AudioToolboxSoftLink.h>
-
namespace WebKit {
static const Seconds unexpectedActivityDuration = 10_s;
@@ -279,7 +274,7 @@
#if PLATFORM(MAC)
void WebProcessProxy::isAXAuthenticated(audit_token_t auditToken, CompletionHandler<void(bool)>&& completionHandler)
{
- auto authenticated = TCCAccessCheckAuditToken(getkTCCServiceAccessibility(), auditToken, nullptr);
+ auto authenticated = TCCAccessCheckAuditToken(get_TCC_kTCCServiceAccessibility(), auditToken, nullptr);
completionHandler(authenticated);
}
#endif
Modified: trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm (278534 => 278535)
--- trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm 2021-06-06 14:44:44 UTC (rev 278535)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,7 +29,7 @@
#if PLATFORM(IOS_FAMILY)
#import "APIUIClient.h"
-#import "TCCSPI.h"
+#import "TCCSoftLink.h"
#import "UIKitSPI.h"
#import "WKActionSheet.h"
#import "WKContentViewInteraction.h"
@@ -64,10 +64,6 @@
OBJC_CLASS DDAction;
-SOFT_LINK_PRIVATE_FRAMEWORK(TCC)
-SOFT_LINK(TCC, TCCAccessPreflight, TCCAccessPreflightResult, (CFStringRef service, CFDictionaryRef options), (service, options))
-SOFT_LINK_CONSTANT(TCC, kTCCServicePhotos, CFStringRef)
-
#if HAVE(APP_LINKS)
static bool applicationHasAppLinkEntitlements()
{
@@ -563,7 +559,7 @@
#endif
if ([elementInfo imageURL]) {
- if (TCCAccessPreflight(getkTCCServicePhotos(), NULL) != kTCCAccessPreflightDenied)
+ if (TCCAccessPreflight(WebKit::get_TCC_kTCCServicePhotos(), NULL) != kTCCAccessPreflightDenied)
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeSaveImage assistant:self]];
}
@@ -599,7 +595,7 @@
if ([getSSReadingListClass() supportsURL:targetURL])
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeAddToReadingList assistant:self]];
#endif
- if (TCCAccessPreflight(getkTCCServicePhotos(), NULL) != kTCCAccessPreflightDenied)
+ if (TCCAccessPreflight(WebKit::get_TCC_kTCCServicePhotos(), NULL) != kTCCAccessPreflightDenied)
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeSaveImage assistant:self]];
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeCopy assistant:self]];
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (278534 => 278535)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2021-06-06 14:41:05 UTC (rev 278534)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2021-06-06 14:44:44 UTC (rev 278535)
@@ -958,6 +958,7 @@
449316A325DC7DC400AA66DE /* _WKAppHighlight.h in Headers */ = {isa = PBXBuildFile; fileRef = 449316A125DC7DC300AA66DE /* _WKAppHighlight.h */; settings = {ATTRIBUTES = (Private, ); }; };
449316A625DC9D0000AA66DE /* _WKAppHighlightInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 449316A525DC9D0000AA66DE /* _WKAppHighlightInternal.h */; };
449D90DA21FDC30B00F677C0 /* LocalAuthenticationSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 449D90D821FD63FE00F677C0 /* LocalAuthenticationSoftLink.mm */; };
+ 44C51844266BE8C4006DD522 /* TCCSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C51842266BE8C3006DD522 /* TCCSoftLink.h */; };
44E936FD2447C2D8009FA3E3 /* LegacyCustomProtocolID.h in Headers */ = {isa = PBXBuildFile; fileRef = 44E936FC2447C256009FA3E3 /* LegacyCustomProtocolID.h */; };
44EC3EA9247F5C090059489C /* _WKDragActionsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 44EC3EA8247F5C080059489C /* _WKDragActionsInternal.h */; };
46088A00261FA8BC00E2500D /* RemoteRenderingBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 550640A324071A6100AAE045 /* RemoteRenderingBackend.h */; };
@@ -991,7 +992,6 @@
49BCA19223A177660028A836 /* APIResourceLoadStatisticsFirstParty.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19123A177660028A836 /* APIResourceLoadStatisticsFirstParty.h */; };
49BCA19523A18CFD0028A836 /* _WKResourceLoadStatisticsFirstPartyInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19023A175490028A836 /* _WKResourceLoadStatisticsFirstPartyInternal.h */; };
49BCA19723A1930D0028A836 /* APIResourceLoadStatisticsThirdParty.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19623A18F620028A836 /* APIResourceLoadStatisticsThirdParty.h */; };
- 49DAA38C24CBA1A800793D75 /* DefaultWebBrowserChecks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49DAA38B24CBA1A800793D75 /* DefaultWebBrowserChecks.mm */; };
49ECA41C23FCA5D80023358D /* PolicyDecision.h in Headers */ = {isa = PBXBuildFile; fileRef = 49ECA41B23FCA4860023358D /* PolicyDecision.h */; };
49FBEFFD239B011D00BD032F /* _WKResourceLoadStatisticsFirstParty.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FBEFFC239B011D00BD032F /* _WKResourceLoadStatisticsFirstParty.mm */; };
49FBEFFF239B012F00BD032F /* _WKResourceLoadStatisticsThirdParty.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FBEFFE239B012F00BD032F /* _WKResourceLoadStatisticsThirdParty.mm */; };
@@ -3881,6 +3881,8 @@
449316A525DC9D0000AA66DE /* _WKAppHighlightInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKAppHighlightInternal.h; sourceTree = "<group>"; };
449D90D821FD63FE00F677C0 /* LocalAuthenticationSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalAuthenticationSoftLink.mm; sourceTree = "<group>"; };
44A481C621F2D27B00F2F919 /* ClientCertificateAuthenticationXPCConstants.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ClientCertificateAuthenticationXPCConstants.cpp; sourceTree = "<group>"; };
+ 44C51842266BE8C3006DD522 /* TCCSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TCCSoftLink.h; sourceTree = "<group>"; };
+ 44C51843266BE8C3006DD522 /* TCCSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TCCSoftLink.mm; sourceTree = "<group>"; };
44E936FC2447C256009FA3E3 /* LegacyCustomProtocolID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCustomProtocolID.h; sourceTree = "<group>"; };
44EC3EA8247F5C080059489C /* _WKDragActionsInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDragActionsInternal.h; sourceTree = "<group>"; };
4603011A234BE31D009C8217 /* WebBackForwardCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebBackForwardCache.cpp; sourceTree = "<group>"; };
@@ -8279,6 +8281,8 @@
7AB4EA42227780DD0085BBAA /* SandboxUtilities.mm */,
CD4B4D9A1E765E0000D27092 /* SharedRingBufferStorage.cpp */,
CD4B4D9B1E765E0000D27092 /* SharedRingBufferStorage.h */,
+ 44C51842266BE8C3006DD522 /* TCCSoftLink.h */,
+ 44C51843266BE8C3006DD522 /* TCCSoftLink.mm */,
1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */,
7AF236221E79A43100438A05 /* WebErrorsCocoa.mm */,
465250E51ECF52CD002025CB /* WebKit2InitializeCocoa.mm */,
@@ -12324,6 +12328,7 @@
57FD318622B3516C008D0E8B /* SubFrameSOAuthorizationSession.h in Headers */,
4459984222833E8700E61373 /* SyntheticEditingCommandType.h in Headers */,
3157135F2040A9B20084F9CF /* SystemPreviewController.h in Headers */,
+ 44C51844266BE8C4006DD522 /* TCCSoftLink.h in Headers */,
CE1A0BD61A48E6C60054EF74 /* TCCSPI.h in Headers */,
1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */,
53CFBBC82224D1B500266546 /* TextCheckerCompletion.h in Headers */,
@@ -14128,7 +14133,6 @@
BCE579A72634836700F5C5E9 /* CGDisplayListImageBufferBackend.cpp in Sources */,
2D92A77D212B6A7100F493FD /* Connection.cpp in Sources */,
2D92A77F212B6A7100F493FD /* Decoder.cpp in Sources */,
- 49DAA38C24CBA1A800793D75 /* DefaultWebBrowserChecks.mm in Sources */,
2D0C56FE229F1DEA00BD33E7 /* DeviceManagementSoftLink.mm in Sources */,
1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */,
1A64229912DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp in Sources */,