diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt index 81f609a20333f..1f99a9ef37a94 100644 --- a/Source/WebCore/CMakeLists.txt +++ b/Source/WebCore/CMakeLists.txt @@ -741,7 +741,6 @@ set(WebCore_NON_SVG_IDL_FILES Modules/webauthn/AuthenticatorResponse.idl Modules/webauthn/AuthenticatorTransport.idl Modules/webauthn/PublicKeyCredential.idl - Modules/webauthn/PublicKeyCredentialClientCapabilities.idl Modules/webauthn/PublicKeyCredentialCreationOptions.idl Modules/webauthn/PublicKeyCredentialDescriptor.idl Modules/webauthn/PublicKeyCredentialRequestOptions.idl diff --git a/Source/WebCore/DerivedSources-input.xcfilelist b/Source/WebCore/DerivedSources-input.xcfilelist index 211fa84d761fc..5ded33a77109d 100644 --- a/Source/WebCore/DerivedSources-input.xcfilelist +++ b/Source/WebCore/DerivedSources-input.xcfilelist @@ -977,7 +977,6 @@ $(PROJECT_DIR)/Modules/webauthn/AuthenticatorAttestationResponse.idl $(PROJECT_DIR)/Modules/webauthn/AuthenticatorResponse.idl $(PROJECT_DIR)/Modules/webauthn/AuthenticatorTransport.idl $(PROJECT_DIR)/Modules/webauthn/PublicKeyCredential.idl -$(PROJECT_DIR)/Modules/webauthn/PublicKeyCredentialClientCapabilities.idl $(PROJECT_DIR)/Modules/webauthn/PublicKeyCredentialCreationOptions.idl $(PROJECT_DIR)/Modules/webauthn/PublicKeyCredentialDescriptor.idl $(PROJECT_DIR)/Modules/webauthn/PublicKeyCredentialRequestOptions.idl diff --git a/Source/WebCore/DerivedSources-output.xcfilelist b/Source/WebCore/DerivedSources-output.xcfilelist index c8dc45d146345..f59ebc8bd4c13 100644 --- a/Source/WebCore/DerivedSources-output.xcfilelist +++ b/Source/WebCore/DerivedSources-output.xcfilelist @@ -2234,8 +2234,6 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPromiseRejectionEvent.cpp $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPromiseRejectionEvent.h $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPublicKeyCredential.cpp $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPublicKeyCredential.h -$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPublicKeyCredentialClientCapabilities.cpp -$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPublicKeyCredentialClientCapabilities.h $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPublicKeyCredentialCreationOptions.cpp $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPublicKeyCredentialCreationOptions.h $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPublicKeyCredentialDescriptor.cpp diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make index 467ceea6eba09..10b66dada2b24 100644 --- a/Source/WebCore/DerivedSources.make +++ b/Source/WebCore/DerivedSources.make @@ -723,7 +723,6 @@ JS_BINDING_IDLS := \ $(WebCore)/Modules/webauthn/AuthenticatorResponse.idl \ $(WebCore)/Modules/webauthn/AuthenticatorTransport.idl \ $(WebCore)/Modules/webauthn/PublicKeyCredential.idl \ - $(WebCore)/Modules/webauthn/PublicKeyCredentialClientCapabilities.idl \ $(WebCore)/Modules/webauthn/PublicKeyCredentialCreationOptions.idl \ $(WebCore)/Modules/webauthn/PublicKeyCredentialDescriptor.idl \ $(WebCore)/Modules/webauthn/PublicKeyCredentialRequestOptions.idl \ diff --git a/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp b/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp index d165be31d71c3..9e3e548fb84fc 100644 --- a/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp +++ b/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp @@ -40,7 +40,6 @@ #include "JSCredentialCreationOptions.h" #include "JSCredentialRequestOptions.h" #include "JSDOMPromiseDeferred.h" -#include "JSPublicKeyCredentialClientCapabilities.h" #include "PublicKeyCredential.h" #include "PublicKeyCredentialCreationOptions.h" #include "PublicKeyCredentialRequestOptions.h" @@ -311,15 +310,14 @@ void AuthenticatorCoordinator::isConditionalMediationAvailable(const Document& d m_client->isConditionalMediationAvailable(document.securityOrigin(), WTFMove(completionHandler)); } -void AuthenticatorCoordinator::getClientCapabilities(const Document& document, DOMPromiseDeferred>&& promise) const +void AuthenticatorCoordinator::getClientCapabilities(const Document& document, DOMPromiseDeferred&& promise) const { if (!m_client) { promise.reject(Exception { ExceptionCode::UnknownError, "Unknown internal error."_s }); return; } - auto completionHandler = [promise = WTFMove(promise)] (HashMap&& resultMap) mutable { - auto result = PublicKeyCredentialClientCapabilities::create(WTFMove(resultMap)); + auto completionHandler = [promise = WTFMove(promise)] (const Vector> result) mutable { promise.resolve(result); }; diff --git a/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.h b/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.h index c732fae1ac1f4..aea29f97afb2c 100644 --- a/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.h +++ b/Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.h @@ -42,7 +42,7 @@ class AbortSignal; class AuthenticatorCoordinatorClient; class BasicCredential; class Document; -class PublicKeyCredentialClientCapabilities; +typedef IDLRecord PublicKeyCredentialClientCapabilities; struct PublicKeyCredentialCreationOptions; struct PublicKeyCredentialRequestOptions; @@ -68,7 +68,7 @@ class AuthenticatorCoordinator final : public CanMakeWeakPtr&&) const; void isConditionalMediationAvailable(const Document&, DOMPromiseDeferred&&) const; - void getClientCapabilities(const Document&, DOMPromiseDeferred>&&) const; + void getClientCapabilities(const Document&, DOMPromiseDeferred&&) const; private: AuthenticatorCoordinator() = default; diff --git a/Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.h b/Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.h index f83fae793faec..68b1f092dbd3e 100644 --- a/Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.h +++ b/Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.h @@ -50,7 +50,7 @@ struct PublicKeyCredentialCreationOptions; struct PublicKeyCredentialRequestOptions; class SecurityOriginData; -using CapabilitiesCompletionHandler = CompletionHandler&&)>; +using CapabilitiesCompletionHandler = CompletionHandler>&&)>; using RequestCompletionHandler = CompletionHandler; using QueryCompletionHandler = CompletionHandler; diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp b/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp index a43f1a1252b14..531e61ac14839 100644 --- a/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp +++ b/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp @@ -70,7 +70,7 @@ void PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable(Document page->authenticatorCoordinator().isUserVerifyingPlatformAuthenticatorAvailable(document, WTFMove(promise)); } -void PublicKeyCredential::getClientCapabilities(Document& document, DOMPromiseDeferred>&& promise) +void PublicKeyCredential::getClientCapabilities(Document& document, DOMPromiseDeferred>&& promise) { if (auto* page = document.page()) page->authenticatorCoordinator().getClientCapabilities(document, WTFMove(promise)); diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredential.h b/Source/WebCore/Modules/webauthn/PublicKeyCredential.h index 505294064e448..7c2e98bcc1a21 100644 --- a/Source/WebCore/Modules/webauthn/PublicKeyCredential.h +++ b/Source/WebCore/Modules/webauthn/PublicKeyCredential.h @@ -36,7 +36,7 @@ namespace WebCore { enum class AuthenticatorAttachment : uint8_t; class AuthenticatorResponse; class Document; -class PublicKeyCredentialClientCapabilities; +typedef IDLRecord PublicKeyCredentialClientCapabilities; struct AuthenticationExtensionsClientOutputs; @@ -53,7 +53,7 @@ class PublicKeyCredential final : public BasicCredential { static void isUserVerifyingPlatformAuthenticatorAvailable(Document&, DOMPromiseDeferred&&); - static void getClientCapabilities(Document&, DOMPromiseDeferred>&&); + static void getClientCapabilities(Document&, DOMPromiseDeferred&&); private: PublicKeyCredential(Ref&&); diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl b/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl index 6e334a7146d0f..cd116d70e61ec 100644 --- a/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl +++ b/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl @@ -23,6 +23,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +typedef record PublicKeyCredentialClientCapabilities; + [ Conditional=WEB_AUTHN, EnabledBySetting=WebAuthenticationEnabled, diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.cpp b/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.cpp deleted file mode 100644 index ccae353fcbfe5..0000000000000 --- a/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2023 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. - */ - -#include "config.h" -#include "PublicKeyCredentialClientCapabilities.h" - -#if ENABLE(WEB_AUTHN) -#include "JSDOMMapLike.h" - -namespace WebCore { - -PublicKeyCredentialClientCapabilities::~PublicKeyCredentialClientCapabilities() = default; - -PublicKeyCredentialClientCapabilities::PublicKeyCredentialClientCapabilities(HashMap&& map) - : m_map(WTFMove(map)) -{ -} - -void PublicKeyCredentialClientCapabilities::initializeMapLike(DOMMapAdapter& map) -{ - for (auto& keyValue : m_map) - map.set(keyValue.key, keyValue.value); -} - -void PublicKeyCredentialClientCapabilities::add(const String& name, bool support) -{ - m_map.add(name, support); -} - -} // namespace WebCore - -#endif // ENABLE(WEB_AUTHN) diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.h b/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.h deleted file mode 100644 index e7cf4eb6af4c0..0000000000000 --- a/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2023 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 - -#if ENABLE(WEB_AUTHN) -#include -#include - -namespace WebCore { - -class DOMMapAdapter; - -class PublicKeyCredentialClientCapabilities : public RefCounted { -public: - static Ref create(HashMap&& map) - { - return adoptRef(*new PublicKeyCredentialClientCapabilities(WTFMove(map))); - } - ~PublicKeyCredentialClientCapabilities(); - - void initializeMapLike(DOMMapAdapter&); - void add(const String&, bool); - - const HashMap& map() const { return m_map; } - -private: - PublicKeyCredentialClientCapabilities(HashMap&&); - - HashMap m_map; -}; - -} // namespace WebCore - -#endif // ENABLE(WEB_AUTHN) diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.idl b/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.idl deleted file mode 100644 index 9bd020caf1769..0000000000000 --- a/Source/WebCore/Modules/webauthn/PublicKeyCredentialClientCapabilities.idl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2023 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. - */ - -[ - Conditional=WEB_AUTHN, - Exposed=Window, - JSGenerateToJSObject, -] interface PublicKeyCredentialClientCapabilities { - readonly maplike; -}; diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt index f3d39b7536df8..70763464213ee 100644 --- a/Source/WebCore/Sources.txt +++ b/Source/WebCore/Sources.txt @@ -420,7 +420,6 @@ Modules/webauthn/AuthenticatorAttestationResponse.cpp Modules/webauthn/AuthenticatorCoordinator.cpp Modules/webauthn/AuthenticatorResponse.cpp Modules/webauthn/PublicKeyCredential.cpp -Modules/webauthn/PublicKeyCredentialClientCapabilities.cpp Modules/webauthn/WebAuthenticationUtils.cpp Modules/webauthn/apdu/ApduCommand.cpp Modules/webauthn/apdu/ApduResponse.cpp @@ -4018,7 +4017,6 @@ JSProcessingInstruction.cpp JSProgressEvent.cpp JSPromiseRejectionEvent.cpp JSPublicKeyCredential.cpp -JSPublicKeyCredentialClientCapabilities.cpp JSPublicKeyCredentialCreationOptions.cpp JSPublicKeyCredentialDescriptor.cpp JSPublicKeyCredentialRequestOptions.cpp diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj index 69b4665d2597c..cdc8fb31eb63e 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj @@ -316,7 +316,6 @@ 0D44C33E2ABA1B9F0017FB5D /* ThermalMitigationNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D8EF8122A9D511F000118F8 /* ThermalMitigationNotifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0DFB86682B16CC98009A0A0D /* JSCredentialMediationRequirement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0DFB86642B16CC1E009A0A0D /* JSCredentialMediationRequirement.h */; }; 0DFB86792B1A42CB009A0A0D /* JSPublicKeyCredentialClientCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0DFB86742B1A4237009A0A0D /* JSPublicKeyCredentialClientCapabilities.h */; }; - 0DFB867A2B1A7130009A0A0D /* PublicKeyCredentialClientCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0DFB866C2B17F4B6009A0A0D /* PublicKeyCredentialClientCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0E7058F41BC5CEDA0045A507 /* SearchPopupMenuCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E7058F31BC5CCD70045A507 /* SearchPopupMenuCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0E9C1157291C18A400A2C2F2 /* ScreenDataOverrides.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9C1155291BF3CC00A2C2F2 /* ScreenDataOverrides.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F03C0741884695E00A5F8CA /* SystemMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F03C0731884695E00A5F8CA /* SystemMemory.h */; }; @@ -7062,9 +7061,6 @@ 0DD1F6F0291433EB00B79355 /* GPUCanvasContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUCanvasContext.h; sourceTree = ""; }; 0DFB86632B16CC1E009A0A0D /* JSCredentialMediationRequirement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCredentialMediationRequirement.cpp; sourceTree = ""; }; 0DFB86642B16CC1E009A0A0D /* JSCredentialMediationRequirement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSCredentialMediationRequirement.h; sourceTree = ""; }; - 0DFB866C2B17F4B6009A0A0D /* PublicKeyCredentialClientCapabilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PublicKeyCredentialClientCapabilities.h; sourceTree = ""; }; - 0DFB866D2B17F4C7009A0A0D /* PublicKeyCredentialClientCapabilities.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PublicKeyCredentialClientCapabilities.idl; sourceTree = ""; }; - 0DFB866E2B1953A1009A0A0D /* PublicKeyCredentialClientCapabilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PublicKeyCredentialClientCapabilities.cpp; sourceTree = ""; }; 0DFB86742B1A4237009A0A0D /* JSPublicKeyCredentialClientCapabilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSPublicKeyCredentialClientCapabilities.h; sourceTree = ""; }; 0DFB86752B1A4237009A0A0D /* JSPublicKeyCredentialClientCapabilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSPublicKeyCredentialClientCapabilities.cpp; sourceTree = ""; }; 0E7058ED1BC5BC190045A507 /* SearchPopupMenuCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SearchPopupMenuCocoa.mm; sourceTree = ""; }; @@ -26213,9 +26209,6 @@ 57D8462C1FEAF68F00CA3682 /* PublicKeyCredential.cpp */, 57D8462B1FEAF68F00CA3682 /* PublicKeyCredential.h */, 57D8462D1FEAF68F00CA3682 /* PublicKeyCredential.idl */, - 0DFB866E2B1953A1009A0A0D /* PublicKeyCredentialClientCapabilities.cpp */, - 0DFB866C2B17F4B6009A0A0D /* PublicKeyCredentialClientCapabilities.h */, - 0DFB866D2B17F4C7009A0A0D /* PublicKeyCredentialClientCapabilities.idl */, 57303BE62009747A00355965 /* PublicKeyCredentialCreationOptions.h */, 57303BE82009747A00355965 /* PublicKeyCredentialCreationOptions.idl */, 57303BEC200980BF00355965 /* PublicKeyCredentialDescriptor.h */, @@ -41069,7 +41062,6 @@ E45A6C772417BA59006E4CD5 /* PseudoClassChangeInvalidation.h in Headers */, FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */, 57D8462E1FEAF69900CA3682 /* PublicKeyCredential.h in Headers */, - 0DFB867A2B1A7130009A0A0D /* PublicKeyCredentialClientCapabilities.h in Headers */, 57303BE92009748D00355965 /* PublicKeyCredentialCreationOptions.h in Headers */, 57303BEF200980C600355965 /* PublicKeyCredentialDescriptor.h in Headers */, 57303C0A20099BAD00355965 /* PublicKeyCredentialRequestOptions.h in Headers */, diff --git a/Source/WebKit/Scripts/webkit/messages.py b/Source/WebKit/Scripts/webkit/messages.py index 2b8aadaa7e8a9..3dc427c33b674 100644 --- a/Source/WebKit/Scripts/webkit/messages.py +++ b/Source/WebKit/Scripts/webkit/messages.py @@ -665,6 +665,7 @@ def class_template_headers(template_string): 'Expected': {'headers': [''], 'argument_coder_headers': ['"ArgumentCoders.h"']}, 'HashMap': {'headers': [''], 'argument_coder_headers': ['"ArgumentCoders.h"']}, 'HashSet': {'headers': [''], 'argument_coder_headers': ['"ArgumentCoders.h"']}, + 'KeyValuePair': {'headers': [''], 'argument_coder_headers': ['"ArgumentCoders.h"']}, 'OptionSet': {'headers': [''], 'argument_coder_headers': ['"ArgumentCoders.h"']}, 'Vector': {'headers': [''], 'argument_coder_headers': ['"ArgumentCoders.h"']}, 'std::optional': {'headers': [''], 'argument_coder_headers': ['"ArgumentCoders.h"']}, diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm index be0ecb7f8b584..e5e968d7a8859 100644 --- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm +++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm @@ -862,21 +862,21 @@ static inline bool canCurrentProcessAccessPasskeysForRelyingParty(const WebCore: handler(false); } -void WebAuthenticatorCoordinatorProxy::getClientCapabilities(const WebCore::SecurityOriginData& originData, CapbilitiesCompletionHandler&& handler) +void WebAuthenticatorCoordinatorProxy::getClientCapabilities(const WebCore::SecurityOriginData& originData, CapabilitiesCompletionHandler&& handler) { if (![getASCWebKitSPISupportClass() respondsToSelector:@selector(getClientCapabilitiesForRelyingParty:withCompletionHandler:)]) { - HashMap resultMap; - handler(resultMap); + Vector> capabilities; + handler(WTFMove(capabilities)); return; } [getASCWebKitSPISupportClass() getClientCapabilitiesForRelyingParty:originData.securityOrigin()->domain() withCompletionHandler:makeBlockPtr([handler = WTFMove(handler)](NSDictionary *result) mutable { - HashMap resultMap; + Vector> capabilities; for (NSString *key in result) - resultMap.set(key, result[key].boolValue); + capabilities.append({ key, result[key].boolValue }); - ensureOnMainRunLoop([handler = WTFMove(handler), resultMap = WTFMove(resultMap)] () mutable { - handler(resultMap); + ensureOnMainRunLoop([handler = WTFMove(handler), capabilities = WTFMove(capabilities)] () mutable { + handler(WTFMove(capabilities)); }); }).get()]; } diff --git a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h index 6e838e0209b6d..5851e9e8b7982 100644 --- a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h +++ b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h @@ -67,7 +67,7 @@ class WebPageProxy; struct FrameInfoData; struct WebAuthenticationRequestData; -using CapbilitiesCompletionHandler = CompletionHandler&)>; +using CapabilitiesCompletionHandler = CompletionHandler>&&)>; using RequestCompletionHandler = CompletionHandler; class WebAuthenticatorCoordinatorProxy : public IPC::MessageReceiver { @@ -93,7 +93,7 @@ class WebAuthenticatorCoordinatorProxy : public IPC::MessageReceiver { void getAssertion(WebCore::FrameIdentifier, FrameInfoData&&, Vector&& hash, WebCore::PublicKeyCredentialRequestOptions&&, WebCore::MediationRequirement, std::optional, RequestCompletionHandler&&); void isUserVerifyingPlatformAuthenticatorAvailable(const WebCore::SecurityOriginData&, QueryCompletionHandler&&); void isConditionalMediationAvailable(const WebCore::SecurityOriginData&, QueryCompletionHandler&&); - void getClientCapabilities(const WebCore::SecurityOriginData&, CapbilitiesCompletionHandler&&); + void getClientCapabilities(const WebCore::SecurityOriginData&, CapabilitiesCompletionHandler&&); void cancel(); void handleRequest(WebAuthenticationRequestData&&, RequestCompletionHandler&&); diff --git a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in index 2cda347e242d5..9efd76cba88c6 100644 --- a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in +++ b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in @@ -30,7 +30,7 @@ messages -> WebAuthenticatorCoordinatorProxy NotRefCounted { GetAssertion(WebCore::FrameIdentifier frameID, struct WebKit::FrameInfoData frameInfo, Vector hash, struct WebCore::PublicKeyCredentialRequestOptions options, enum:uint8_t WebCore::MediationRequirement mediation, std::optional parentOrigin) -> (struct WebCore::AuthenticatorResponseData data, enum:uint8_t WebCore::AuthenticatorAttachment attachment, struct WebCore::ExceptionData exception) isConditionalMediationAvailable(WebCore::SecurityOriginData origin) -> (bool result) IsUserVerifyingPlatformAuthenticatorAvailable(WebCore::SecurityOriginData origin) -> (bool result) - GetClientCapabilities(WebCore::SecurityOriginData origin) -> (HashMap result) + GetClientCapabilities(WebCore::SecurityOriginData origin) -> (Vector> result) Cancel() }