summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-09-06LibC: Expand region for global destructors when it reaches capacityAndrew Kaster
In 553361d we started mprotecting the atexit handlers when they are not being modified or executed. As part of that commit, we unintentionally changed the max number of global destructors from 1024 to 256 (on x86, only 128 on x86_64). This patch expands the initial size of the global destructors page to 2 pages from 1, and allows the pool to be expanded at runtime by mapping a new set of pages and copying the AtExitEntries over.
2021-09-06LibJS: Handle possible allocation failure in ArrayBuffer(size_t)Ali Mohammad Pur
...by replacing it with a ctor that takes the buffer instead, and handling the allocation failure in ArrayBuffer::create(size_t) by throwing a RangeError as specified by the spec.
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-06Everywhere: Use OOM-safe ByteBuffer APIs where possibleAli Mohammad Pur
If we can easily communicate failure, let's avoid asserting and report failure instead.
2021-09-05LibJS: Use different stack space limit values for with and without ASANLinus Groh
Instead of having a single limit here, which we had to increase once to work with ASAN enabled, check whether HAS_ADDRESS_SANITIZER is defined and use 32 KiB, and 16 KiB otherwise (which is what we used previously). This idea is shamelessly stolen from V8: https://github.com/v8/v8/blob/b2b44af/src/execution/isolate.cc#L1381-L1387
2021-09-05LibJS: Prevent stack overflow if Proxy handler's __proto__ is the ProxyLinus Groh
Fixes #9322.
2021-09-05LibJS: Add ErrorType::CallStackSizeExceededLinus Groh
I'm about to add another use of this, so let's add an ErrorType for it instead of hardcoding the message for a third time.
2021-09-05RequestServer: Exit early to avoid executing protocol destructorsBrian Gianforcaro
I broke this when I made the protocol objects be wrapped by smart pointers to appease static analysis. The Protocol base class currently VERIFY's that it's never called. So to have the best of both worlds until someone actually fixes the code to do proper de-registration, just call `exit(..)` so the smart pointers never go out of scope.
2021-09-05Userland: Switch static_assert of type sizes to AK::AssertSizeBrian Gianforcaro
2021-09-05LibWeb+LibWasm: Implement the WebAssembly.Table objectAli Mohammad Pur
2021-09-05LibWasm: Move the vector size limit to Constants.h and increase it a bitAli Mohammad Pur
2021-09-05LibJS: Declare type aliases with "using" instead of "typedef"Brian Gianforcaro
2021-09-05Utilities: Modernize output and comparison in the sort utilityRalf Donau
Use the comparison operator of AK/String instead of strcmp(3) and replace fput* by outln.
2021-09-04SoundPlayer: Convert to double before calculatingKarol Kosek
freq_bin was converted to double after it was calculated, so there was a much higher probability it could be 0 instead of some comma number, which meant that the bars always stayed on top.
2021-09-04SoundPlayer: Simplify Bars Visualization drawing logic a bitKarol Kosek
The freq_bin in bins_per_group was multiplied only to be divided later, which could even result in a crash if you set higher buffer size (like 1000ms) in PlaybackManager, due to rounding errors I presume.
2021-09-04SystemMonitor: Fix CPU usage calculationTom
Casting u64 to float is probably not a safe thing to do. Also, keep time deltas in u64 values as they can easily wrap between calculations. This fixes CPU usage calculation when a process is spinning in a loop.
2021-09-04HackStudio: Drop files to the selected editorKarol Kosek
Previously, the files were opened in the current editor, instead of one that received a drop event.
2021-09-04LibGUI: Fixes modified indicator behavior after savingluiz
Pior to this change when the user added text after having saved the file the Text Editor wouldn't enable the modified flag, unless this new text was a new line. This happened because the UndoStack was merging the Command added by the new text with the old text one, and when is_current_modified() was called, the m_stack_index would not have been incremented, and it would return false. In this change was added a condition to verify if the modified tag is active, and the merge is only done if the document is already modified.
2021-09-04SoundPlayer: Create only one playlist widgetKarol Kosek
Prior this change, opening a playlist always spawned a new widget. This could end up with having a few the same widgets, which you couldn't even close (besides the last one).
2021-09-04AudioApplet: Fix initial mute stateKarol Kosek
During conversion from Core::ConfigFile to LibConfig in c646efaf49e2d79d7cbcabb561c62977f2f084d3, the requested key name has been changed from 'Mute' to 'Muted', resulting in using always the default value.
2021-09-04AK+LibRegex: Disable construction of views from temporary StringsIdan Horowitz
2021-09-04LibSymbolication: Unbreak symbolication with `-z separate-code` linkingAndreas Kling
We were incorrectly assuming that the mapped .text segment for an ELF image was always at the base of the image mapping. Now that we have .rodata mappings as well, it's possible for one of them to come before the .text.
2021-09-04LibELF: Name non-executable map regions ".rodata" instead of ".text"Andreas Kling
2021-09-04Assistant: Use HashMap::ensure() in Database::did_receive_results()Andreas Kling
2021-09-04SystemMonitor: Use HashMap::ensure() in ProcessModel::update()Andreas Kling
2021-09-04LibDebug: Use HashMap::ensure() in DebugInfo::prepare_lines()Andreas Kling
2021-09-04LibGfx: Make FontDatabase cache store fonts in NonnullRefPtrAndreas Kling
We don't cache failed font lookups, so there's no need for nullity here.
2021-09-04LookupServer: Use HashMap::ensure() in load_etc_hosts()Andreas Kling
2021-09-04LibJS: Implement Intl.DisplayNames.supportedLocalesOf()Linus Groh
2021-09-04LibJS: Add Array::create_from() for generic Vector<T>Linus Groh
It relies on a mapper function to convert each T& to a JS::Value. This allows us to avoid awkward Vector<T> to MarkedValueList conversion at the call site.
2021-09-04LibGfx: Intersect the bounding box with the main rect in draw_textsin-ack
Without this, the bounding rect for the text as generated by TextLayout can go beyond the bounds of the user-supplied drawing rect and cause the text to overlap because of the line_rect.intersect(rect) a few lines below.
2021-09-04LibGfx: Stop using a Utf8View that points to a temporary StringIdan Horowitz
2021-09-04LibGfx: Convert line text into a Utf8View before finding its directionIdan Horowitz
We were accidentally calling TextDirection::get_text_direction with a String instead of a UtfView, which meant each byte was treated as a codepoint, resulting in incorrect identification of text direction.
2021-09-04PixelPaint: Fix broken opening of files from ShellTobias Christiansen
The fd would get closed when the File went out of scope, so we couldn't open any file specified by 'pp <path to file>'. We need the fd to be alive and we solemnly swear to take good care of it and close it ourselves later.
2021-09-04SystemMonitor: Make memory statistics dynamically formatted by sizeDavid Isaksson
Previously all memory values on the performance was formatted as KiB, but with such formatting it can be quite hard to read large numbers (as mentioned by Andreas on todays office hours livestream :^)). This patch makes use of the human readable formatting utilies and displays them in an easier to read format.
2021-09-04LibGfx: Reject GIFs with ridiculously large symbolsBen Wiederhake
This also prevents exploitation by malicious GIFs. Found by OSS Fuzz, long-standing issue (since 259f8541fcd6bc147c9fb4c57b16cd840700af59) https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29034
2021-09-04LibGfx: Elide predictable reallocations in GIF loaderBen Wiederhake
2021-09-04LibJS: Implement Intl.Locale.prototype.minimizeTimothy Flynn
2021-09-04LibUnicode: Implement the Remove Likely Subtags methodTimothy Flynn
Unlike Add Likely Subtags, this method doesn't require generated data. Instead, it is defined in terms of Add Likely Subtags.
2021-09-04LibJS: Implement Intl.Locale.prototype.maximizeTimothy Flynn
2021-09-04LibJS: Add a constructor to create an Intl.Locale object from a LocaleIDTimothy Flynn
2021-09-04LibJS: Add missing Intl.Locale initializer for plain boolean typeTimothy Flynn
2021-09-04LibUnicode: Generate an implementation of the Add Likely Subtags methodTimothy Flynn
2021-09-04LibUnicode: Define is_unicode_*_subtag helpers inline in their headerTimothy Flynn
The UnicodeLocale generator will need to parse canonicalized locale strings, and will require using these methods. However, the generator cannot depend on LibUnicode because Locale.cpp within LibUnicode already depends on the generated file. Instead, defining the methods that the generator needs inline allows the generator to use them without linking against LibUnicode.
2021-09-04Utilities: Support grepping recursively from paths in the argumentKarol Kosek
Previously, the recursive flag always searched for file contents from the current directory, ignoring the path argument entirely.
2021-09-04Mandelbrot: Use the new Zoom cursorMustafa Quraish
It makes it really clear now that you can use the mouse to zoom when you see the zoom cursor.
2021-09-04PixelPaint: Use Zoom and Eyedropper cursorsMustafa Quraish
Use the newly added cursors for ZoomTool and PickerTool
2021-09-04Cursors: Add new Magnifying glass cursorMustafa Quraish
There are a few places in the system where this could be useful, such as PixelPaint and the MandelBrot demo. It seems general enough that it is probably useful to have it as a system-wide cursor rather than loading it manually each time.
2021-09-04Cursors: Add new Eyedropper cursorMustafa Quraish
This can be used immediately in PixelPaint (separate commit), but I am adding this as a system-wide cursor since it may also be useful for other applications that want to use it.
2021-09-04PixelPaint: Add invert filterMusab Kılıç