summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-30AK: Make LexicalPath immutableMax Wipfli
This replaces the current LexicalPath::append() API with a new method that returns a new LexicalPath object and doesn't touch the this-object. With this, LexicalPath is now immutable. It also adds a LexicalPath::parent() method and the relevant test cases.
2021-06-30Tests: Rewrite tests for LexicalPathMax Wipfli
2021-06-30AK+Everywhere: Use mostly StringView in LexicalPathMax Wipfli
This changes the m_parts, m_dirname, m_basename, m_title and m_extension member variables to StringViews onto the m_string String. It also removes the m_is_absolute member in favour of computing if a path is absolute in the is_absolute() getter. Due to this, the canonicalize() method has been completely rewritten. The parts() getter still returns a Vector<String>, although it is no longer a const reference as m_parts is no longer a Vector<String>. Rather, it is constructed from the StringViews in m_parts upon request. The parts_view() getter has been added, which returns Vector<StringView> const&. Most previous users of parts() have been changed to use parts_view(), except where Strings are required. Due to this change, it's is now no longer allow to create temporary LexicalPath objects to call the dirname, basename, title, or extension getters on them because the returned StringViews will point to possible freed memory.
2021-06-30AK+Everywhere: Add and use static APIs for LexicalPathMax Wipfli
The LexicalPath instance methods dirname(), basename(), title() and extension() will be changed to return StringView const& in a further commit. Due to this, users creating temporary LexicalPath objects just to call one of those getters will recieve a StringView const& pointing to a possible freed buffer. To avoid this, static methods for those APIs have been added, which will return a String by value to avoid those problems. All cases where temporary LexicalPath objects have been used as described above haven been changed to use the static APIs.
2021-06-30AK: Remove the LexicalPath::is_valid() APIMax Wipfli
Since this is always set to true on the non-default constructor and subsequently never modified, it is somewhat pointless. Furthermore, there are arguably no invalid relative paths.
2021-06-30AK: Use east const style in LexicalPath.{cpp,h}Max Wipfli
2021-06-30Kernel/PCI: Keep track of the currently mapped bus in MMIO modeLuke
There is a check in map_bus_region to make sure we don't pointlessly remap the bus region if the previous mapping was for the same bus. This is tracked with `m_mapped_bus`. However, nothing was actually updating `m_mapped_bus`, and it is initialised to 0. This means that if we start with a device on bus 0, the read in data will be valid. If we map say bus 1 then bus 0 again, the map for bus 0 will now be ignored and invalid data will be read in. Fixed by updating `m_mapped_bus` with the currently mapped bus.
2021-06-30Kernel/PCI: Don't unmap determine_memory_mapped_bus_region after initLuke
This can be accessed after init via lspci.
2021-06-30LibGUI: Add PasswordBoxMax Wipfli
This patch adds a PasswordBox. At the moment, it's simply a TextBox with it's substitution code point set to '*', and the undo and redo actions disabled.
2021-06-30LibGUI: Add glyph substitution to TextEditorMax Wipfli
This patch adds the member variable m_substitution_code_point to GUI::TextEditor. If non-zero, all gylphs to be drawn will be substituted with the specified code point. This is mainly needed to support a PasswordBox. While the primary use-case is for single-line editors, multi-line editors are also supported. To prevent repeated String construction, a m_substitution_string_data members has been added, which is an OwnPtr<Vector<u32>>. This is used as a UTF-32 string builder. The substitution_code_point_view method uses that Vector to provide a Utf32View of the specified length.
2021-06-30LibGUI: Fix double-clicking words in syntax-highlighted textMax Wipfli
This patch fixes a bug where double-clicking on a word in a TextEditor with syntax highlighting would also select an additional character after the word. This also simplifies the logic for double- and triple-clicking.
2021-06-30LibVideo: Migrate to east-const style & apply other minor fixesFalseHonesty
This patch brings all of LibVideo up to the east-const style in the project. Additionally, it applies a few fixes from the reviews in #8170 that referred to older LibVideo code.
2021-06-30LibVideo/VP9: Implement most of block_mode_info methods (6.4.15-6.4.18)FalseHonesty
2021-06-30LibVideo/VP9: Implement most of inter_frame_mode_info (6.4.11-6.4.14)FalseHonesty
2021-06-30LibVideo/VP9: Implement intra_frame_mode_info procedure (6.4.6)FalseHonesty
2021-06-30LibVideo/VP9: Add SAFE_CALL macro to help propagate failure stateFalseHonesty
2021-06-30LibVideo/VP9: Refactor how TreeParser accesses decoder dataFalseHonesty
The TreeParser requires information about a lot of the decoder's current state in order to parse syntax tree elements correctly, so there has to be some communication between the Decoder and the TreeParser. Previously, the Decoder would copy its state to the TreeParser when it changed, however, this was a poor choice. Now, the TreeParser simply has a reference to its owning Decoder, and accesses its state directly.
2021-06-30LibVideo/VP9: Begin decoding VP9 blocksFalseHonesty
2021-06-30LibVideo/VP9: Successfully parse partition syntax elementFalseHonesty
2021-06-30LibVideo/VP9: Begin creating a tree parser to parse syntax elementsFalseHonesty
2021-06-30LibVideo/VP9: Begin decoding tilesFalseHonesty
2021-06-30LibVideo/VP9: Parse compressed header dataFalseHonesty
This patch adds compressed header parsing to the VP9 decoder (section 6.4 of the spec). This is the final decoder step before we can start to decode tiles.
2021-06-30Kernel: Give Devices without a custody a less fake absoulte_pathAndrew Kaster
This hack allows self-test mode run-tests-and-shutdown.sh to give TestProcFs a stat(2)-able /proc/self/fd/0. For some reason, when stdin is a SerialDevice, /proc/self/fd/0 will be a symlink to the device as expected, but, calling realpath or stat on /proc/self/fd/0 will error out. realpath will give the string from Device::absolute_path() which would be something like "device:4,64 (SerialDevice)". When VFS is trying to resolve_path so that we can stat the file, it would bail out on this fake-y path. Change the fake path (that doesn't show up when you ls a device, nor when checking the devices tab in SystemMonitor) from the major/minor device number and class_name() to /dev/device_name(). There's probably a very hairy yak standing behind this issue that was only discovered due to the ProcFS rework.
2021-06-30Userland: Unlink file after waiting for child in run-testsAndrew Kaster
TestProcFs expects to be able to stat its stdout and stderr. The new ProcFS implemetnation properly forwards the symlinks for /proc/pid/fd/[1,2] to the temporary file that we had unlinked prior to spawning the process. However, this makes it so that a normal stat on the symlink to that file fails (as expected). Move the unlink to after we've waited on the child, so that we know it won't be trying any funny business with its stdout/stderr anymore.
2021-06-30Base+Utilities: Add run-tests program to run system tests with LibTestAndrew Kaster
This test program heavily pulls from the JavaScriptTestRunner/test-js, but with a twist. Instead of loading JavaScript files into the current process, constructing a JS environment for them, and executing test suites/tests directly, run-tests posix_spawns each test file. Test file stdout is written to a temp file, and only dumped to console if the test fails or the verbose option is passed to the program. Unlike test-js, times are always printed for every test executed for better visibility in CI.
2021-06-30Userland+Tests: Split out generic test runner from JS TestRunnerAndrew Kaster
Split out the functionality to gather multiple tests from the filesystem and run them in turn into Test::TestRunner, and leave the JavaScript specific test harness logic in Test::JS::TestRunner and friends.
2021-06-30Tests: TestProcFs cannot assume stdin/stdout/stderr are the sameAndrew Kaster
If someone runs the test with shell redirection going on, or in a way that changes any of the standard file descriptors this assumption will not hold. When running from a terminal normally, it is true however. Instead, check that /proc/self/fd/[0,1,2] are symlinks, and can be stat-d by verifying that both stat and lstat succeed, and give different struct stat contents.
2021-06-30LibRegex: Make regex::Regex move-constructible and move-assignableAndrew Kaster
For some reason the default move constructor and default move-assign operator were deleted, so we explicitly default them instead.
2021-06-30LibCore: Add getter for how many groups exist in a Core::ConfigFileAndrew Kaster
This can be used by an application to find out if any config sections were loaded from the file after a reparse.
2021-06-29LibJS: Handle the different realms case in ArraySpeciesCreatedavidot
2021-06-29LibWeb: Fix build breakage after merging the oldish DOM inspector PRAndreas Kling
2021-06-29Kernel: ProcFS and SysFS component indices should be InodeIndexAndreas Kling
This fixes the x86_64 kernel build. :^)
2021-06-29LibWeb+Browser: Support DOM Inspector for OutOfProcessWebViewAdam Hodgen
This introduces a new DOMTreeJSONModel, which provides the Model for the InspectorWidget when the Browser is running using the OutOfProcessWebView. This Model is constructed with a JSON object received via IPC from the WebContentServer.
2021-06-29LibWeb+WebContent: Add IPC flow for Inspect DOM TreeAdam Hodgen
Add `inspect_dom_tree` to WebContentServer and 'did_get_dom_tree' to WebContentClient. These two async methods form a request & response for requesting a JSON representation of the Content's DOM tree.
2021-06-29LibWeb: Add JSON serialization method to DOM::NodeAdam Hodgen
This method builds a JSON object representing the full state of the DOM tree. The JSON that is built will be used for building the DOM Inspector widget for the OutOfProcessWebView.
2021-06-30LibHTTP: Finish the request up on TLS connection finishAli Mohammad Pur
...unless it has already been done. Otherwise we'd be spinning in RequestServer waiting for more read events.
2021-06-30Meta: Add my emails to .mailmapMax Wipfli
2021-06-29Kernel: Make sure JSON blobs in core dumps are correctly terminatedAndreas Kling
I regressed this in 648480f715180c92c467abf8477c4eb2675107b0. We have to make sure JsonObjectSerializer::finish() is called before writing out the blob. This is done automatically when the serializer is destroyed, so just wrap them in scopes.
2021-06-30SoundPlayer: Don't limit duration inference to WAV filesngc6302h
2021-06-30FileIconProvider: Use sound icon for flac file extensionngc6302h
2021-06-30LaunchServer: Add flac file association to /bin/SoundPlayerngc6302h
2021-06-29Kernel+AK: Don't compile JSON parser into the kernelAndreas Kling
The kernel doesn't consume JSON, it only produces it. So there's no need for the kernel to have a JSON parser built into it. :^)
2021-06-29Kernel: Remove some unnecessary JSON related includesAndreas Kling
2021-06-29Kernel: Use JsonObjectSerializer in the core dump generation codeAndreas Kling
2021-06-29Kernel: Don't create a JsonArray when generating /proc/cpuinfoAndreas Kling
2021-06-29LibGUI: Don't allocate a scope-local MouseEvent on the heapAli Mohammad Pur
This fixes the build by hiding the problem from the compiler, but it's a useful change in and of itself anyway. A malloc/free per every mouse event is pretty annoying, especially when we can actually avoid it.
2021-06-29Kernel/ProcFS: Tighten modified time value across the filesystem objectsLiav A
It didn't make any sense to hardcode the modified time of all created inodes with "mepoch", so we should query the procfs "backend" to get the modified time value. Since ProcFS is dynamically changed all the time, the modified time equals to the querying time. This could be changed if desired, by making the modified_time() method virtual and overriding it in different procfs-backed objects :)
2021-06-29Kernel/ProcFS: Tighten permissions on the exposed objectsLiav A
This is needed so we properly set the limits for different objects in the filesystem.
2021-06-29Kernel/ProcFS: Split code into more separate filesLiav A
Instead of using one file for the entire "backend" of the ProcFS data and metadata, we could split that file into two files that represent 2 logical chunks of the ProcFS exposed objects: 1. Global and inter-process information. This includes all fixed data in the root folder of the ProcFS, networking information and the bus folder. 2. Per-process information. This includes all dynamic data about a process that resides in the /proc/PID/ folder. This change makes it more easier to read the code and to change it, hence we do it although there's no technical benefit from it now :)
2021-06-29Kernel: Don't copy a Vector<FileDescriptionAndFlags>Liav A
Instead of copying a Vector everytime we need to enumerate a Process' file descriptions, we can just temporarily lock so it won't change.