Explorar o código

Base: Launch WebContent at session start-up

Lucas CHOLLET %!s(int64=2) %!d(string=hai) anos
pai
achega
ac7b0e69e5

+ 0 - 9
Base/etc/SystemServer.ini

@@ -8,15 +8,6 @@ SystemModes=text,graphical
 MultiInstance=true
 AcceptSocketConnections=true
 
-[WebContent]
-Socket=/tmp/portal/webcontent
-SocketPermissions=600
-Lazy=true
-User=anon
-SystemModes=graphical
-MultiInstance=true
-AcceptSocketConnections=true
-
 [ImageDecoder]
 Socket=/tmp/portal/image
 SocketPermissions=600

+ 8 - 0
Base/home/anon/.config/SystemServer.ini

@@ -11,6 +11,14 @@ SystemModes=text,graphical
 MultiInstance=true
 AcceptSocketConnections=true
 
+[WebContent]
+Socket=/tmp/user/%uid/portal/webcontent
+SocketPermissions=600
+Lazy=true
+SystemModes=graphical
+MultiInstance=true
+AcceptSocketConnections=true
+
 [LaunchServer]
 Socket=/tmp/user/%uid/portal/launch
 SocketPermissions=600

+ 6 - 2
Documentation/Browser/ProcessArchitecture.md

@@ -30,9 +30,13 @@ This process can decode images (PNG, JPEG, BMP, ICO, PBM, etc.) into bitmaps. Ea
 
 ### How processes are spawned
 
-To get a fresh **WebContent** process, anyone with the suitable file system permissions can spawn one by connecting to the socket at `/tmp/portal/webcontent`. This socket is managed by **SystemServer** and will spawn a new instance of **WebContent** for every connection.
+To get a fresh **WebContent** process, anyone with the suitable file system permissions can spawn one by connecting to
+the socket at `/tmp/user/%uid/portal/webcontent`, with `%uid` being the uid of the current user. This socket is managed
+by **
+SystemServer** and will spawn a new instance of **WebContent** for every connection.
 
-The same basic concept applies to **RequestServer** and **ImageDecoder** as well, except that those services are spawned by **WebContent** as needed, not by **Browser**.
+The same basic concept applies to **RequestServer** and **ImageDecoder** as well, except that those services are spawned
+by **WebContent** as needed, not by **Browser**.
 
 ## Class overview
 

+ 1 - 1
Userland/Applications/Browser/main.cpp

@@ -86,7 +86,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     TRY(Core::System::unveil("/etc/timezone", "r"));
     TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
     TRY(Core::System::unveil("/tmp/portal/image", "rw"));
-    TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
+    TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
     TRY(Core::System::unveil("/tmp/user/%uid/portal/request", "rw"));
     TRY(Core::System::unveil("/bin/BrowserSettings", "x"));
     TRY(Core::System::unveil(nullptr, nullptr));

+ 1 - 1
Userland/Applications/Help/main.cpp

@@ -35,7 +35,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     TRY(Core::System::unveil("/usr/share/man", "r"));
     TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
     TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "rw"));
-    TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
+    TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
     TRY(Core::System::unveil(nullptr, nullptr));
 
     String start_page;

+ 1 - 1
Userland/Applications/Mail/main.cpp

@@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 
     TRY(Core::System::unveil("/res", "r"));
     TRY(Core::System::unveil("/etc", "r"));
-    TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
+    TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
     TRY(Core::System::unveil("/tmp/portal/lookup", "rw"));
     TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "rw"));
     TRY(Core::System::unveil(nullptr, nullptr));

+ 1 - 1
Userland/Applications/Spreadsheet/main.cpp

@@ -44,7 +44,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
         }
     }
 
-    TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
+    TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
     // For writing temporary files when exporting.
     TRY(Core::System::unveil("/tmp", "crw"));
     TRY(Core::System::unveil("/etc", "r"));

+ 1 - 1
Userland/Applications/TextEditor/main.cpp

@@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 
     TRY(Core::System::unveil("/res", "r"));
     TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "rw"));
-    TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
+    TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
     TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
     TRY(Core::System::unveil(nullptr, nullptr));
 

+ 1 - 1
Userland/Applications/Welcome/main.cpp

@@ -22,7 +22,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 
     TRY(Core::System::unveil("/res", "r"));
     TRY(Core::System::unveil("/home", "r"));
-    TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
+    TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
     TRY(Core::System::unveil("/bin/Help", "x"));
     TRY(Core::System::unveil(nullptr, nullptr));
     auto app_icon = GUI::Icon::default_icon("app-welcome"sv);

+ 1 - 1
Userland/Libraries/LibWebView/WebContentClient.h

@@ -19,7 +19,7 @@ class OutOfProcessWebView;
 class WebContentClient final
     : public IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint>
     , public WebContentClientEndpoint {
-    IPC_CLIENT_CONNECTION(WebContentClient, "/tmp/portal/webcontent"sv);
+    IPC_CLIENT_CONNECTION(WebContentClient, "/tmp/user/%uid/portal/webcontent"sv);
 
 public:
     Function<void()> on_web_content_process_crash;