Age | Commit message (Collapse) | Author |
|
Due to 582c55a, both `must_set()` and `set()` should be providing the
same behavior. Not only is that a reason to remove `must_set()`, but
it also performs erroneous behavior since it inserts an element at
a specified index instead of modifying an element at that index.
|
|
Move all old usages to the more explicit `JsonArray:must_{append/set}`
|
|
To test:
```console
curl http://0.0.0.0:8000/session \
-H 'Content-Type: application/json' \
-d '{"capabilities": {}}'
curl http://0.0.0.0:8000/session/0/execute/sync \
-H 'Content-Type: application/json' \
-d '{"script": "return window;", "args": []}'
```
Which should result in:
```json
{
"value": {
"window-fcc6-11e5-b4f8-330a88ab9d7f":
"86307df6-e2f1-4175-85cb-77295ff90898"
}
}
```
|
|
Some of these are allocated upon initialization of the intrinsics, and
some lazily, but in neither case the getters actually return a nullptr.
This saves us a whole bunch of pointer dereferences (as NonnullGCPtr has
an `operator T&()`), and also has the interesting side effect of forcing
us to explicitly use the FunctionObject& overload of call(), as passing
a NonnullGCPtr is ambigous - it could implicitly be turned into a Value
_or_ a FunctionObject& (so we have to dereference manually).
|
|
Currently significant portion of requests coming to WebDriver server
fails with error while parsing json body because requests are parsed
when they are not complete yet.
This change solves this by waiting for more data to arrive if HTTP
request parser found that there is not enough data yet to parse
the whole request.
In the future we would probably want to move this logic to LibHTTP
because this problem is relevant for any HTTP server.
|
|
|
|
This fix addresses issue where, if request headers contain
"Connection: keep-alive", we keep socket open without letting client
know that we support keep-alive connections. This can result in a
large number of open and unused sockets.
|
|
|
|
|
|
|
|
|
|
Similar to POSIX read, the basic read and write functions of AK::Stream
do not have a lower limit of how much data they read or write (apart
from "none at all").
Rename the functions to "read some [data]" and "write some [data]" (with
"data" being omitted, since everything here is reading and writing data)
to make them sufficiently distinct from the functions that ensure to
use the entire buffer (which should be the go-to function for most
usages).
No functional changes, just a lot of new FIXMEs.
|
|
Removal of dummy execution context in
9aca54091a53b5b287096311a6bbcfdd21f42d2f caused a crash in
`execute_async_script` because of empty execution contexts stack
during `create_resolving_functions` call.
|
|
Let's make it clear that these functions deal with ASCII case only.
|
|
Also drop the try_ prefix from the fallible function, as it is no longer
needed to distinguish the two.
|
|
|
|
|
|
This changes the parameters parsed from a WebDriver HTTP request to
String for transferring over IPC. Conveniently, most locations these
were ultimately passed to only need a StringView.
|
|
This will allow easily surrounding operations that may fail due to OOM
with TRY. Note that we now also have to define a "normal" constructor
for WebDriver::Error in order to add the AK::Error constructor.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
This was refactored a bit incorrectly in d8fde14.
|
|
This matches the name used in the spec, and is unambiguous.
|
|
|
|
This is a preparatory step to making `get()` return `ErrorOr`.
|
|
|
|
If USING_AK_GLOBALLY is not defined, the name IsLvalueReference might
not be available in the global namespace. Follow the pattern established
in LibTest to fully qualify AK types in macros to avoid this problem.
|
|
This will silently make a copy. Rather than masking this behavior, let's
explicitly disallow it.
|
|
This makes construction of Utf16String fallible in OOM conditions. The
immediate impact is that PrimitiveString must then be fallible as well,
as it may either transcode UTF-8 to UTF-16, or create a UTF-16 string
from ropes.
There are a couple of places where it is very non-trivial to propagate
the error further. A FIXME has been added to those locations.
|
|
This fixes a few glitches. We no longer give the page double the width
it should have, and we mark the correct area of the page as needing
repainting.
|
|
In doing so, this removes all uses of the Encoder's stream operator,
except for where it is currently still used in the generated IPC code.
So the stream operator currently discards any errors, which is the
existing behavior. A subsequent commit will propagate the errors.
|
|
These instances were detected by searching for files that include
Array.h, but don't match the regex:
\\b(Array(?!\.h>)|iota_array|integer_sequence_generate_array)\\b
These are the three symbols defined by Array.h.
In theory, one might use LibCPP to detect things like this
automatically, but let's do this one step after another.
|
|
Currently, the generated IPC decoders will default-construct the type to
be decoded, then pass that value by reference to the concrete decoder.
This, of course, requires that the type is default-constructible. This
was an issue for decoding Variants, which had to require the first type
in the Variant list is Empty, to ensure it is default constructible.
Further, this made it possible for values to become uninitialized in
user-defined decoders.
This patch makes the decoder interface such that the concrete decoders
themselves contruct the decoded type upon return from the decoder. To do
so, the default decoders in IPC::Decoder had to be moved to the IPC
namespace scope, as these decoders are now specializations instead of
overloaded methods (C++ requires specializations to be in a namespace
scope).
|
|
This patch adds a stub implementation for the POST
/session/{session id}/element/{element id}/click endpoint.
|
|
|
|
|
|
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
|
|
|
|
This adds an "extension capability" for clients to indicate that a
headless browser should be used for the session.
|
|
This led to some fallout as many things in LibJS and LibWeb were pulling
in other things via CyclicModule.h
|
|
We don't completely implement version matching, and currently ignore the
"proxy" capability.
|
|
Still some TODOs here:
* We don't handle all capabilities (e.g. proxy)
* We don't match the capabilities against the running browser
But this will parse the capabilities JSON object received from the
WebDriver client.
|
|
The spec's text is pretty awkward here, but the way we've currently
transcribed it to C++ means we reject valid script timeouts. This meant
the following would fail:
TimeoutsConfiguration config {}; // Default values.
auto json = timeouts_object(config);
config = TRY(json_deserialize_as_a_timeouts_configuration(json));
|
|
|