Bug 1892041 - Part 1: Update test262 features. r=spidermonkey-reviewers,dminor
[gecko.git] / dom / webauthn / WebAuthnManagerBase.h
blob0958fb59b3e06281cf32b38a752a7af02bf0113f
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_WebAuthnManagerBase_h
8 #define mozilla_dom_WebAuthnManagerBase_h
10 #include "nsCycleCollectionParticipant.h"
11 #include "nsCOMPtr.h"
14 * A base class used by WebAuthn and U2F implementations, providing shared
15 * functionality and requiring an interface used by the IPC child actors.
18 class nsPIDOMWindowInner;
20 namespace mozilla::dom {
22 class WebAuthnTransactionChild;
23 class WebAuthnMakeCredentialResult;
24 class WebAuthnGetAssertionResult;
26 class WebAuthnManagerBase : public nsISupports {
27 public:
28 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
29 NS_DECL_CYCLE_COLLECTION_CLASS(WebAuthnManagerBase)
31 explicit WebAuthnManagerBase(nsPIDOMWindowInner* aParent);
33 MOZ_CAN_RUN_SCRIPT
34 virtual void FinishMakeCredential(
35 const uint64_t& aTransactionId,
36 const WebAuthnMakeCredentialResult& aResult) = 0;
38 MOZ_CAN_RUN_SCRIPT
39 virtual void FinishGetAssertion(
40 const uint64_t& aTransactionId,
41 const WebAuthnGetAssertionResult& aResult) = 0;
43 MOZ_CAN_RUN_SCRIPT
44 virtual void RequestAborted(const uint64_t& aTransactionId,
45 const nsresult& aError) = 0;
47 void ActorDestroyed();
49 protected:
50 MOZ_CAN_RUN_SCRIPT virtual ~WebAuthnManagerBase();
52 bool MaybeCreateBackgroundActor();
54 // The parent window.
55 nsCOMPtr<nsPIDOMWindowInner> mParent;
57 // IPC Channel to the parent process.
58 RefPtr<WebAuthnTransactionChild> mChild;
61 } // namespace mozilla::dom
63 #endif // mozilla_dom_WebAuthnManagerBase_h