mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 17:21:52 +00:00
AK+Userland: Remove NOESCAPE
See the next commit for an explanation
This commit is contained in:
parent
d2b3007248
commit
a5f4c9a632
Notes:
sideshowbarker
2024-07-17 18:13:59 +09:00
Author: https://github.com/mattco98
Commit: a5f4c9a632
Pull-request: https://github.com/SerenityOS/serenity/pull/24361
Reviewed-by: https://github.com/ADKaster ✅
16 changed files with 24 additions and 26 deletions
|
@ -40,11 +40,9 @@ namespace AK {
|
||||||
|
|
||||||
// These annotations are used to avoid capturing a variable with local storage in a lambda that outlives it
|
// These annotations are used to avoid capturing a variable with local storage in a lambda that outlives it
|
||||||
#if defined(AK_COMPILER_CLANG)
|
#if defined(AK_COMPILER_CLANG)
|
||||||
# define NOESCAPE [[clang::annotate("serenity::noescape")]]
|
|
||||||
// FIXME: When we get C++23, change this to be applied to the lambda directly instead of to the types of its captures
|
// FIXME: When we get C++23, change this to be applied to the lambda directly instead of to the types of its captures
|
||||||
# define IGNORE_USE_IN_ESCAPING_LAMBDA [[clang::annotate("serenity::ignore_use_in_escaping_lambda")]]
|
# define IGNORE_USE_IN_ESCAPING_LAMBDA [[clang::annotate("serenity::ignore_use_in_escaping_lambda")]]
|
||||||
#else
|
#else
|
||||||
# define NOESCAPE
|
|
||||||
# define IGNORE_USE_IN_ESCAPING_LAMBDA
|
# define IGNORE_USE_IN_ESCAPING_LAMBDA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
|
|
||||||
NonnullRefPtr<ProjectFile> create_file(ByteString const& path) const;
|
NonnullRefPtr<ProjectFile> create_file(ByteString const& path) const;
|
||||||
|
|
||||||
void for_each_text_file(NOESCAPE Function<void(ProjectFile const&)>) const;
|
void for_each_text_file(Function<void(ProjectFile const&)>) const;
|
||||||
ByteString to_absolute_path(ByteString const&) const;
|
ByteString to_absolute_path(ByteString const&) const;
|
||||||
bool project_is_serenity() const;
|
bool project_is_serenity() const;
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,8 @@ private:
|
||||||
Vector<ByteString> dependencies {};
|
Vector<ByteString> dependencies {};
|
||||||
};
|
};
|
||||||
static HashMap<ByteString, NonnullOwnPtr<LibraryInfo>> get_defined_libraries();
|
static HashMap<ByteString, NonnullOwnPtr<LibraryInfo>> get_defined_libraries();
|
||||||
static void for_each_library_definition(NOESCAPE Function<void(ByteString, ByteString)>);
|
static void for_each_library_definition(Function<void(ByteString, ByteString)>);
|
||||||
static void for_each_library_dependencies(NOESCAPE Function<void(ByteString, Vector<StringView>)>);
|
static void for_each_library_dependencies(Function<void(ByteString, Vector<StringView>)>);
|
||||||
static ErrorOr<ByteString> component_name(StringView cmake_file_path);
|
static ErrorOr<ByteString> component_name(StringView cmake_file_path);
|
||||||
static ErrorOr<void> verify_cmake_is_installed();
|
static ErrorOr<void> verify_cmake_is_installed();
|
||||||
static ErrorOr<void> verify_make_is_installed();
|
static ErrorOr<void> verify_make_is_installed();
|
||||||
|
|
|
@ -114,8 +114,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
Model();
|
Model();
|
||||||
|
|
||||||
void for_each_view(NOESCAPE Function<void(AbstractView&)>);
|
void for_each_view(Function<void(AbstractView&)>);
|
||||||
void for_each_client(NOESCAPE Function<void(ModelClient&)>);
|
void for_each_client(Function<void(ModelClient&)>);
|
||||||
void did_update(unsigned flags = UpdateFlag::InvalidateAllIndices);
|
void did_update(unsigned flags = UpdateFlag::InvalidateAllIndices);
|
||||||
|
|
||||||
static bool string_matches(StringView str, StringView needle, unsigned flags)
|
static bool string_matches(StringView str, StringView needle, unsigned flags)
|
||||||
|
|
|
@ -37,11 +37,11 @@ public:
|
||||||
RefPtr<Gfx::Font> get(FlyString const& family, float point_size, unsigned weight, unsigned width, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
RefPtr<Gfx::Font> get(FlyString const& family, float point_size, unsigned weight, unsigned width, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
||||||
RefPtr<Gfx::Font> get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
RefPtr<Gfx::Font> get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
||||||
RefPtr<Gfx::Font> get_by_name(StringView);
|
RefPtr<Gfx::Font> get_by_name(StringView);
|
||||||
void for_each_font(NOESCAPE Function<void(Gfx::Font const&)>);
|
void for_each_font(Function<void(Gfx::Font const&)>);
|
||||||
void for_each_fixed_width_font(NOESCAPE Function<void(Gfx::Font const&)>);
|
void for_each_fixed_width_font(Function<void(Gfx::Font const&)>);
|
||||||
|
|
||||||
void for_each_typeface(NOESCAPE Function<void(Typeface const&)>);
|
void for_each_typeface(Function<void(Typeface const&)>);
|
||||||
void for_each_typeface_with_family_name(FlyString const& family_name, NOESCAPE Function<void(Typeface const&)>);
|
void for_each_typeface_with_family_name(FlyString const& family_name, Function<void(Typeface const&)>);
|
||||||
|
|
||||||
void load_all_fonts_from_uri(StringView);
|
void load_all_fonts_from_uri(StringView);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ ThrowCompletionOr<Value> call_impl(VM&, Value function, Value this_value, Readon
|
||||||
ThrowCompletionOr<Value> call_impl(VM&, FunctionObject& function, Value this_value, ReadonlySpan<Value> arguments = {});
|
ThrowCompletionOr<Value> call_impl(VM&, FunctionObject& function, Value this_value, ReadonlySpan<Value> arguments = {});
|
||||||
ThrowCompletionOr<NonnullGCPtr<Object>> construct_impl(VM&, FunctionObject&, ReadonlySpan<Value> arguments = {}, FunctionObject* new_target = nullptr);
|
ThrowCompletionOr<NonnullGCPtr<Object>> construct_impl(VM&, FunctionObject&, ReadonlySpan<Value> arguments = {}, FunctionObject* new_target = nullptr);
|
||||||
ThrowCompletionOr<size_t> length_of_array_like(VM&, Object const&);
|
ThrowCompletionOr<size_t> length_of_array_like(VM&, Object const&);
|
||||||
ThrowCompletionOr<MarkedVector<Value>> create_list_from_array_like(VM&, Value, NOESCAPE Function<ThrowCompletionOr<void>(Value)> = {});
|
ThrowCompletionOr<MarkedVector<Value>> create_list_from_array_like(VM&, Value, Function<ThrowCompletionOr<void>(Value)> = {});
|
||||||
ThrowCompletionOr<FunctionObject*> species_constructor(VM&, Object const&, FunctionObject& default_constructor);
|
ThrowCompletionOr<FunctionObject*> species_constructor(VM&, Object const&, FunctionObject& default_constructor);
|
||||||
ThrowCompletionOr<Realm*> get_function_realm(VM&, FunctionObject const&);
|
ThrowCompletionOr<Realm*> get_function_realm(VM&, FunctionObject const&);
|
||||||
ThrowCompletionOr<void> initialize_bound_name(VM&, DeprecatedFlyString const&, Value, Environment*);
|
ThrowCompletionOr<void> initialize_bound_name(VM&, DeprecatedFlyString const&, Value, Environment*);
|
||||||
|
|
|
@ -168,7 +168,7 @@ public:
|
||||||
|
|
||||||
// 14.7.5 The for-in, for-of, and for-await-of Statements
|
// 14.7.5 The for-in, for-of, and for-await-of Statements
|
||||||
|
|
||||||
Optional<Completion> enumerate_object_properties(NOESCAPE Function<Optional<Completion>(Value)>) const;
|
Optional<Completion> enumerate_object_properties(Function<Optional<Completion>(Value)>) const;
|
||||||
|
|
||||||
// Implementation-specific storage abstractions
|
// Implementation-specific storage abstractions
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static ThrowCompletionOr<NonnullGCPtr<Realm>> create(VM&);
|
static ThrowCompletionOr<NonnullGCPtr<Realm>> create(VM&);
|
||||||
static ThrowCompletionOr<NonnullOwnPtr<ExecutionContext>> initialize_host_defined_realm(VM&, NOESCAPE Function<Object*(Realm&)> create_global_object, NOESCAPE Function<Object*(Realm&)> create_global_this_value);
|
static ThrowCompletionOr<NonnullOwnPtr<ExecutionContext>> initialize_host_defined_realm(VM&, Function<Object*(Realm&)> create_global_object, Function<Object*(Realm&)> create_global_this_value);
|
||||||
|
|
||||||
void set_global_object(Object* global_object, Object* this_value);
|
void set_global_object(Object* global_object, Object* this_value);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
struct CustomData {
|
struct CustomData {
|
||||||
virtual ~CustomData() = default;
|
virtual ~CustomData() = default;
|
||||||
|
|
||||||
virtual void spin_event_loop_until(NOESCAPE JS::SafeFunction<bool()> goal_condition) = 0;
|
virtual void spin_event_loop_until(JS::SafeFunction<bool()> goal_condition) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
static ErrorOr<NonnullRefPtr<VM>> create(OwnPtr<CustomData> = {});
|
static ErrorOr<NonnullRefPtr<VM>> create(OwnPtr<CustomData> = {});
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
static RandomnessSource live() { return RandomnessSource(RandomRun(), true); }
|
static RandomnessSource live() { return RandomnessSource(RandomRun(), true); }
|
||||||
static RandomnessSource recorded(RandomRun const& run) { return RandomnessSource(run, false); }
|
static RandomnessSource recorded(RandomRun const& run) { return RandomnessSource(run, false); }
|
||||||
RandomRun& run() { return m_run; }
|
RandomRun& run() { return m_run; }
|
||||||
u64 draw_value(u64 max, NOESCAPE Function<u64()> random_generator)
|
u64 draw_value(u64 max, Function<u64()> random_generator)
|
||||||
{
|
{
|
||||||
// Live: use the random generator and remember the value.
|
// Live: use the random generator and remember the value.
|
||||||
if (m_is_live) {
|
if (m_is_live) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ ErrorOr<void> initialize_main_thread_vm();
|
||||||
JS::VM& main_thread_vm();
|
JS::VM& main_thread_vm();
|
||||||
|
|
||||||
void queue_mutation_observer_microtask(DOM::Document const&);
|
void queue_mutation_observer_microtask(DOM::Document const&);
|
||||||
NonnullOwnPtr<JS::ExecutionContext> create_a_new_javascript_realm(JS::VM&, NOESCAPE Function<JS::Object*(JS::Realm&)> create_global_object, NOESCAPE Function<JS::Object*(JS::Realm&)> create_global_this_value);
|
NonnullOwnPtr<JS::ExecutionContext> create_a_new_javascript_realm(JS::VM&, Function<JS::Object*(JS::Realm&)> create_global_object, Function<JS::Object*(JS::Realm&)> create_global_this_value);
|
||||||
void invoke_custom_element_reactions(Vector<JS::Handle<DOM::Element>>& element_queue);
|
void invoke_custom_element_reactions(Vector<JS::Handle<DOM::Element>>& element_queue);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,9 +137,9 @@ public:
|
||||||
int client_height() const;
|
int client_height() const;
|
||||||
[[nodiscard]] double current_css_zoom() const;
|
[[nodiscard]] double current_css_zoom() const;
|
||||||
|
|
||||||
void for_each_attribute(NOESCAPE Function<void(Attr const&)>) const;
|
void for_each_attribute(Function<void(Attr const&)>) const;
|
||||||
|
|
||||||
void for_each_attribute(NOESCAPE Function<void(FlyString const&, String const&)>) const;
|
void for_each_attribute(Function<void(FlyString const&, String const&)>) const;
|
||||||
|
|
||||||
bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
|
bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
|
||||||
Vector<FlyString> const& class_names() const { return m_classes; }
|
Vector<FlyString> const& class_names() const { return m_classes; }
|
||||||
|
|
|
@ -39,8 +39,8 @@ public:
|
||||||
TaskQueue& microtask_queue() { return *m_microtask_queue; }
|
TaskQueue& microtask_queue() { return *m_microtask_queue; }
|
||||||
TaskQueue const& microtask_queue() const { return *m_microtask_queue; }
|
TaskQueue const& microtask_queue() const { return *m_microtask_queue; }
|
||||||
|
|
||||||
void spin_until(NOESCAPE JS::SafeFunction<bool()> goal_condition);
|
void spin_until(JS::SafeFunction<bool()> goal_condition);
|
||||||
void spin_processing_tasks_with_source_until(Task::Source, NOESCAPE JS::SafeFunction<bool()> goal_condition);
|
void spin_processing_tasks_with_source_until(Task::Source, JS::SafeFunction<bool()> goal_condition);
|
||||||
void process();
|
void process();
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#termination-nesting-level
|
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#termination-nesting-level
|
||||||
|
|
|
@ -35,8 +35,8 @@ public:
|
||||||
return m_tasks.take_first();
|
return m_tasks.take_first();
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove_tasks_matching(NOESCAPE Function<bool(HTML::Task const&)>);
|
void remove_tasks_matching(Function<bool(HTML::Task const&)>);
|
||||||
JS::MarkedVector<JS::NonnullGCPtr<Task>> take_tasks_matching(NOESCAPE Function<bool(HTML::Task const&)>);
|
JS::MarkedVector<JS::NonnullGCPtr<Task>> take_tasks_matching(Function<bool(HTML::Task const&)>);
|
||||||
|
|
||||||
Task const* last_added_task() const;
|
Task const* last_added_task() const;
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@ public:
|
||||||
m_data.get<OwnPtr<Vector<Attribute>>>().clear();
|
m_data.get<OwnPtr<Vector<Attribute>>>().clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void for_each_attribute(NOESCAPE Function<IterationDecision(Attribute const&)> callback) const
|
void for_each_attribute(Function<IterationDecision(Attribute const&)> callback) const
|
||||||
{
|
{
|
||||||
VERIFY(is_start_tag() || is_end_tag());
|
VERIFY(is_start_tag() || is_end_tag());
|
||||||
auto* ptr = tag_attributes();
|
auto* ptr = tag_attributes();
|
||||||
|
@ -233,7 +233,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void for_each_attribute(NOESCAPE Function<IterationDecision(Attribute&)> callback)
|
void for_each_attribute(Function<IterationDecision(Attribute&)> callback)
|
||||||
{
|
{
|
||||||
VERIFY(is_start_tag() || is_end_tag());
|
VERIFY(is_start_tag() || is_end_tag());
|
||||||
auto* ptr = tag_attributes();
|
auto* ptr = tag_attributes();
|
||||||
|
|
|
@ -19,7 +19,7 @@ public:
|
||||||
|
|
||||||
virtual ~EventLoopPlugin();
|
virtual ~EventLoopPlugin();
|
||||||
|
|
||||||
virtual void spin_until(NOESCAPE JS::SafeFunction<bool()> goal_condition) = 0;
|
virtual void spin_until(JS::SafeFunction<bool()> goal_condition) = 0;
|
||||||
virtual void deferred_invoke(JS::SafeFunction<void()>) = 0;
|
virtual void deferred_invoke(JS::SafeFunction<void()>) = 0;
|
||||||
virtual NonnullRefPtr<Timer> create_timer() = 0;
|
virtual NonnullRefPtr<Timer> create_timer() = 0;
|
||||||
virtual void quit() = 0;
|
virtual void quit() = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue