Bug 1874684 - Part 6: Limit day length calculations to safe integers. r=mgaudet
[gecko.git] / dom / webauthn / WebAuthnTransactionParent.h
blobc393971dc479a277f48e52d89f89d12521ed6824
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_WebAuthnTransactionParent_h
8 #define mozilla_dom_WebAuthnTransactionParent_h
10 #include "mozilla/dom/PWebAuthnTransactionParent.h"
11 #include "mozilla/dom/WebAuthnPromiseHolder.h"
12 #include "nsIWebAuthnService.h"
15 * Parent process IPC implementation for WebAuthn.
18 namespace mozilla::dom {
20 class WebAuthnRegisterPromiseHolder;
21 class WebAuthnSignPromiseHolder;
23 class WebAuthnTransactionParent final : public PWebAuthnTransactionParent {
24 public:
25 NS_INLINE_DECL_REFCOUNTING(WebAuthnTransactionParent);
26 WebAuthnTransactionParent() = default;
28 mozilla::ipc::IPCResult RecvRequestRegister(
29 const uint64_t& aTransactionId,
30 const WebAuthnMakeCredentialInfo& aTransactionInfo);
32 mozilla::ipc::IPCResult RecvRequestSign(
33 const uint64_t& aTransactionId,
34 const WebAuthnGetAssertionInfo& aTransactionInfo);
36 mozilla::ipc::IPCResult RecvRequestCancel(
37 const Tainted<uint64_t>& aTransactionId);
39 mozilla::ipc::IPCResult RecvRequestIsUVPAA(
40 RequestIsUVPAAResolver&& aResolver);
42 mozilla::ipc::IPCResult RecvDestroyMe();
44 virtual void ActorDestroy(ActorDestroyReason aWhy) override;
46 private:
47 ~WebAuthnTransactionParent() = default;
49 void CompleteTransaction();
50 void DisconnectTransaction();
52 nsCOMPtr<nsIWebAuthnService> mWebAuthnService;
53 Maybe<uint64_t> mTransactionId;
54 MozPromiseRequestHolder<WebAuthnRegisterPromise> mRegisterPromiseRequest;
55 MozPromiseRequestHolder<WebAuthnSignPromise> mSignPromiseRequest;
58 } // namespace mozilla::dom
60 #endif // mozilla_dom_WebAuthnTransactionParent_h