1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

Kernel: Move TTY subsystem to use KString instead of AK::String

This is minor progress on removing the `AK::String` API from the Kernel
in the interest of improving OOM safety.
This commit is contained in:
Brian Gianforcaro 2021-10-31 22:47:19 -07:00 committed by Andreas Kling
parent 71f05c70b4
commit 9f6eabd73a
10 changed files with 36 additions and 27 deletions

View file

@ -86,13 +86,13 @@ public:
void emit_char(char);
private:
explicit VirtualConsole(const unsigned index);
explicit VirtualConsole(const unsigned index, NonnullOwnPtr<KString> tty_name);
// ^KeyboardClient
virtual void on_key_pressed(KeyEvent) override;
// ^TTY
virtual KResultOr<size_t> on_tty_write(const UserOrKernelBuffer&, size_t) override;
virtual String const& tty_name() const override { return m_tty_name; }
virtual KString const& tty_name() const override { return *m_tty_name; }
virtual void echo(u8) override;
// ^TerminalClient
@ -114,7 +114,7 @@ private:
bool m_active { false };
bool m_graphical { false };
String m_tty_name;
NonnullOwnPtr<KString> m_tty_name;
private:
void initialize();