1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:27:35 +00:00

LibDesktop: Make allowlist APIs return ErrorOr<void>

This makes it very smooth to use TRY() when setting up these lists,
as you can see in the rest of this commit. :^)
This commit is contained in:
Andreas Kling 2021-11-24 00:23:00 +01:00
parent 4a64bb80ea
commit b6f49924be
8 changed files with 34 additions and 76 deletions

View file

@ -31,10 +31,10 @@ public:
static NonnullRefPtr<Details> from_details_str(const String&);
};
[[nodiscard]] static bool add_allowed_url(const URL&);
[[nodiscard]] static bool add_allowed_handler_with_any_url(const String& handler);
[[nodiscard]] static bool add_allowed_handler_with_only_specific_urls(const String& handler, const Vector<URL>&);
[[nodiscard]] static bool seal_allowlist();
static ErrorOr<void> add_allowed_url(URL const&);
static ErrorOr<void> add_allowed_handler_with_any_url(String const& handler);
static ErrorOr<void> add_allowed_handler_with_only_specific_urls(String const& handler, Vector<URL> const&);
static ErrorOr<void> seal_allowlist();
static bool open(const URL&, const String& handler_name = {});
static bool open(const URL&, const Details& details);
static Vector<String> get_handlers_for_url(const URL&);