1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:08:10 +00:00
serenity/Userland/Libraries/LibWeb/Fetch/Fetching
Timothy Flynn 604d5f5bca AK+Everywhere: Do not implicitly copy variables in TRY macros
For example, consider cases where we want to propagate errors only in
specific instances:

    auto result = read_data(); // something like ErrorOr<ByteBuffer>
    if (result.is_error() && result.error().code() != EINTR)
        continue;
    auto bytes = TRY(result);

The TRY invocation will currently copy the byte buffer when the
expression (in this case, just a local variable) is stored into
_temporary_result.

This patch binds the expression to a reference to prevent such copies.
In less trival invocations (such as TRY(some_function()), this will
incur only temporary lifetime extensions, i.e. no functional change.
2023-02-10 09:08:52 +00:00
..
Checks.cpp
Checks.h
Fetching.cpp AK+Everywhere: Do not implicitly copy variables in TRY macros 2023-02-10 09:08:52 +00:00
Fetching.h LibWeb: Implement most of the 'Fetching' AOs 2022-10-30 20:10:29 +00:00
PendingResponse.cpp LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr 2022-12-15 06:56:37 -05:00
PendingResponse.h LibWeb: Register PendingResponse with a Request to keep it alive 2022-11-01 20:14:12 +00:00
RefCountedFlag.cpp LibWeb: Implement most of the 'Fetching' AOs 2022-10-30 20:10:29 +00:00
RefCountedFlag.h LibWeb: Implement most of the 'Fetching' AOs 2022-10-30 20:10:29 +00:00