1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_WinWebAuthnService_h
8 #define mozilla_dom_WinWebAuthnService_h
10 #include "mozilla/dom/PWebAuthnTransaction.h"
11 #include "mozilla/Tainting.h"
12 #include "nsIWebAuthnService.h"
14 namespace mozilla::dom
{
16 class WinWebAuthnService final
: public nsIWebAuthnService
{
18 NS_DECL_THREADSAFE_ISUPPORTS
19 NS_DECL_NSIWEBAUTHNSERVICE
21 static bool IsUserVerifyingPlatformAuthenticatorAvailable();
22 static bool AreWebAuthNApisAvailable();
23 static nsresult
EnsureWinWebAuthnModuleLoaded();
26 : mTransactionState(Nothing(), "WinWebAuthnService::mTransactionState"){};
29 ~WinWebAuthnService();
31 uint32_t GetWebAuthNApiVersion();
33 struct TransactionState
{
34 uint64_t transactionId
;
35 uint64_t browsingContextId
;
36 Maybe
<RefPtr
<nsIWebAuthnSignArgs
>> pendingSignArgs
;
37 Maybe
<RefPtr
<nsIWebAuthnSignPromise
>> pendingSignPromise
;
41 using TransactionStateMutex
= DataMutex
<Maybe
<TransactionState
>>;
42 TransactionStateMutex mTransactionState
;
43 void DoGetAssertion(Maybe
<nsTArray
<uint8_t>>&& aSelectedCredentialId
,
44 const TransactionStateMutex::AutoLock
& aGuard
);
47 } // namespace mozilla::dom
49 #endif // mozilla_dom_WinWebAuthnService_h