Commit graph

27724 commits

Author SHA1 Message Date
Liav A
aee4786d8e Kernel: Introduce the DeviceManagement singleton
This singleton simplifies many aspects that we struggled with before:
1. There's no need to make derived classes of Device expose the
constructor as public anymore. The singleton is a friend of them, so he
can call the constructor. This solves the issue with try_create_device
helper neatly, hopefully for good.
2. Getting a reference of the NullDevice is now being done from this
singleton, which means that NullDevice no longer needs to use its own
singleton, and we can apply the try_create_device helper on it too :)
3. We can now defer registration completely after the Device constructor
which means the Device constructor is merely assigning the major and
minor numbers of the Device, and the try_create_device helper ensures it
calls the after_inserting method immediately after construction. This
creates a great opportunity to make registration more OOM-safe.
2021-09-17 01:02:48 +03:00
Itamar
9aa6dd6b78 Kernel: Unblock tracer process in Process:unblock_waiters()
Since the tracer process may not be our parent process, we need to
explicitly unblock it (instead of the parent) if we are being traced.
2021-09-16 23:47:46 +02:00
Itamar
bb1ad759c5 Kernel: Allow calling sys$waitid on traced, non-child processes
Previously, attempting to call sys$waitid on non-child processes
returned ECHILD.

That prevented debugging non-child processes by attaching to them during
runtime (as opposed to forking and debugging the child, which is what
was previously supported).

We now allow calling sys$waitid on a any process that is being traced
by us, even if it's not our child.
2021-09-16 23:47:46 +02:00
Linus Groh
6b4777c558 LibJS: Convert prepare_temporal_fields() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
9ac426c906 LibJS: Convert to_positive_integer() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
2f56fd48ca LibJS: Convert parse_temporal_year_month_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
14f16d9ed4 LibJS: Convert parse_temporal_time_zone_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
0ccd11ba5f LibJS: Convert parse_temporal_time_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
f86fa12deb LibJS: Convert parse_temporal_duration_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
3c530dec5a LibJS: Convert parse_temporal_date_time_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
4cb6eaf588 LibJS: Convert parse_temporal_date_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
2e28f0b371 LibJS: Convert parse_temporal_calendar_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
4f487266b4 LibJS: Convert parse_temporal_instant_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
3112de6f35 LibJS: Convert parse_iso_date_time() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
8792fdfdf6 LibJS: Convert reject_temporal_calendar_type() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
8dd45a1ba2 LibJS: Convert validate_temporal_unit_range() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
448a364210 LibJS: Convert to_smallest_temporal_unit() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
92187591dd LibJS: Convert to_largest_temporal_unit() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
dd483d84f8 LibJS: Convert to_seconds_string_precision() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
f8f074f8a9 LibJS: Convert to_temporal_rounding_increment() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
65d26dd25e LibJS: Convert to_show_calendar_option() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
509d13cf67 LibJS: Convert to_temporal_rounding_mode() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
9f03647f1f LibJS: Convert to_temporal_overflow() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
b1e7e62657 LibJS: Convert get_string_or_number_option() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
8d6ac267dc LibJS: Convert Temporal::get_option() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
08dd1c3e2d LibJS: Convert get_options_object() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
f2b5ddd167 LibJS: Convert iterable_to_list_of_type() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
683e31e1ff LibJS: Convert to_integer_throw_on_infinity() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
fea27143e9 LibJS: Initialize value in ThrowCompletionOr<void> default constructor
Otherwise, TRY() will crash when calling release_value() on the empty
m_value Optional.
2021-09-16 22:34:24 +01:00
Ben Wiederhake
5f0f0ac413 crash: Don't test for qemu-unsupported feature
See #10042 for details. In short: qemu doesn't seem to implement that
feature, therefore the test correctly fails. However, that does not help
us, so we skip that test.
2021-09-16 20:51:24 +00:00
Ben Wiederhake
c680ef0a09 crash: Run automatically during CI 2021-09-16 20:51:24 +00:00
Ben Wiederhake
e8d37b7b17 crash: Check whether the msyscall mitigation actually works 2021-09-16 20:51:24 +00:00
Tobias Christiansen
f8ea730f29 LibWeb: Flexbox: Add default value for AlignItems
Previously there was no default value and wrapping broke when the
container didn't have a align-items specified.
2021-09-16 22:51:15 +02:00
Sam Atkins
6c992e5dce LibGfx: Don't try to paint 0px-wide lines
In some cases, we were infinite-looping when asked to paint something
with a thickness of '0', so now every Painter method that takes a
thickness, does a check for a thickness <= 0 and bails early. After all,
you can't draw something that's 0px wide. :^)
2021-09-16 22:30:33 +02:00
Sam Atkins
3964b81d2b LibWeb: Add for CSS fill/stroke/stroke-color properties for SVG
In the spec, `fill` and `stroke` are supposed to be a shorthands for
various properties. But since the spec is still a working draft, and
neither Firefox or Chrome support the `fill-color` or `stroke-color`
properties, we'll stick with `fill` and `stroke` as simple colors for
now.

Also, note that SVG expects things in "user units", and we are assuming
that 1px = 1 user unit for now.
2021-09-16 22:30:33 +02:00
Sam Atkins
2c8c56684b Base: Add CSS styles to SVG test page
SVG is styleable using CSS, so this adds an extra triangle to the page,
which is styled with CSS instead of attributes.
2021-09-16 22:30:33 +02:00
Marcus Nilsson
dc9b18da22 PixelPaint: Implement automatic scrolling in LayerListWidget
The previous implementation of automatic scrolling in LayerListWidget
relied on mousemove events to perform the scrolling, which didn't
produce the expected behavior. Instead use the new auto scroll timer.
2021-09-16 22:29:21 +02:00
Marcus Nilsson
eec411c508 LibGUI: Add a AutoScroll timer to AbstractScrollableWidget
This commit adds a timer to AbstractScrollableWidget that can be used
when implementing automatic scrolling. By overriding
on_automatic_scrolling_timer_fired() we can calculate the scrolling
delta when dragging objects, and redraw as needed. A helper function,
automatic_scroll_delta_from_position() gives us a delta that
we can use to calculate speed and direction. By default
m_autoscroll_threshold is 20 pixels from the edge, and gives a linear
change in scroll delta.
2021-09-16 22:29:21 +02:00
Marcus Nilsson
522119ab95 LibGUI: Implement is_min() & is_max() helpers to AbstractSlider 2021-09-16 22:29:21 +02:00
Ali Mohammad Pur
c7a99aafac LibJS: Use ScopePusher to correctly push the scope in for statements
We were previously pushing a scope but forgetting to actually set it as
the current scope.
2021-09-16 21:51:45 +02:00
Andreas Kling
63a0ebcc90 js: Add a simple loadJSON(path) built-in to load JSON from a file
This is very handy when you want to load data from /proc, for example.
2021-09-16 21:49:50 +02:00
Andrew Kaster
d0506730b8 Meta: Ensure BUILD_LAGOM is set when running serenity.sh test lagom
If the superbuild created the lagom binary directory, it won't set
BUILD_LAGOM=ON in the CMake cache for that binary directory. Insert a
check into build_target() to make sure that if the user explicitly asks
for the lagom target, we have all our ducks in a row.
2021-09-16 15:47:13 +00:00
Andrew Kaster
454a839f49 CI+Meta: Update Sonar Cloud CI job for new SuperBuild configuration
This requires exposing the `configure` step on the `serenity`
ExternalProject in the SuperBuild CMakeLists so that we can continue to
only build the generated sources and not the entire OS.
2021-09-16 15:47:13 +00:00
Andrew Kaster
a78f967b93 Documentation: Recommend setting PREFIX_PATH instead of INSTALL_PREFIX
This was straight up the wrong CMake variable to set. We care about
where the project will find Lagom, not where it wants to install its own
binaries to.
2021-09-16 15:47:13 +00:00
Andrew Kaster
04d91e90c2 Meta: Fix Lagom RPATH for non-Ubuntu Linux and macOS hosts
Multi-lib distros like Gentoo and Fedora install lagom-core.so into
lagom-install/lib64 rather than lib. Set the install RPATH based on
CMAKE_INSTALL_LIBDIR to avoid the wrong path being set in the binaries.

Also apply macOS specific RPATH rules to fix the build on that platform.
2021-09-16 15:47:13 +00:00
Brian Gianforcaro
951cd68979 Shell: Use default instead of an empty constructor/destructor
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
4a53c66b7f FileSystemAccessServer: Only compute basename when prompting
pvs-studio flagged this as a potential performance optimization,
we only need to compute the basename when it's used.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
677f227774 LibX86: Use default instead of an empty constructor/destructor
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
b9c53a096a LibVT: Use default instead of an empty constructor/destructor
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
744de5ec69 LibThreading: Use default instead of an empty constructor/destructor
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00