summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-11-29LibJS: Add AsyncFromSyncIteratorPrototype and Async-From-Sync instancesdavidot
Until we have actual iterator records we have to store the sync iterator as the raw object.
2021-11-29LibJS: Move the TRY_OR_REJECT macro to PromiseReactiondavidot
Also fixes that we ignored the result of the Call which we shouldn't according to the spec.
2021-11-29LibJS: Add AsyncIteratorPrototypedavidot
2021-11-29LibIPC: Mark m_sockfd as maybe_unused on non Serenity platformsdavidot
2021-11-29LibIPC: Replace u32/u64 value coders with u/ul/ull value codersAndreas Kling
We can and should do more cleanups of this kind, but this is a quick fix to unbreak the 32-bit HackStudio build.
2021-11-28LibCore: Add syscall wrapper for dup()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-28LibCore: Add syscall wrappers for sendfd() and recvfd()Andreas Kling
2021-11-28LibIPC: Give MessageBuffer::fds some inline capacity (1)Andreas Kling
This dodges a heap allocation when sending 0 or 1 fd across the IPC boundary (which covers every message.)
2021-11-28LibAudio: Optimize sample moves in FlacLoaderkleines Filmröllchen
As long as possible, entire decoded frame sample vectors are moved into the output vector, leading to up to 20% speedups by avoiding memmoves on take_first.
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-28LibAudio: Buffer API improvementskleines Filmröllchen
This consists of two changes: First, a utility function create_empty allows the user to quickly create an empty buffer. Second, most creation functions now return a NonnullRefPtr, as their failure causes a VERIFY crash anyways.
2021-11-28LibAudio: Avoid frequent read() calls in FLAC residual decodekleines Filmröllchen
Decoding the residual in FLAC subframes is by far the most I/O-heavy operation in FLAC decoding, as the residual data makes up the majority of subframe data in LPC subframes. As the residual consists of many Rice-encoded numbers with different bit sizes for differently large numbers, the residual decoder frequently reads only one or two bytes at a time. As we use a normal FileInputStream, that directly translates to many calls to the read() syscall. We can see that the I/O overhead while FLAC decoding is quite large, and much time is spent in the read() syscall's kernel code. This is optimized by using a Buffered<FileInputStream> instead, leading to 4K blocks being read at once and a large reduction in I/O overhead. Benchmarking with the new abench utility gives a 15-20% speedup on identical files, usually pushing FLAC decoding to 10-15x realtime speed on common sample rates.
2021-11-28LibGL: Initialize all GL context matrices with the identity matrixStephan Unverwerth
2021-11-28LibC: Make SIZE_MAX be understood by the preprocessorDaniel Bertalan
POSIX mandates that the macros contained in `stdint.h` be suitable for use by the C preprocessor. If we write `((size_t)-1)`, the C preprocessor will just skip the cast and treat the value as `-1`. This means that we end up taking the wrong branch in an `#if` directive like `#if SIZE_MAX > UINT32_MAX`. This fixes building the LLVM port on i686.
2021-11-28LibC: Fix stdint.h macros on x86_64Daniel Bertalan
x86_64 is an LP64 platform, so its `uint64_t` type is defined to be `unsigned long`, not `unsigned long long` like on i686. This means that the `UL` literal suffix should be used instead of `ULL`. Furthermore, `uintptr_t` is 64 bits wide on x86_64, so defining `UINTPTR_MAX` to be `UINT32_MAX` is also not correct.
2021-11-28LibC: Add definition for ENOTRECOVERABLEDaniel Bertalan
This is used by the LLVM port.
2021-11-28LibGL: Implement `glScissor()`Jelle Raaijmakers
2021-11-28LibJS: Spin the event loop while waiting for async completion in `await`Ali Mohammad Pur
2021-11-28LibJS: Implement parsing of TemporalDurationStringLinus Groh
2021-11-28LibGUI: Move GUI::SettingsWindow setup out of the constructorAndreas Kling
In order to propagate errors that occur during UI setup, we have to move all that logic out of widget/window subclass constructors. This is a first attempt at doing that, for GUI::SettingsWindow.
2021-11-28LibGUI: Add fallible variants of the GUI::Layout add/insert APIsAndreas Kling
2021-11-28LibGUI: Make GUI::SettingsWindow::add_tab() return ErrorOrAndreas Kling
This allows us to use TRY() when creating settings UI.
2021-11-28LibGUI: Make GUI::TabWidget tab creation APIs take StringAndreas Kling
Ultimately we'd like the caller to provide a String if possible (instead of a StringView) as we're going to end up storing it.
2021-11-28LibCore: Allow System::pledge execpromises argument to be omittedBrian Gianforcaro
It appears that we don't have almost no cases of a callers passing exec promises when they call `pledge()`. To simplify the code a bit we add a default parameter that will pass nullptr for us to `pledge()`.
2021-11-28LibCore+cat: Switch Core::System::read/write to take a Span of bytesBrian Gianforcaro
In the spirit of the Core::System name space having "modern" facades for classically C functions / Kernel interfaces, it seems appropriate that we should take Span's of data instead of raw pointer + length arguments.
2021-11-27LibJS: Parse TemporalInstantString as part of TemporalCalendarStringLinus Groh
2021-11-27LibJS: Implement Temporal.PlainYearMonth.prototype.since()Linus Groh
2021-11-27LibJS: Implement Temporal.PlainYearMonth.prototype.until()Linus Groh
2021-11-27LibJS: Implement Temporal.PlainYearMonth.prototype.subtract()Linus Groh
2021-11-27LibJS: Implement Temporal.PlainYearMonth.prototype.add()Linus Groh
2021-11-27LibGUI: Add a cancel button callback to settings window tabskleines Filmröllchen
Some settings tabs, like the ones on the upcoming terminal settings, need to know when the cancel button is pressed to clean up things like temporary live updates. Therefore, the SettingsWindow::Tab now features a cancel_settings callback which does not need to be implemented.
2021-11-27LibCore: Add syscall wrapper for gethostname()Kenneth Myhra
2021-11-27LibJS: Throw InternalErrors instead of Errors on CallStackSizeExceededIdan Horowitz
These seem more appropriate.
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-26LibCore: Add Vector<StringView> variant of add_positional_argument()Andreas Kling
2021-11-24SoundPlayer+LibDSP: Move the FFT implementation to LibDSPkleines Filmröllchen
LibDSP can greatly benefit from this nice FFT implementation, so let's move it into the fitting library :^) Note that this now requires linking SoundPlayer against LibDSP. That's not an issue (LibDSP is rather small currently anyways), as we can probably make great use of it in the future anyways.
2021-11-24LibCore: Add syscall wrapper for ptsname()Andreas Kling
2021-11-24LibCore: Add syscall wrapper for dup2()Andreas Kling
2021-11-24LibCore: Add syscall wrapper for pipe2()Andreas Kling
2021-11-24LibGUI: Add GUI::Toolbar::try_add_separator()Andreas Kling
This is a fallible variant of add_separator() that returns ErrorOr.
2021-11-24LibGUI: Add GUI::Menu::try_add_submenu()Andreas Kling
This is a fallible variant of add_submenu() that returns ErrorOr.
2021-11-24LibWeb: Use a string instead of an internal Parser class in SupportsSam Atkins
Now that we can serialize CSS tokens, we can just hold a string and then re-parse it when the Supports is evaluated. This feels a little weird, but it only happens once so it's not going to slow it down much, and it keep the API cleaner.
2021-11-24LibWeb: Add <general-enclosed> support to Media QueriesSam Atkins
2021-11-24LibWeb: Use MatchResults for MediaQuery evaluationSam Atkins
2021-11-24LibWeb: Use new GeneralEnclosed class in SupportsSam Atkins
2021-11-24LibWeb: Parse CSS `<general-enclosed>`Sam Atkins
2021-11-24LibWeb: Implement independent GeneralEnclosed classSam Atkins
This is `<general-enclosed>` in CSS grammar. It represents a section of a `@media` or `@supports` rule that exists in some future standard that we don't understand yet, but don't want to make the entire rule invalid. There's not much that it can usefully do, but we store a string representation of its contents so that it can be serialized out.
2021-11-24LibWeb: Make StyleRule to_string() methods output valid CSSSam Atkins
Also removed unused `append_raw()` function.