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:
parent
f3baa5d8c9
commit
668c429900
Notes:
sideshowbarker
2024-07-18 04:56:24 +09:00
Author: https://github.com/bgianfo
Commit: 668c429900
Pull-request: https://github.com/SerenityOS/serenity/pull/9720
11 changed files with 58 additions and 55 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue