Diff
Modified: trunk/Source/WebKit/ChangeLog (287594 => 287595)
--- trunk/Source/WebKit/ChangeLog 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Source/WebKit/ChangeLog 2022-01-05 00:19:20 UTC (rev 287595)
@@ -1,3 +1,16 @@
+2022-01-04 Ryan Haddad <[email protected]>
+
+ Unreviewed, reverting r287374.
+
+ Caused assertion failures on Monterey
+
+ Reverted changeset:
+
+ "Re-enable CustomDisplayName and DefaultDisplayName API tests
+ on Monterey"
+ https://bugs.webkit.org/show_bug.cgi?id=234613
+ https://commits.webkit.org/r287374
+
2022-01-04 Simon Fraser <[email protected]>
"canceled" wheel events to non-zero deltas cause scrolling jumps in PDFs and CodeMirror
Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (287594 => 287595)
--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h 2022-01-05 00:19:20 UTC (rev 287595)
@@ -274,7 +274,6 @@
#if PLATFORM(MAC)
void updateActivePages(const String& name, const Vector<String>& activePagesOrigins, audit_token_t);
- void getProcessDisplayName(audit_token_t, CompletionHandler<void(const String&)>&&);
#endif
#if USE(LIBWEBRTC)
@@ -408,9 +407,6 @@
#if ENABLE(APPLE_PAY_REMOTE_UI)
std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
#endif
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)
- String m_processDisplayName;
-#endif
const WebCore::ProcessIdentifier m_webProcessIdentifier;
HashSet<WebCore::MessagePortIdentifier> m_processEntangledPorts;
Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (287594 => 287595)
--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2022-01-05 00:19:20 UTC (rev 287595)
@@ -105,7 +105,6 @@
RegisterURLSchemesAsCORSEnabled(Vector<String> schemes);
SetCORSDisablingPatterns(WebCore::PageIdentifier pageIdentifier, Vector<String> patterns)
#if PLATFORM(MAC)
- GetProcessDisplayName(audit_token_t auditToken) -> (String displayName) Async
UpdateActivePages(String name, Vector<String> activePagesOrigins, audit_token_t auditToken)
#endif
SetResourceLoadSchedulingMode(WebCore::PageIdentifier webPageID, enum:uint8_t WebCore::LoadSchedulingMode mode)
Modified: trunk/Source/WebKit/NetworkProcess/mac/NetworkConnectionToWebProcessMac.mm (287594 => 287595)
--- trunk/Source/WebKit/NetworkProcess/mac/NetworkConnectionToWebProcessMac.mm 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Source/WebKit/NetworkProcess/mac/NetworkConnectionToWebProcessMac.mm 2022-01-05 00:19:20 UTC (rev 287595)
@@ -32,34 +32,14 @@
namespace WebKit {
#if PLATFORM(MAC)
-
void NetworkConnectionToWebProcess::updateActivePages(const String& overrideDisplayName, const Vector<String>& activePagesOrigins, audit_token_t auditToken)
{
-#if USE(APPLE_INTERNAL_SDK)
auto asn = adoptCF(_LSCopyLSASNForAuditToken(kLSDefaultSessionID, auditToken));
if (!overrideDisplayName)
_LSSetApplicationInformationItem(kLSDefaultSessionID, asn.get(), CFSTR("LSActivePageUserVisibleOriginsKey"), (__bridge CFArrayRef)createNSArray(activePagesOrigins).get(), nullptr);
else
_LSSetApplicationInformationItem(kLSDefaultSessionID, asn.get(), _kLSDisplayNameKey, overrideDisplayName.createCFString().get(), nullptr);
-#else
- // Setting and getting the display name of another process requires a private entitlement.
- if (!!overrideDisplayName)
- m_processDisplayName = overrideDisplayName;
- UNUSED_PARAM(activePagesOrigins);
- UNUSED_PARAM(auditToken);
-#endif
}
-
-void NetworkConnectionToWebProcess::getProcessDisplayName(audit_token_t auditToken, CompletionHandler<void(const String&)>&& completionHandler)
-{
-#if USE(APPLE_INTERNAL_SDK)
- auto asn = adoptCF(_LSCopyLSASNForAuditToken(kLSDefaultSessionID, auditToken));
- return completionHandler(adoptCF((CFStringRef)_LSCopyApplicationInformationItem(kLSDefaultSessionID, asn.get(), _kLSDisplayNameKey)).get());
-#else
- completionHandler(m_processDisplayName);
#endif
-}
-#endif // PLATFORM(MAC)
-
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (287594 => 287595)
--- trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2022-01-05 00:19:20 UTC (rev 287595)
@@ -341,11 +341,7 @@
void WebPage::getProcessDisplayName(CompletionHandler<void(String&&)>&& completionHandler)
{
#if PLATFORM(MAC)
-#if ENABLE(SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS)
- WebProcess::singleton().getProcessDisplayName(WTFMove(completionHandler));
-#else
completionHandler(adoptCF((CFStringRef)_LSCopyApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSDisplayNameKey)).get());
-#endif
#else
completionHandler({ });
#endif
Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (287594 => 287595)
--- trunk/Source/WebKit/WebProcess/WebProcess.h 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h 2022-01-05 00:19:20 UTC (rev 287595)
@@ -294,8 +294,6 @@
#if PLATFORM(COCOA)
RetainPtr<CFDataRef> sourceApplicationAuditData() const;
void destroyRenderingResources();
- void getProcessDisplayName(CompletionHandler<void(String&&)>&&);
- std::optional<audit_token_t> auditTokenForSelf();
#endif
const String& uiProcessBundleIdentifier() const { return m_uiProcessBundleIdentifier; }
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (287594 => 287595)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2022-01-05 00:19:20 UTC (rev 287595)
@@ -479,18 +479,6 @@
#endif
}
-std::optional<audit_token_t> WebProcess::auditTokenForSelf()
-{
- audit_token_t auditToken = { 0 };
- mach_msg_type_number_t info_size = TASK_AUDIT_TOKEN_COUNT;
- kern_return_t kr = task_info(mach_task_self(), TASK_AUDIT_TOKEN, reinterpret_cast<integer_t *>(&auditToken), &info_size);
- if (kr != KERN_SUCCESS) {
- WEBPROCESS_RELEASE_LOG_ERROR(Process, "Unable to get audit token for self. Error: %{public}s (%x)", mach_error_string(kr), kr);
- return std::nullopt;
- }
- return auditToken;
-}
-
void WebProcess::updateProcessName(IsInProcessInitialization isInProcessInitialization)
{
#if PLATFORM(MAC)
@@ -514,24 +502,19 @@
}
#if ENABLE(SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS)
-#if USE(APPLE_INTERNAL_SDK)
// During WebProcess initialization, we are still able to talk to LaunchServices to set the process name so there is no need to go
// via the NetworkProcess. Prewarmed WebProcesses also do not have a network process connection until they are actually used by
// a page.
- bool sendToNetworkProcess = isInProcessInitialization == IsInProcessInitialization::No;
-#else
- // The web process can't read its display name from LaunchServices,
- // and without an internal entitlement the network process can't read on behalf of the web process,
- // so use state in memory in the network process to simulate LaunchServices state.
- bool sendToNetworkProcess = true;
-#endif
-
- if (sendToNetworkProcess) {
- auto auditToken = auditTokenForSelf();
- if (!auditToken)
+ if (isInProcessInitialization == IsInProcessInitialization::No) {
+ audit_token_t auditToken = { 0 };
+ mach_msg_type_number_t info_size = TASK_AUDIT_TOKEN_COUNT;
+ kern_return_t kr = task_info(mach_task_self(), TASK_AUDIT_TOKEN, reinterpret_cast<integer_t *>(&auditToken), &info_size);
+ if (kr != KERN_SUCCESS) {
+ WEBPROCESS_RELEASE_LOG_ERROR(Process, "updateProcessName: Unable to get audit token for self. Error: %{public}s (%x)", mach_error_string(kr), kr);
return;
+ }
String displayName = applicationName.get();
- ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(displayName, Vector<String>(), *auditToken), 0);
+ ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(displayName, Vector<String>(), auditToken), 0);
return;
}
#endif // ENABLE(SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS)
@@ -749,26 +732,19 @@
}
#endif
-void WebProcess::getProcessDisplayName(CompletionHandler<void(String&&)>&& completionHandler)
-{
-#if PLATFORM(MAC)
- auto auditToken = auditTokenForSelf();
- if (!auditToken)
- return completionHandler({ });
- ensureNetworkProcessConnection().connection().sendWithAsyncReply(Messages::NetworkConnectionToWebProcess::GetProcessDisplayName(*auditToken), WTFMove(completionHandler));
-#else
- completionHandler({ });
-#endif
-}
-
void WebProcess::updateActivePages(const String& overrideDisplayName)
{
#if PLATFORM(MAC)
#if ENABLE(SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS)
- auto auditToken = auditTokenForSelf();
- if (!auditToken)
+ audit_token_t auditToken = { 0 };
+ mach_msg_type_number_t info_size = TASK_AUDIT_TOKEN_COUNT;
+ kern_return_t kr = task_info(mach_task_self(), TASK_AUDIT_TOKEN, reinterpret_cast<integer_t *>(&auditToken), &info_size);
+ if (kr != KERN_SUCCESS) {
+ WEBPROCESS_RELEASE_LOG_ERROR(Process, "updateActivePages: Unable to get audit token for self. Error: %{public}s (%x)", mach_error_string(kr), kr);
return;
- ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(overrideDisplayName, activePagesOrigins(m_pageMap), *auditToken), 0);
+ }
+
+ ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(overrideDisplayName, activePagesOrigins(m_pageMap), auditToken), 0);
#else
if (!overrideDisplayName) {
RunLoop::main().dispatch([activeOrigins = activePagesOrigins(m_pageMap)] {
Modified: trunk/Tools/ChangeLog (287594 => 287595)
--- trunk/Tools/ChangeLog 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Tools/ChangeLog 2022-01-05 00:19:20 UTC (rev 287595)
@@ -1,3 +1,16 @@
+2022-01-04 Ryan Haddad <[email protected]>
+
+ Unreviewed, reverting r287374.
+
+ Caused assertion failures on Monterey
+
+ Reverted changeset:
+
+ "Re-enable CustomDisplayName and DefaultDisplayName API tests
+ on Monterey"
+ https://bugs.webkit.org/show_bug.cgi?id=234613
+ https://commits.webkit.org/r287374
+
2022-01-04 Wenson Hsieh <[email protected]>
Use ICU instead of relying on hard-coded string equality checks in ModalContainerControlClassifier
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm (287594 => 287595)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm 2022-01-04 23:49:24 UTC (rev 287594)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm 2022-01-05 00:19:20 UTC (rev 287595)
@@ -53,7 +53,12 @@
}];
}
+// FIXME: Re-enable this test for Monterey+ once rdar://80353834 is resolved.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
+TEST(WebKit, DISABLED_CustomDisplayName)
+#else
TEST(WebKit, CustomDisplayName)
+#endif
{
auto configuration = adoptNS([WKWebViewConfiguration new]);
NSString *displayNameToSet = @"test display name";
@@ -66,7 +71,12 @@
Util::run(&done);
}
+// FIXME: Re-enable this test for Monterey+ once rdar://80353834 is resolved.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
+TEST(WebKit, DISABLED_DefaultDisplayName)
+#else
TEST(WebKit, DefaultDisplayName)
+#endif
{
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
[webView synchronouslyLoadHTMLString:@"start web process"];