summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-14 17:09:11 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-14 17:17:30 +0200
commit5fd65adb19646ca4dafb9c1a917f63d3951a9249 (patch)
treefcacdd601ab5443000424f2ee0b81fcd39518ec5 /Userland
parent3ed5a73edea567002e9cd38dd475e376357204d2 (diff)
downloadserenity-5fd65adb19646ca4dafb9c1a917f63d3951a9249.zip
Browser: Don't spawn RequestServer and WebSocket in multi-process mode
Single-process Browser forces a connection to these services early on, to avoid having to unveil their paths. I'm suspicious of the benefits of this (and the comment about it wasn't even accurate) but let's keep it for now. In multi-process mode, there's no need to do this, and in fact it was causing us to spawn two extra totally unused processes.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/Browser/Tab.cpp16
-rw-r--r--Userland/Applications/Browser/main.cpp8
2 files changed, 14 insertions, 10 deletions
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp
index c1587f7e6b..6c8c2f2196 100644
--- a/Userland/Applications/Browser/Tab.cpp
+++ b/Userland/Applications/Browser/Tab.cpp
@@ -646,13 +646,15 @@ void Tab::update_bookmark_button(const String& url)
void Tab::did_become_active()
{
- Web::ResourceLoader::the().on_load_counter_change = [this] {
- if (Web::ResourceLoader::the().pending_loads() == 0) {
- m_statusbar->set_text("");
- return;
- }
- m_statusbar->set_text(String::formatted("Loading ({} pending resources...)", Web::ResourceLoader::the().pending_loads()));
- };
+ if (m_type == Type::InProcessWebView) {
+ Web::ResourceLoader::the().on_load_counter_change = [this] {
+ if (Web::ResourceLoader::the().pending_loads() == 0) {
+ m_statusbar->set_text("");
+ return;
+ }
+ m_statusbar->set_text(String::formatted("Loading ({} pending resources...)", Web::ResourceLoader::the().pending_loads()));
+ };
+ }
BookmarksBarWidget::the().on_bookmark_click = [this](auto& url, unsigned modifiers) {
if (modifiers & Mod_Ctrl)
diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp
index 5329ff9d44..50f1e785f3 100644
--- a/Userland/Applications/Browser/main.cpp
+++ b/Userland/Applications/Browser/main.cpp
@@ -67,9 +67,11 @@ int main(int argc, char** argv)
auto app = GUI::Application::construct(argc, argv);
- // Connect to the RequestServer and the WebSocket service immediately so we can drop the "unix" pledge.
- Web::ResourceLoader::the();
- Web::HTML::WebSocketClientManager::the();
+ if (Browser::s_single_process) {
+ // Connect to the RequestServer and the WebSocket service immediately so we don't need to unveil their portals.
+ Web::ResourceLoader::the();
+ Web::HTML::WebSocketClientManager::the();
+ }
// Connect to LaunchServer immediately and let it know that we won't ask for anything other than opening
// the user's downloads directory.