mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibCore: Make MappedFile OwnPtr-based
Since it will become a stream in a little bit, it should behave like all non-trivial stream classes, who are not primarily intended to have shared ownership to make closing behavior more predictable. Across all uses of MappedFile, there is only one use case of shared mapped files in LibVideo, which now uses the thin SharedMappedFile wrapper.
This commit is contained in:
committed by
Tim Schumacher
parent
5b2496e522
commit
062e0db46c
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/062e0db46c Pull-request: https://github.com/SerenityOS/serenity/pull/21156 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/timschumi ✅
@@ -116,7 +116,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
|
||||
Optional<ReadonlyBytes> icc_data = TRY(decoder->icc_data());
|
||||
|
||||
RefPtr<Core::MappedFile> icc_file;
|
||||
OwnPtr<Core::MappedFile> icc_file;
|
||||
if (!assign_color_profile_path.is_empty()) {
|
||||
icc_file = TRY(Core::MappedFile::map(assign_color_profile_path));
|
||||
icc_data = icc_file->bytes();
|
||||
@@ -128,7 +128,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto source_icc_file = icc_file;
|
||||
auto source_icc_file = move(icc_file);
|
||||
auto source_icc_data = icc_data.value();
|
||||
icc_file = TRY(Core::MappedFile::map(convert_color_profile_path));
|
||||
icc_data = icc_file->bytes();
|
||||
|
||||
Reference in New Issue
Block a user