WebAuthnConnectionToWebProcess.h [plain text]
#pragma once
#if ENABLE(WEB_AUTHN)
#include "Connection.h"
#include "WebAuthnConnectionToWebProcessMessages.h"
#include <WebCore/ProcessIdentifier.h>
#include <wtf/RefCounted.h>
namespace WebCore {
struct AuthenticatorResponseData;
struct ExceptionData;
struct MockWebAuthenticationConfiguration;
struct PublicKeyCredentialCreationOptions;
struct PublicKeyCredentialRequestOptions;
}
namespace WebKit {
class WebAuthnProcess;
struct WebAuthenticationRequestData;
class WebAuthnConnectionToWebProcess
: public RefCounted<WebAuthnConnectionToWebProcess>
, IPC::Connection::Client {
public:
static Ref<WebAuthnConnectionToWebProcess> create(WebAuthnProcess&, WebCore::ProcessIdentifier, IPC::Connection::Identifier);
virtual ~WebAuthnConnectionToWebProcess();
IPC::Connection& connection() { return m_connection.get(); }
WebAuthnProcess& WebAuthnProcessProcess() { return m_WebAuthnProcess.get(); }
WebCore::ProcessIdentifier webProcessIdentifier() const { return m_webProcessIdentifier; }
private:
using RequestCompletionHandler = CompletionHandler<void(const WebCore::AuthenticatorResponseData&, const WebCore::ExceptionData&)>;
using QueryCompletionHandler = CompletionHandler<void(bool)>;
WebAuthnConnectionToWebProcess(WebAuthnProcess&, WebCore::ProcessIdentifier, IPC::Connection::Identifier);
void didClose(IPC::Connection&) final;
void didReceiveInvalidMessage(IPC::Connection&, IPC::MessageName) final;
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
void makeCredential(Vector<uint8_t>&& hash, WebCore::PublicKeyCredentialCreationOptions&&, bool processingUserGesture, RequestCompletionHandler&&);
void getAssertion(Vector<uint8_t>&& hash, WebCore::PublicKeyCredentialRequestOptions&&, bool processingUserGesture, RequestCompletionHandler&&);
void isUserVerifyingPlatformAuthenticatorAvailable(QueryCompletionHandler&&);
void setMockWebAuthenticationConfiguration(WebCore::MockWebAuthenticationConfiguration&&);
void handleRequest(WebAuthenticationRequestData&&, RequestCompletionHandler&&);
Ref<IPC::Connection> m_connection;
Ref<WebAuthnProcess> m_WebAuthnProcess;
const WebCore::ProcessIdentifier m_webProcessIdentifier;
};
}
#endif // ENABLE(WEB_AUTHN)