summaryrefslogtreecommitdiff
path: root/Userland/Services
AgeCommit message (Collapse)Author
2021-09-22WebContent: Pass an empty bitmap object if the pointer is nullKarol Kosek
Prior this commit we were always dereferencing the image bitmap pointer, even if it was null, which resulted in a crash when trying to open the context menu when an image wasn't loaded. Closes: #10178
2021-09-21CrashDaemon+CrashReporter: Streamline crash reporting a little bitAndreas Kling
Before this patch, this is what would happen after something crashed: 1. CrashDaemon finds a new coredump in /tmp 2. CrashDaemon compresses the new coredump (gzip) 3. CrashDaemon parses the uncompressed coredump and prints a backtrace 4. CrashDaemon launches CrashReporter 5. CrashReporter parses the uncompressed coredump (again) 6. CrashReporter unlinks the uncompressed coredump 7. CrashReporter displays a GUI This was taking quite a long time when dealing with large programs crashing (like Browser's WebContent processes.) The new flow: 1. CrashDaemon finds a new coredump in /tmp 2. CrashDaemon mmap()'s the (uncompressed) coredump 3. CrashDaemon launches CrashReporter 4. CrashDaemon goes to sleep for 3 seconds (hack alert!) 5. CrashReporter parses the (uncompressed) coredump 6. CrashReporter unlinks the (uncompressed) coredump 7. CrashReporter displays a GUI 8. CrashDaemon wakes up (after step 4) 9. CrashDaemon compresses the coredump (gzip) TL;DR: we no longer parse the coredumps twice, and we also prioritize launching the CrashReporter GUI immediately when a new coredump shows up, instead of compressing and parsing it in CrashDaemon first. The net effect of this is that you get a backtrace on screen much sooner. That's pretty nice. :^)
2021-09-20WindowServer: Apply screen scaling when getting bitmap around cursorDavid Isaksson
This fixes an issue for the magnifier that when the screen scaling is increased to 2 the magnifier doesn't center around the cursor. Since booting Serenity with multiple displays doesn't work at the moment the rescaling is only added for the one display case.
2021-09-19LibCore+RequestServer: Ignore callbacks for cancelled network jobsAli Mohammad Pur
Also cancel the jobs when they're destroyed. This makes sure that jobs whose owners have discarded don't end up crashing because of a did_fail().
2021-09-19RequestServer+LibHTTP+LibGemini: Cache connections to the same hostAli Mohammad Pur
This makes connections (particularly TLS-based ones) do the handshaking stuff only once. Currently the cache is configured to keep at most two connections evenly balanced in queue size, and with a grace period of 10s after the last queued job has finished (after which the connection will be dropped).
2021-09-16FileSystemAccessServer: Only compute basename when promptingBrian Gianforcaro
pvs-studio flagged this as a potential performance optimization, we only need to compute the basename when it's used.
2021-09-13FileOperation: Deduplicate destination file names on copyTetsui Ohkubo
When there is a file with the same name in the destination directory, FileManager overwrites that file without any warning. With this change, such a file will be automatically renamed to "emoji-2.txt", for example. Also, currently there is a check in FileManager that makes copy and paste of a file in the same directory no-op. This change removes that check, because it is no longer a problem.
2021-09-12AudioServer: Fix deadlock when playing two audio streamskleines Filmröllchen
Previously, AudioServer would deadlock when trying to play another audio stream, i.e. creating a queue. The m_pending_cond condition was used improperly, and the condition wait now happens independently of querying the pending queue for new clients if the mixer is running. To make the mixer's concurrency-safety code more readable, the use of raw POSIX mutex and condition syscalls is replaced with Threading::Mutex and Threading::ConditionVariable.
2021-09-12Audio: Add per-client volumekleines Filmröllchen
Note: While ClientAudioStream has had a volume property, it is only now used in the mixer.
2021-09-12AudioServer: Rename BufferQueue to ClientAudioStreamkleines Filmröllchen
Although the old name is more technically correct, it doesn't reflect what the class is actually doing in the context of the audio server logic.
2021-09-12Audio: Change how volume workskleines Filmröllchen
Across the entire audio system, audio now works in 0-1 terms instead of 0-100 as before. Therefore, volume is now a double instead of an int. The master volume of the AudioServer changes smoothly through a FadingProperty, preventing clicks. Finally, volume computations are done with logarithmic scaling, which is more natural for the human ear. Note that this could be 4-5 different commits, but as they change each other's code all the time, it makes no sense to split them up.
2021-09-12ChessEngine: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-12LibWeb+Browser: Add Debug menu action for toggling Same-Origin PolicyAndreas Kling
Sometimes it's useful to turn off the SOP for testing purposes. Let's make that easy by having a Debug menu item for it. :^)
2021-09-12WebContent: Use ErrorType::NotAnObjectOfType instead of NotATimothy Flynn
2021-09-11AK: Replace the mutable String::replace API with an immutable versionIdan Horowitz
This removes the awkward String::replace API which was the only String API which mutated the String and replaces it with a new immutable version that returns a new String with the replacements applied. This also fixes a couple of UAFs that were caused by the use of this API. As an optimization an equivalent StringView::replace API was also added to remove an unnecessary String allocations in the format of: `String { view }.replace(...);`
2021-09-11WindowServer: Add IPC endpoint to get the color under cursorMustafa Quraish
This allows any client to ask the WindowServer to give it the color of the screen bitmap under the cursor. There's currently no way to get the screen bitmap *without* the cursor already drawn on it, so for now we just take a pixel beside the actual cursor position to avoid just getting the cursors color.
2021-09-11Compositor: Add API to get the color of a pixelMustafa Quraish
This just returns the color of a given pixel position from the front bitmap of the corresponding screen.
2021-09-11LibWeb+WebContent: Add WebContentClient::did_request_scroll_to() callSam Atkins
This call sets the absolute scroll position for the window.
2021-09-11LibWeb+WebContent: Modify did_request_scroll() IPC to take x&y deltasSam Atkins
This is in preparation for implementing JS scrolling functions, which specify both x and y scrolling deltas. The visible behavior has not changed. Also, moved the "mouse wheel delta * 20" calculation to the `EventHandler` since the JS calls will want to work directly in pixels.
2021-09-10WindowServer: Fix 'sticky' mouse after resizeBen Wiederhake
This fixes #9933 and some dead code I accidentally left over. Thanks, @Maato!
2021-09-10FileSystemAccessServer: Allow read-only access without promptingMustafa Quraish
This commit adds a new request to the FileSystemAccessServer endpoint, allowing the clients to get read-only access to a file without getting a Dialog-box prompting the user for access. This is only meant to be used in cases where the user has asked specifically to open a file through the command-line arguments. In those cases, I believe it makes sense for the read-only access to be implicit. Always prompting the user gets a bit annoying, especially if you just quickly want to open a file through the CLI. The new request name has been made extremely specific to make sure that it's only used when appropriate.
2021-09-10AK+Everywhere: Reduce the number of template parameters of IntrusiveListAli Mohammad Pur
This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that.
2021-09-09LibWeb: Rename DOM::Window::document() => associated_document()Andreas Kling
Match the spec nomenclature.
2021-09-09LibWeb: Rename BrowsingContext::document() => active_document()Andreas Kling
This better matches the spec nomenclature. Note that we don't yet *retrieve* the active document according to spec.
2021-09-08LibWeb: Rename InitialContainingBlockBox => InitialContainingBlockAndreas Kling
The "Box" suffix added nothing here.
2021-09-08LibWeb: Remove unused PageClient::is_multi_process()Andreas Kling
2021-09-08LibWeb+WebContent: Port DumpLayoutTree to OutOfProcessWebViewAndreas Kling
This required adding a simple OOPWV::dump_layout_tree() API that synchronously requests a dump of the layout tree from the WebContent process.
2021-09-08LibGUI+WindowServer: Remove now-obsolete cursor tracking featureBen Wiederhake
This feature was problematic for several reasons: - Tracking *all* the user activity seems like a privacy nightmare. - LibGUI actually only supports one globally tracking widget per window, even if no window is necessary, or if multiple callbacks are desired. - Widgets can easily get confused whether an event is actually directed at it, or is actually just the result of global tracking. The third item caused an issue where right-clicking CatDog opened two context menus instead of one.
2021-09-08LibGUI+WindowServer: Introduce new mouse tracking mechanismBen Wiederhake
2021-09-08Kernel+SystemServer: Simplify the DevTmpFS designLiav A
We are no longer have a separate Inode object class for the pts directory. With a small exception to this, all chmod and chown code is now at one place. It's now possible to create any name of a sub-directory in the filesystem.
2021-09-08SystemServer: Don't rely on fstab to specify where to mount the ProcFSLiav A
For now, just hardcode the mounting in SystemServer code.
2021-09-08SystemServer: Traverse sub-directories in /sys/devLiav A
While traversing in both /sys/dev/char and /sys/dev/block, SystemServer populates the DevFS (mounted normally in /dev) with the corresponding device nodes. This is a very crude implementation of populating DevFS device nodes, before we have a full-fledged udev-like daemon to take care of this task. Also, we don't populate DiskPartition device nodes yet, because that requires more sophisticated mechanism to figure out which DiskPartition is related to which StorageDevice.
2021-09-08Kernel+SystemServer: Defer creation of device nodes to userspaceLiav A
Don't create these device nodes in the Kernel, so we essentially enforce userspace (SystemServer) to take control of this operation and to decide how to create these device nodes. This makes the DevFS to resemble linux devtmpfs, and allows us to remove a bunch of unneeded overriding implementations of device name creation in the Kernel.
2021-09-06LibWeb+WebContent: Remove old console-logging IPC callsSam Atkins
This patch removes the following WebContent IPC calls, which are no longer used: - `Server::js_console_initialize()` - `Client::did_js_console_output()`
2021-09-06Browser+WebContent: Initialize WebContentConsoleClient earlierSam Atkins
With this patch, we now initialize the `WebContentConsoleClient` as soon as the Page has loaded, instead of waiting for the Console Window to be shown. This finally lets us see log messages that happened before the window was opened! :^) However, it is not perfect. Waiting until the page has loaded means we lose any messages that happen *during* page load. Ideally we would initialize the WCCC when the page *starts* loading instead, but it requires that the page has a document and interpreter assigned and accessible. As far as I can tell with my limited knowledge, this is not the case until the page has completed loading.
2021-09-06WebContent: Store messages in WebContentConsoleClientSam Atkins
The `WebContentConsoleClient` now keeps a list of console messages it has received, so these are not lost if the ConsoleWidget has not been initialized yet. This change does break JS console output, but only until the next commit. :^)
2021-09-06LibWeb+WebContent: Add new console-message IPC callsSam Atkins
This patch introduces three new IPC calls for WebContent: - `Client::did_output_js_console_message(index)`: Notifies the client that a new console message was logged. - `Server::js_console_request_messages(start_index)`: Ask the server for console messages starting at the given index. - `Client::did_get_js_console_messages(start_index, types, messages)`: Send the client the messages they requested. This mechanism will replace the current `Client::did_js_console_output()` call in the next few commits. This will allow us to display messages in the console that happened before the console was opened.
2021-09-06WebContent: Implement `$0` special variable in Browser JS ConsoleSam Atkins
`$0` is a helpful variable in other browsers' JS consoles, which points to whichever DOM Node is currently selected in the DOM Inspector. And now we have it too! :^)
2021-09-06WebContent: Implement ConsoleGlobalObject which proxies to WindowObjectSam Atkins
ConsoleGlobalObject is used as the global object when running javascript from the Browser console. This lets us implement console-only functions and variables (like `$0`) without exposing them to webpage content. It passes other calls over to the usual WindowObject so any code that would have worked in the webpage will still work in the console. :^)
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-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-04LookupServer: Use HashMap::ensure() in load_etc_hosts()Andreas Kling
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-03Everywhere: Use my shiny new serenityos.org email :^)Sam Atkins
2021-09-02LibWeb+WebContent: Add query for hovered DOM node to OOPWVSam Atkins
This is needed for the "Inspect Element" context menu action.
2021-09-02LibWeb+WebContent: Implement asynchronous DOM Node properties callSam Atkins
This lets us "push" a new style-properties list to the DOM Inspector, for example when JS changes the style of the inspected node.
2021-09-02LibWeb+WebContent: Add inspect_dom_node() IPC callSam Atkins
This is the IPC version of `Document::set_inspected_node()`, using a node ID. We return the inspected node's style properties as JSON, so that the DOM Inspector can immediately display them.
2021-09-02Userland: Migrate to argument-less deferred_invokesin-ack
Only one place used this argument and it was to hold on to a strong ref for the object. Since we already do that now, there's no need to keep this argument around since this can be easily captured. This commit contains no changes.