2017-10-27 01:08:41 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2017-04-20 03:46:08 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_WebAuthnTransactionChild_h
|
|
|
|
#define mozilla_dom_WebAuthnTransactionChild_h
|
|
|
|
|
2017-12-05 21:05:06 +03:00
|
|
|
#include "mozilla/dom/PWebAuthnTransactionChild.h"
|
|
|
|
#include "mozilla/dom/WebAuthnManagerBase.h"
|
2017-04-20 03:46:08 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Child process IPC implementation for WebAuthn API. Receives results of
|
|
|
|
* WebAuthn transactions from the parent process, and sends them to the
|
|
|
|
* WebAuthnManager either cancel the transaction, or be formatted and relayed to
|
|
|
|
* content.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2017-12-05 21:05:06 +03:00
|
|
|
class WebAuthnTransactionChild final : public PWebAuthnTransactionChild
|
2017-04-20 03:46:08 +03:00
|
|
|
{
|
|
|
|
public:
|
2017-12-05 21:05:06 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(WebAuthnTransactionChild);
|
|
|
|
explicit WebAuthnTransactionChild(WebAuthnManagerBase* aManager);
|
|
|
|
|
2017-10-25 16:59:53 +03:00
|
|
|
mozilla::ipc::IPCResult
|
|
|
|
RecvConfirmRegister(const uint64_t& aTransactionId,
|
2018-02-12 23:08:54 +03:00
|
|
|
const WebAuthnMakeCredentialResult& aResult) override;
|
2017-10-25 16:59:53 +03:00
|
|
|
|
|
|
|
mozilla::ipc::IPCResult
|
|
|
|
RecvConfirmSign(const uint64_t& aTransactionId,
|
2018-02-12 23:08:54 +03:00
|
|
|
const WebAuthnGetAssertionResult& aResult) override;
|
2017-10-25 16:59:53 +03:00
|
|
|
|
|
|
|
mozilla::ipc::IPCResult
|
2017-11-06 06:37:28 +03:00
|
|
|
RecvAbort(const uint64_t& aTransactionId, const nsresult& aError) override;
|
2017-12-05 21:05:06 +03:00
|
|
|
|
2017-11-06 06:37:28 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason why) override;
|
2017-12-05 21:05:06 +03:00
|
|
|
|
|
|
|
void Disconnect();
|
|
|
|
|
|
|
|
private:
|
|
|
|
~WebAuthnTransactionChild() = default;
|
2017-10-25 16:59:53 +03:00
|
|
|
|
2017-12-05 21:05:06 +03:00
|
|
|
// Nulled by ~WebAuthnManager() when disconnecting.
|
|
|
|
WebAuthnManagerBase* mManager;
|
2017-04-20 03:46:08 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //mozilla_dom_WebAuthnTransactionChild_h
|