Source code

Revision control

Other Tools

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/. */
6
7
#ifndef mozilla_dom_WebAuthnTransactionChild_h
8
#define mozilla_dom_WebAuthnTransactionChild_h
9
10
#include "mozilla/dom/PWebAuthnTransactionChild.h"
11
#include "mozilla/dom/WebAuthnManagerBase.h"
12
13
/*
14
* Child process IPC implementation for WebAuthn API. Receives results of
15
* WebAuthn transactions from the parent process, and sends them to the
16
* WebAuthnManager either cancel the transaction, or be formatted and relayed to
17
* content.
18
*/
19
20
namespace mozilla {
21
namespace dom {
22
23
class WebAuthnTransactionChild final : public PWebAuthnTransactionChild {
24
public:
25
NS_INLINE_DECL_REFCOUNTING(WebAuthnTransactionChild);
26
explicit WebAuthnTransactionChild(WebAuthnManagerBase* aManager);
27
28
// MOZ_CAN_RUN_SCRIPT_BOUNDARY until we can do MOZ_CAN_RUN_SCRIPT in
29
// IPDL-generated things.
30
MOZ_CAN_RUN_SCRIPT_BOUNDARY
31
mozilla::ipc::IPCResult RecvConfirmRegister(
32
const uint64_t& aTransactionId,
33
const WebAuthnMakeCredentialResult& aResult);
34
35
// MOZ_CAN_RUN_SCRIPT_BOUNDARY until we can do MOZ_CAN_RUN_SCRIPT in
36
// IPDL-generated things.
37
MOZ_CAN_RUN_SCRIPT_BOUNDARY
38
mozilla::ipc::IPCResult RecvConfirmSign(
39
const uint64_t& aTransactionId,
40
const WebAuthnGetAssertionResult& aResult);
41
42
// MOZ_CAN_RUN_SCRIPT_BOUNDARY until we can do MOZ_CAN_RUN_SCRIPT in
43
// IPDL-generated things.
44
MOZ_CAN_RUN_SCRIPT_BOUNDARY
45
mozilla::ipc::IPCResult RecvAbort(const uint64_t& aTransactionId,
46
const nsresult& aError);
47
48
void ActorDestroy(ActorDestroyReason why) override;
49
50
void Disconnect();
51
52
private:
53
~WebAuthnTransactionChild() = default;
54
55
// Nulled by ~WebAuthnManager() when disconnecting.
56
WebAuthnManagerBase* mManager;
57
};
58
59
} // namespace dom
60
} // namespace mozilla
61
62
#endif // mozilla_dom_WebAuthnTransactionChild_h