diff --git a/dom/u2f/U2FManager.h b/dom/u2f/U2FManager.h index effd447efb31..b7b6a5cfd2a8 100644 --- a/dom/u2f/U2FManager.h +++ b/dom/u2f/U2FManager.h @@ -59,15 +59,11 @@ class U2FManager final : public nsIIPCBackgroundChildCreateCallback public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMEVENTLISTENER + NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK + static U2FManager* GetOrCreate(); static U2FManager* Get(); - void FinishRegister(nsTArray& aRegBuffer); - void FinishSign(nsTArray& aCredentialId, - nsTArray& aSigBuffer); - void Cancel(const nsresult& aError); - void RequestAborted(const nsresult& aError); - already_AddRefed Register(nsPIDOMWindowInner* aParent, const nsCString& aRpId, const nsCString& aClientDataJSON, @@ -79,18 +75,23 @@ public: const uint32_t& aTimeoutMillis, const nsTArray& aKeyList); - void StartRegister(); - void StartSign(); - void StartCancel(); + void FinishRegister(nsTArray& aRegBuffer); + void FinishSign(nsTArray& aCredentialId, + nsTArray& aSigBuffer); + void RequestAborted(const nsresult& aError); + + void Cancel(const nsresult& aError); - // nsIIPCbackgroundChildCreateCallback methods - void ActorCreated(PBackgroundChild* aActor) override; - void ActorFailed() override; void ActorDestroyed(); + private: U2FManager(); virtual ~U2FManager(); + void StartRegister(); + void StartSign(); + void StartCancel(); + void MaybeClearTransaction(); nsresult PopulateTransactionInfo(const nsCString& aRpId, const nsCString& aClientDataJSON, diff --git a/dom/webauthn/WebAuthnManager.h b/dom/webauthn/WebAuthnManager.h index b6d559afb04a..ca2565401874 100644 --- a/dom/webauthn/WebAuthnManager.h +++ b/dom/webauthn/WebAuthnManager.h @@ -68,9 +68,19 @@ class WebAuthnManager final : public nsIIPCBackgroundChildCreateCallback, public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMEVENTLISTENER + NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK + static WebAuthnManager* GetOrCreate(); static WebAuthnManager* Get(); + already_AddRefed + MakeCredential(nsPIDOMWindowInner* aParent, + const MakePublicKeyCredentialOptions& aOptions); + + already_AddRefed + GetAssertion(nsPIDOMWindowInner* aParent, + const PublicKeyCredentialRequestOptions& aOptions); + void FinishMakeCredential(nsTArray& aRegBuffer); @@ -81,26 +91,16 @@ public: void RequestAborted(const nsresult& aError); - already_AddRefed - MakeCredential(nsPIDOMWindowInner* aParent, - const MakePublicKeyCredentialOptions& aOptions); + void ActorDestroyed(); - already_AddRefed - GetAssertion(nsPIDOMWindowInner* aParent, - const PublicKeyCredentialRequestOptions& aOptions); +private: + WebAuthnManager(); + virtual ~WebAuthnManager(); void StartRegister(); void StartSign(); void StartCancel(); - // nsIIPCbackgroundChildCreateCallback methods - void ActorCreated(PBackgroundChild* aActor) override; - void ActorFailed() override; - void ActorDestroyed(); -private: - WebAuthnManager(); - virtual ~WebAuthnManager(); - void Cancel(const nsresult& aError); void MaybeClearTransaction();