summaryrefslogtreecommitdiff
path: root/Userland/Services
AgeCommit message (Collapse)Author
2021-12-25WindowServer: Skip over destroyed windows in WindowSwitcher::draw()Andreas Kling
I encountered a WindowServer crash due to null-pointer dereference in this function, so let's protect against it by simply skipping over nulled-out WeakPtrs. I added a FIXME about how we ideally wouldn't be in this situation in the first place, but that will require some more investigation.
2021-12-24AudioServer: Ignore 'muted' clients when computing the 'output mix'Elyse
2021-12-24AudioServer: Add a 'self_muted' state to each client connectionElyse
This new state will allow us to ignore muted clients when computing the 'output mix' in the Mixer.
2021-12-24AudioServer: Add 'mute' member and methods to ClientAudioStreamElyse
When computing the 'output mix', the Mixer iterates over all client audio streams and computes a 'mixed sample' taking into account mainly the client's volume. This new member and methods will allow us to ignore a muted client when computing that mix.
2021-12-24Everywhere: Refactor 'muted' to 'main_mix_muted' in all AudioConnectionsElyse
The 'muted' methods referred to the 'main mix muted' but it wasn't really clear from the name. This change will be useful because in the next commit, a 'self muted' state will be added to each audio client connection.
2021-12-24AudioServer/Mixer: Fix remaining samples underflowMax Trussell
The `m_remaining_samples` attribute was underflowing at the end of an audio stream. This fix guards against the underflow by only decrementing the attribute when it is greater than zero. I found this bug because the SoundPlayer userland application was not correctly detecting when an audio stream was completed. This was happening because the remaining samples being returned from the client audio connection was an underflowed 16 bit integer instead of zero.
2021-12-21Userland: Add unveil/pledge requisites for dynamic Unicode data loadingTimothy Flynn
Loading libunicodedata.so will require dlopen(), which in turn requires mmap(). The 'prot_exec' pledge is needed for this. Further, the .so itself must be unveiled for reading. The "real" path is unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so) itself cannot be unveiled.
2021-12-19SystemServer: Fixed grammatical error "a charm"Jonta
2021-12-16SystemServer: Use more LibCore syscall wrappers :^)Andreas Kling
2021-12-16SystemServer: Port to LibMain :^)Andreas Kling
2021-12-16LibCore+Userland: Convert TCPServer to use the Serenity Stream APIsin-ack
This is intended as a real-usecase test of the Serenity Stream API, and seemed like a good candidate due to its low amount of users.
2021-12-16LibCore+LookupServer: Implement and use UDPServer::sendsin-ack
2021-12-12Kernel+SystemServer: Add /dev/ttyDaniel Bertalan
This file refers to the controlling terminal associated with the current process. It's specified by POSIX, and is used by ports like openssh to interface with the terminal even if the standard input/output is redirected to somewhere else. Our implementation leverages ProcFS's existing facilities to create process-specific symbolic links. In our setup, `/dev/tty` is a symbolic link to `/proc/self/tty`, which itself is a symlink to the appropriate `/dev/pts` entry. If no TTY is attached, `/dev/tty` is left dangling.
2021-12-10Browser+LibWeb+WebContent: Add variables display to InspectorSam Atkins
This allows us to see which custom properties apply to a given element, which previously wasn't shown.
2021-12-08LibHTTP: Avoid implicitly copying ByteBufferBen Wiederhake
2021-12-07WebContent: Add missing TRY on client initializationHendiadyoin1
2021-12-06LibIPC: Add IPC::take_over_accepted_client_from_system_server<Client>()Andreas Kling
This is an encapsulation of the common work done by all of our single-client IPC servers on startup: 1. Create a Core::LocalSocket, taking over an accepted fd. 2. Create an application-specific ClientConnection object, wrapping the socket. It's not a huge change in terms of lines saved, but I do feel that it improves expressiveness. :^)
2021-12-06LibIPC: Add IPC::MultiServer convenience classAndreas Kling
This encapsulates what our multi-client IPC servers typically do on startup: 1. Create a Core::LocalServer 2. Take over a listening socket file descriptor from SystemServer 3. Set up an accept handler for incoming connections IPC::MultiServer does all this for you! All you have to do is provide the relevant client connection type as a template argument.
2021-12-06LibCore: Make LocalServer::take_over_from_system_server() return ErrorOrAndreas Kling
This allows us to use TRY() or MUST() when calling it.
2021-12-06SQLServer: Port to LibMain :^)Andreas Kling
2021-12-06LaunchServer: Port to LibMain :^)Andreas Kling
2021-12-05DHCP4Client: Cast unused Timer return values to voidSam Atkins
Timers attach themselves to the provided parent, so they are safely kept alive.
2021-12-05Userland: Cast unused BackgroundAction::construct() results to voidSam Atkins
User code does not need to keep this alive, so casting to void is safe. But maybe a bit weird.
2021-12-05Services: Cast unused IPC::new_client_connection() results to voidSam Atkins
These ones all manage their storage internally, whereas the WebContent and ImageDecoder ones require the caller to manage their lifetime. This distinction is not obvious to the user without looking through the code, so an API that makes this clearer would be nice.
2021-12-04LibSQL: Improve error handlingJan de Visser
The handling of filesystem level errors was basically non-existing or consisting of `VERIFY_NOT_REACHED` assertions. Addressed this by * Adding `open` methods to `Heap` and `Database` which return errors. * Changing the interface of methods of these classes and clients downstream to propagate these errors. The constructors of `Heap` and `Database` don't open the underlying filesystem file anymore. The SQL statement handlers return an `SQLErrorCode::InternalError` error code if an error comes back from the lower levels. Note that some of these errors are things like duplicate index entry errors that should be caught before the SQL layer attempts to actually update the database. Added tests to catch attempts to open weird or non-existent files as databases. Finally, in between me writing this patch and submitting the PR the AK::Result<Foo, Bar> template got deprecated in favour of ErrorOr<Foo>. This resulted in more busywork.
2021-11-30LookupServer: Remove unused this capture in a lambda functionHendiadyoin1
this was causing CI to fail
2021-11-30KeyboardPreferenceLoader: Use Core::System::ioctl()Andreas Kling
2021-11-30DHCPClient: Port to LibMain :^)Andreas Kling
2021-11-30KeyboardPreferenceLoader: Port to LibMain :^)Andreas Kling
2021-11-30AudioServer: Port to LibMain :^)Andreas Kling
2021-11-30ChessEngine: Port to LibMain :^)Andreas Kling
2021-11-30InspectorServer: Port to LibMain :^)Andreas Kling
2021-11-30LibCore: Change Core::LocalServer::on_ready_to_accept => on_acceptAndreas Kling
Everyone used this hook in the same way: immediately accept() on the socket and then do something with the newly accepted fd. This patch simplifies the hook by having LocalServer do the accepting automatically.
2021-11-30WebContent: Remove unnecessary client mapAndreas Kling
WebContent processes only serve a single client, so we don't need to keep a map of them.
2021-11-30ImageDecoder: Remove unnecessary client mapAndreas Kling
ImageDecoder processes only serve a single client, so we don't need to keep a map of them.
2021-11-30Kernel: Register Virtio console ports with device managementJelle Raaijmakers
Previously, Virtio console ports would not show up in `/sys/dev/char/`. Also adds support to `SystemServer` to create more than one console port device in `/dev/` in the multiport case.
2021-11-29ImageDecoder: Fix assertion after failed decodeAndreas Kling
We were calling value() on an ErrorOr containing an error when trying to extract the frame duration after a failed decode. This fixes ImageDecoder crashing on various websites.
2021-11-28SpiceAgent: Port to LibMain :^)Andreas Kling
2021-11-28LibIPC+IPCCompiler+AK: Make IPC value decoders return ErrorOr<void>Andreas Kling
This allows us to use TRY() in decoding helpers, leading to a nice reduction in line count.
2021-11-28LibIPC: Make IPC::Connection::post_message() return ErrorOrAndreas Kling
2021-11-28LibAudio: New error propagation API in Loader and Bufferkleines Filmröllchen
Previously, a libc-like out-of-line error information was used in the loader and its plugins. Now, all functions that may fail to do their job return some sort of Result. The universally-used error type ist the new LoaderError, which can contain information about the general error category (such as file format, I/O, unimplemented features), an error description, and location information, such as file index or sample index. Additionally, the loader plugins try to do as little work as possible in their constructors. Right after being constructed, a user should call initialize() and check the errors returned from there. (This is done transparently by Loader itself.) If a constructor caused an error, the call to initialize should check and return it immediately. This opportunity was used to rework a lot of the internal error propagation in both loader classes, especially FlacLoader. Therefore, a couple of other refactorings may have sneaked in as well. The adoption of LibAudio users is minimal. Piano's adoption is not important, as the code will receive major refactoring in the near future anyways. SoundPlayer's adoption is also less important, as changes to refactor it are in the works as well. aplay's adoption is the best and may serve as an example for other users. It also includes new buffering behavior. Buffer also gets some attention, making it OOM-safe and thereby also propagating its errors to the user.
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-26Userland: Use Core::ArgsParser's Vector<StringView> API everywhereAndreas Kling
...and remove the Vector<String> variant since there are no remaining users of this API.
2021-11-26WindowServer: Clear wallpaper if the requested path is emptyKarol Kosek
235f39e449 secretly added an if check that ignores all the files that couldn't be loaded into bitmaps. Unfortunately, we send an empty path as a way to unset the wallpaper, which meant that we couldn't go back to the default background color anymore.
2021-11-24Kernel: Allow higher audio sample rates than 65kHZ (`u16`)Jelle Raaijmakers
Executing `asctl set r 96000` no longer results in weird sample rates being set on the audio devices. SB16 checks for a sample rate between 1 and 44100 Hz, while AC97 implements double-rate support which allows sample rates between 8kHz and 96kHZ.
2021-11-24WebContent: Support inspection of DOM in nested browsing contextsVyacheslav Pukhanov
This lets user select a node from a nested browsing context in the Inspector (e.g. a node inside an `iframe` document) to highlight it on the page.
2021-11-24CrashDaemon: Port to LibMain :^)Andreas Kling
2021-11-24Clipboard: Port to LibMain :^)Andreas Kling
2021-11-23LookupServer: Port to LibMain :^)Andreas Kling
2021-11-23NotificationServer: Port to LibMain :^)Andreas Kling