Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:set ts=2 sw=2 sts=2 et cindent: */
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 : #include "mozilla/dom/WebAuthnTransactionParent.h"
8 : #include "mozilla/dom/U2FTokenManager.h"
9 :
10 : namespace mozilla {
11 : namespace dom {
12 :
13 : mozilla::ipc::IPCResult
14 0 : WebAuthnTransactionParent::RecvRequestRegister(const WebAuthnTransactionInfo& aTransactionInfo)
15 : {
16 0 : U2FTokenManager* mgr = U2FTokenManager::Get();
17 0 : mgr->Register(this, aTransactionInfo);
18 0 : return IPC_OK();
19 : }
20 :
21 : mozilla::ipc::IPCResult
22 0 : WebAuthnTransactionParent::RecvRequestSign(const WebAuthnTransactionInfo& aTransactionInfo)
23 : {
24 0 : U2FTokenManager* mgr = U2FTokenManager::Get();
25 0 : mgr->Sign(this, aTransactionInfo);
26 0 : return IPC_OK();
27 : }
28 :
29 : mozilla::ipc::IPCResult
30 0 : WebAuthnTransactionParent::RecvRequestCancel()
31 : {
32 0 : U2FTokenManager* mgr = U2FTokenManager::Get();
33 0 : mgr->Cancel(this);
34 0 : return IPC_OK();
35 : }
36 :
37 : void
38 0 : WebAuthnTransactionParent::ActorDestroy(ActorDestroyReason aWhy)
39 : {
40 0 : U2FTokenManager* mgr = U2FTokenManager::Get();
41 0 : mgr->MaybeClearTransaction(this);
42 0 : }
43 : }
44 : }
|