mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
LibKeyboard: Read keymap through File, not DeprecatedFile
This results in a new OOM prevention. Hooray!
This commit is contained in:
parent
37b5bfa068
commit
97e60f2c7d
Notes:
sideshowbarker
2024-07-17 08:37:36 +09:00
Author: https://github.com/BenWiederhake
Commit: 97e60f2c7d
Pull-request: https://github.com/SerenityOS/serenity/pull/18757
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
#include "CharacterMapFile.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibCore/DeprecatedFile.h>
|
||||
#include <LibCore/File.h>
|
||||
|
||||
namespace Keyboard {
|
||||
|
||||
|
@ -22,8 +22,8 @@ ErrorOr<CharacterMapData> CharacterMapFile::load_from_file(DeprecatedString cons
|
|||
path = full_path.to_deprecated_string();
|
||||
}
|
||||
|
||||
auto file = TRY(Core::DeprecatedFile::open(path, Core::OpenMode::ReadOnly));
|
||||
auto file_contents = file->read_all();
|
||||
auto file = TRY(Core::File::open(path, Core::File::OpenMode::Read));
|
||||
auto file_contents = TRY(file->read_until_eof());
|
||||
auto json_result = TRY(JsonValue::from_string(file_contents));
|
||||
auto const& json = json_result.as_object();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue