Commit graph

34549 commits

Author SHA1 Message Date
kleines Filmröllchen
01d056f794 Base: Document /dev/audio devices
This properly documents the fact that /dev/audio contains a bunch of
device's channels now, instead of being a single file.
2022-02-17 14:45:39 +03:30
networkException
3052c0578c LibVT: Properly populate context menu with open actions
We would previously overwrite m_hovered_href with tooltip texts instead
of leaving it as an url as was expected by the context menu event
handler.
2022-02-17 11:56:38 +01:00
Tim Schumacher
17f5eb558c Ports: Set the correct config.sub path for patch 2022-02-17 11:16:38 +01:00
Tim Schumacher
abb9e3e198 Ports: Set the correct config.sub path for mpc 2022-02-17 11:16:38 +01:00
Daniel Bertalan
f3923b4aea LibWeb: Use public inheritance for the RefCounted base class
I forgot about this in the previous commit, which caused a compile
error.
2022-02-17 11:16:18 +01:00
Daniel Bertalan
bf16349c5b LibWeb: Fix -Wmismatched-tags warning from Clang 2022-02-17 09:57:17 +00:00
Isak Holmstrom
41765895a8 LibCore: Make FreeBSD build SerenityOS 2022-02-17 09:26:56 +00:00
Isak Holmstrom
4f716caa33 LibCore: Add FreeBSD as OpenBSD/Apple in System.cpp & System.h 2022-02-17 09:26:56 +00:00
Isak Holmstrom
8ad9f49de3 Documentation: Change/add two pkgs in the FreeBSD instructions 2022-02-17 09:26:56 +00:00
Tim Schumacher
95f33ffbec Ports: Disable socketpair support for curl
This is currently broken in Serenity. Disable it until we figure out
why.
2022-02-16 17:13:56 -08:00
Sam Atkins
e548aab387 LibCore: Migrate ConfigFile to Core::Stream API :^)
As part of this, moved the call to `reparse()` out of the constructor
and into the factory methods, to allow the error to propagate.
2022-02-16 19:49:41 -05:00
Sam Atkins
cd0ffe5460 LibCore+Everywhere: Return ErrorOr from ConfigFile::sync()
Currently this method always succeeds, but that won't be true once we
switch to the Core::Stream API. :^)

Some of these places would ideally show an error message to the user,
since failure to save a file is significant, but let's not get
distracted right now.
2022-02-16 19:49:41 -05:00
Sam Atkins
b90dc408bd LibCore: Create ConfigFiles with an already-open File
This moves the fallible action of opening the file, from the
constructor, into the factory methods which can propagate any errors.

The wrinkle here is that failure to open a ConfigFile in read-only mode
is allowed (and expected, since the file may not exist), and treated as
if an empty file was successfully opened.
2022-02-16 19:49:41 -05:00
Sam Atkins
8260135d4d LibCore+Everywhere: Return ErrorOr from ConfigFile factory methods
I've attempted to handle the errors gracefully where it was clear how to
do so, and simple, but a lot of this was just adding
`release_value_but_fixme_should_propagate_errors()` in places.
2022-02-16 19:49:41 -05:00
Sam Atkins
1a4dd47d5f AK: VERIFY inside release_value_but_fixme_should_propagate_errors()
While the code did already VERIFY that the ErrorOr holds a value, this
was done by Variant, so the error message was just that `has<T>()` is
false. This is less helpful than I would like, especially if backtraces
are not working and this is all you have to go on. Adding this extra
VERIFY means the assertion message (`!is_error()`) is easier to
understand.
2022-02-16 19:49:41 -05:00
Sam Atkins
decdd6b61a LibGUI: Add missing LibCore/File include
This was previously included via ConfigFile.h
2022-02-16 19:49:41 -05:00
Sam Atkins
2caaebcf41 Profiler: Add missing LibCore/File include
This was previously included via ConfigFile.h
2022-02-16 19:49:41 -05:00
Sam Atkins
4d5080388a LibCore+Tests: Add SeekableStream::truncate() 2022-02-16 19:49:41 -05:00
Sam Atkins
d9fb1b8c2e LibCore: Make ConfigFile parsing work for non-null-terminated strings
This is necessary for converting it to Core::Stream.
2022-02-16 19:49:41 -05:00
Linus Groh
c7f8c20f8b LibWeb: Omit origin check for content document in FrameBox::paint()
Once we paint, it's way too late for this check to happen anyway.

Additionally, the spec's steps for retrieving the content document
assume that both the browsing context's active document and the
container's node document are non-null, which evidently isn't always the
case here, as seen by crashes on the SerenityOS 2nd and 3rd birthday
pages (I'm not sure about the details though).

Fixes #12565.
2022-02-16 22:51:25 +00:00
Lenny Maiorani
27c30ca063 Games: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-16 22:08:55 +00:00
Andreas Kling
9521f71944 LibWeb: Support "useCapture" parameter to add/removeEventListener
This is not a complete implementation of API, since we're also supposed
to accept an options dictionary as the third argument. However, a lot of
web content uses the boolean variant, and it's trivial to support.
2022-02-16 22:21:45 +01:00
Andreas Kling
e76e8e22b5 LibWeb: Separate "event listener" from "EventListener"
I can't imagine how this happened, but it seems we've managed to
conflate the "event listener" and "EventListener" concepts from the DOM
specification in some parts of the code.

We previously had two things:

    - DOM::EventListener
    - DOM::EventTarget::EventListenerRegistration

DOM::EventListener was roughly the "EventListener" IDL type,
and DOM::EventTarget::EventListenerRegistration was roughly the "event
listener" concept. However, they were used interchangeably (and
incorrectly!) in many places.

After this patch, we now have:

    - DOM::IDLEventListener
    - DOM::DOMEventListener

DOM::IDLEventListener is the "EventListener" IDL type,
and DOM::DOMEventListener is the "event listener" concept.

This patch also updates the addEventListener() and removeEventListener()
functions to follow the spec more closely, along with the "inner invoke"
function in our EventDispatcher.
2022-02-16 22:21:45 +01:00
Andreas Kling
0e2cd5540a LibWeb: Follow HTTP 3xx redirections when loading images
This basically copies some logic from FrameLoader to ImageLoader.
Ideally we'd share this code, but for now let's just get redirected
images to show up. :^)
2022-02-16 22:21:45 +01:00
Idan Horowitz
df1670415d Kernel: Stop compiling AK::String and friends into the Kernel
Now that these are not used in the Kernel anymore, we can finally
remove them :^)
2022-02-16 22:21:37 +01:00
Idan Horowitz
cec669a89a AK: Exclude StringUtils String APIs from the Kernel
These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
4c6a1f4db2 AK: Exclude StringView String APIs from the Kernel
These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
8f093e91e0 AK: Exclude StringBuilder String APIs from the Kernel
These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
43e5c326e2 AK: Exclude JsonValue String APIs from the Kernel
These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
c73ef87fc7 Kernel+LibELF+LibVT: Remove unused AK::String header includes 2022-02-16 22:21:37 +01:00
Idan Horowitz
e95470702e AK: Use string_view() instead of to_string() in Formatter<wchar_t>
This let's us avoid a heap allocation.
2022-02-16 22:21:37 +01:00
Idan Horowitz
ccad3d5a39 LibVT: Use StringBuilder::string_view() instead of to_string()
This let's us avoid a heap allocation.
2022-02-16 22:21:37 +01:00
Idan Horowitz
b22cb40565 AK: Exclude GenericLexer String APIs from the Kernel
These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
410183a7b0 LibEDID: Exclude DMT::MonitorTiming::name() from the Kernel
This API is only used by userland and it uses infallible Strings, so
let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
3219ce3d61 AK: Return KString instead of String from encode_hex in the Kernel
This let's us propagate allocation errors from this API.
2022-02-16 22:21:37 +01:00
Idan Horowitz
d296001f3f LibELF: Exclude sorted symbols APIs from the Kernel
These are only used by userland, and are implemented using infallible
Strings, so let's just ifdef them out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
1616460312 LibELF: Exclude MemoryRegionInfo::object_name() from the Kernel
This API is only used by userland, and it uses infallible Strings, so
let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
7923b3b884 LibEDID: Exclude display_product_{name, serial_number} from the Kernel
These APIs return Strings, which are OOM-infallibe, and as such, not
appropriate for Kernel use. Since these APIs are only used by userland
at the moment, we can just ifdef them out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
13f5d1c037 LibEDID: Store manufacturer id instead of allocating on each call
This also let's us use a KString instead of a string when we're in the
Kernel, which opens the path for OOM-failure propagation.
2022-02-16 22:21:37 +01:00
Idan Horowitz
4a15ed6164 LibEDID: Store EDID version instead of allocating on each getter call
This also let's us use a KString instead of a string when we're in the
Kernel, which opens the path for OOM-failure propagation.
2022-02-16 22:21:37 +01:00
Idan Horowitz
5b572393a9 LibVT: Use NNOP<KString> to store window titles in the Kernel
This will allow us to eventually propagate allocation failure.
2022-02-16 22:21:37 +01:00
Idan Horowitz
c8db8d6152 LibCrypto: Exclude class_name() methods from the Kernel
These are only used by Userland and contain infallible String
allocations, so let's just ifdef them out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
6959e7f778 LibCrypto: Exclude AESCipher{Block, Key}::to_string() from the Kernel
These use infallible Strings and are not actually used in the Kernel,
so let's just ifdef them out for now.
2022-02-16 22:21:37 +01:00
Idan Horowitz
7bd409dbdf LibELF: Use StringBuilder::string_view() to avoid String allocation 2022-02-16 22:21:37 +01:00
Idan Horowitz
727fbca1a6 LibVT: Use StringBuilder's inline capacity instead of temporary Strings
This let's us avoid heap allocations.
2022-02-16 22:21:37 +01:00
Idan Horowitz
316fa0c3f3 AK+Kernel: Specialize Trie for NNOP<KString> and use it in UnveilNode
This let's us avoid the infallible String allocations.
2022-02-16 22:21:37 +01:00
Idan Horowitz
0218c62be4 Kernel: Make Process::procfs_get_pledge_stats OOM-fallible
We can completely avoid the string allocation by using string_view().
2022-02-16 22:21:37 +01:00
Idan Horowitz
7f44e54ad6 AK+Kernel: Return KString from UUID::to_string() in the Kernel
This lets us safely handle allocation failure.
2022-02-16 22:21:37 +01:00
Idan Horowitz
5a5766be2c Kernel: Remove useless partition UUID length check
UUID::to_string() always returns a string of length 36, so this check
can't fail.
2022-02-16 22:21:37 +01:00
Idan Horowitz
9277d2dce2 AK+Kernel: Return KString from MACAddress::to_string() in the Kernel
This lets us safely handle allocation failure.
2022-02-16 22:21:37 +01:00