LibIPC: Return a StringView for IPC message names

This commit is contained in:
Timothy Flynn 2026-04-23 07:32:19 -04:00 committed by Tim Flynn
parent 373db4e157
commit cfa24d3367
2 changed files with 3 additions and 2 deletions

View file

@ -8,6 +8,7 @@
#pragma once
#include <AK/Error.h>
#include <AK/StringView.h>
#include <AK/Vector.h>
#include <LibIPC/Attachment.h>
#include <LibIPC/Forward.h>
@ -59,7 +60,7 @@ public:
virtual u32 endpoint_magic() const = 0;
virtual int message_id() const = 0;
virtual char const* message_name() const = 0;
virtual StringView message_name() const = 0;
virtual ErrorOr<MessageBuffer> encode() const = 0;
protected:

View file

@ -365,7 +365,7 @@ public:""")
virtual u32 endpoint_magic() const override {{ return ENDPOINT_MAGIC; }}
virtual i32 message_id() const override {{ return (int)MessageID::{pascal_name}; }}
static i32 static_message_id() {{ return (int)MessageID::{pascal_name}; }}
virtual const char* message_name() const override {{ return "{endpoint.name}::{pascal_name}"; }}
virtual StringView message_name() const override {{ return "{endpoint.name}::{pascal_name}"sv; }}
static ErrorOr<NonnullOwnPtr<{pascal_name}>> decode(Stream& stream, Queue<IPC::Attachment>& attachments)
{{