1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes

This commit is contained in:
Brian Gianforcaro 2021-08-31 23:44:55 -07:00 committed by Andreas Kling
parent f3baa5d8c9
commit 668c429900
Notes: sideshowbarker 2024-07-18 04:56:24 +09:00
11 changed files with 58 additions and 55 deletions

View file

@ -260,10 +260,10 @@ void VirtualConsole::on_key_pressed(KeyEvent event)
KResultOr<size_t> VirtualConsole::on_tty_write(const UserOrKernelBuffer& data, size_t size)
{
SpinlockLocker global_lock(ConsoleManagement::the().tty_write_lock());
auto result = data.read_buffered<512>(size, [&](u8 const* buffer, size_t buffer_bytes) {
for (size_t i = 0; i < buffer_bytes; ++i)
m_console_impl.on_input(buffer[i]);
return buffer_bytes;
auto result = data.read_buffered<512>(size, [&](ReadonlyBytes buffer) {
for (const auto& byte : buffer)
m_console_impl.on_input(byte);
return buffer.size();
});
if (m_active)
flush_dirty_lines();