1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

LibCore: Use ErrorOr<T> in Core::AnonymousBuffer

This commit is contained in:
Andreas Kling 2021-11-06 01:20:51 +01:00
parent c4edb9f6c2
commit e2eabb4132
15 changed files with 56 additions and 53 deletions

View file

@ -34,7 +34,9 @@ PageHost::~PageHost()
void PageHost::setup_palette()
{
// FIXME: Get the proper palette from our peer somehow
auto buffer = Core::AnonymousBuffer::create_with_size(sizeof(Gfx::SystemTheme));
auto buffer_or_error = Core::AnonymousBuffer::create_with_size(sizeof(Gfx::SystemTheme));
VERIFY(!buffer_or_error.is_error());
auto buffer = buffer_or_error.release_value();
auto* theme = buffer.data<Gfx::SystemTheme>();
theme->color[(int)Gfx::ColorRole::Window] = Color::Magenta;
theme->color[(int)Gfx::ColorRole::WindowText] = Color::Cyan;