Commit Graph

7 Commits

Author SHA1 Message Date
Andreas Kling
20915795a8 Everywhere: Pledge "sendfd" in WindowServer client programs
This is needed for the new way we transfer window backing stores.
2021-01-15 14:10:32 +01:00
Andreas Kling
0b0514d46b LibGUI+WindowServer: Use anonymous files for window backing stores :^)
This patch replaces the use of shbufs for GUI::Window backing stores
with the new anonymous files mechanism.

Backing bitmaps are now built on memory allocated with anon_create().
They are passed across the IPC socket as IPC::File. This means that
WindowServer now pledges "recvfd" and graphical clients need to pledge
"sendfd" to work.

To support the cached bitmap swapping optimization on the WindowServer
side, each backing store is assigned an incrementing serial number on
the client side. (This allows us to re-use an already mapped file.)
2021-01-15 13:57:00 +01:00
Lenny Maiorani
7e71de8f1f Http[s]Protocol: Make the code start_download DRY
Problem:
- `HttpProtocol::start_download` and `HttpsProtocol::start_download`
  implementations are the same except for a few types.

Solution:
- Follow the "Don't Repeat Yourself" mantra and de-duplicate the code
  using templates.
2021-01-15 09:44:21 +01:00
Andreas Kling
f1f7bf567b LibIPC: Add an expressive way to close an IPC::File after sending it
If you don't need a file descriptor after sending it to someone over
IPC, construct it with IPC::File(fd, IPC::File::CloseAfterSending)
and LibIPC will take care of it for you. :^)
2021-01-14 09:50:14 +01:00
Brendan Coles
2f65363488 DHCPClient: handle /proc/net/adapters invalid JSON gracefully 2021-01-14 08:35:34 +01:00
Andreas Kling
1a08ac72ad LibC+Everywhere: Remove open_with_path_length() in favor of open()
This API was a mostly gratuitous deviation from POSIX that gave up some
portability in exchange for avoiding the occasional strlen().

I don't think that was actually achieving anything valuable, so let's
just chill out and have the same open() API as everyone else. :^)
2021-01-12 23:34:01 +01:00
Andreas Kling
c7ac7e6eaf Services: Move to Userland/Services/ 2021-01-12 12:23:01 +01:00