20 #ifndef MIR_FRONTEND_PROTOBUF_MESSAGE_PROCESSOR_H_
21 #define MIR_FRONTEND_PROTOBUF_MESSAGE_PROCESSOR_H_
28 #include "mir_protobuf.pb.h"
29 #include "mir_protobuf_wire.pb.h"
39 namespace protobuf {
class DisplayServer; }
44 class MessageProcessorReport;
53 std::shared_ptr<MessageSender>
const& sender,
54 std::shared_ptr<protobuf::DisplayServer>
const& display_server,
55 std::shared_ptr<ResourceCache>
const& resource_cache,
56 std::shared_ptr<MessageProcessorReport>
const& report);
61 void send_response(::google::protobuf::uint32
id, google::protobuf::Message* response);
62 void send_response(::google::protobuf::uint32
id, google::protobuf::Message* response,
65 template<
class ResultMessage>
66 void send_response(::google::protobuf::uint32
id, ResultMessage* response);
70 void send_response(::google::protobuf::uint32
id, mir::protobuf::Buffer* response);
74 void send_response(::google::protobuf::uint32
id, mir::protobuf::Connection* response);
78 void send_response(::google::protobuf::uint32
id, mir::protobuf::Surface* response);
80 template<
class Response>
81 std::vector<int32_t> extract_fds_from(Response* response);
83 bool process_message(std::istream& msg);
85 bool dispatch(mir::protobuf::wire::Invocation
const& invocation);
87 template<
class ParameterMessage,
class ResultMessage>
89 void (protobuf::DisplayServer::*
function)(
90 ::google::protobuf::RpcController* controller,
91 const ParameterMessage* request,
92 ResultMessage* response,
93 ::google::protobuf::Closure* done),
94 mir::protobuf::wire::Invocation
const& invocation);
96 std::shared_ptr<MessageSender>
const sender;
97 std::shared_ptr<protobuf::DisplayServer>
const display_server;
98 std::shared_ptr<ResourceCache>
const resource_cache;
99 std::shared_ptr<MessageProcessorReport>
const report;
101 std::string send_response_buffer;
102 mir::protobuf::wire::Result send_response_result;