serenity/Userland/Services/RequestServer/Protocol.h
Itamar 3a71748e5d Userland: Rename IPC ClientConnection => ConnectionFromClient
This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
2022-02-25 22:35:12 +01:00

36 lines
774 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefPtr.h>
#include <AK/URL.h>
#include <RequestServer/Forward.h>
namespace RequestServer {
class Protocol {
public:
virtual ~Protocol();
const String& name() const { return m_name; }
virtual OwnPtr<Request> start_request(ConnectionFromClient&, const String& method, const URL&, const HashMap<String, String>& headers, ReadonlyBytes body) = 0;
static Protocol* find_by_name(const String&);
protected:
explicit Protocol(const String& name);
struct Pipe {
int read_fd { -1 };
int write_fd { -1 };
};
static ErrorOr<Pipe> get_pipe_for_request();
private:
String m_name;
};
}