Truly independent web browser
LibWebView: Share gamepad state memory before a test page can load
Tim Ledbetterf00f9468ee15
diff --git a/Libraries/LibWebView/GamepadManager.cpp b/Libraries/LibWebView/GamepadManager.cppindex 76095d07949..0681a42a79a 100644--- a/Libraries/LibWebView/GamepadManager.cpp+++ b/Libraries/LibWebView/GamepadManager.cpp@@ -145,6 +145,11 @@ void GamepadManager::client_disconnected(WebContentClient& client)update_polling_state();}+void GamepadManager::client_did_connect_test_endpoint(WebContentClient& client)+{+ (void)ensure_consumer(client);+}+void GamepadManager::play_effect(WebContentClient& client, Web::Gamepad::GamepadHandle handle, Web::Gamepad::GamepadEffect const& effect){auto* device = device_announced_to_client(client, handle);diff --git a/Libraries/LibWebView/GamepadManager.h b/Libraries/LibWebView/GamepadManager.hindex 0e676bc4e27..f6c0b7d6ecc 100644--- a/Libraries/LibWebView/GamepadManager.h+++ b/Libraries/LibWebView/GamepadManager.h@@ -34,6 +34,7 @@ public:void page_did_start_using_gamepads(WebContentPage&);void page_closed(WebContentPage&);void client_disconnected(WebContentClient&);+ void client_did_connect_test_endpoint(WebContentClient&);void play_effect(WebContentClient&, Web::Gamepad::GamepadHandle, Web::Gamepad::GamepadEffect const&);void stop_effects(WebContentClient&, Web::Gamepad::GamepadHandle);diff --git a/Libraries/LibWebView/WebContentClient.cpp b/Libraries/LibWebView/WebContentClient.cppindex fccb4a6129e..9b4b1d83aca 100644--- a/Libraries/LibWebView/WebContentClient.cpp+++ b/Libraries/LibWebView/WebContentClient.cpp@@ -167,6 +167,7 @@ Messages::WebContentClient::DidRequestBlobUrlEntryResponse WebContentClient::didvoid WebContentClient::connect_test_endpoint(NonnullOwnPtr<IPC::Transport> transport){m_test_connection = make_ref_counted<WebContentTestClient>(move(transport), *this);+ GamepadManager::the().client_did_connect_test_endpoint(*this);}void WebContentClient::remove_blob_url_entries()