-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a mechanism for tracking whether web pages have "recently" used g…
…amepads rdar://127892698 https://bugs.webkit.org/show_bug.cgi?id=274134 Reviewed by Sihui Liu. In some configurations the UIProcess might want to configure specific behaviors based on whether or not content in a web page has "recently" accessed gamepads via JavaScript. Do to the polling nature of navigator.getGamepads() we consider a web page to have "recently" accessed them as long as that function is called periodically during an arbitrary timespan I have arbitrarily chosen as 1.5 seconds. This patch adds the behavior and tests it via TestWebKitAPI. Actually using this behavior to do something interesting will come in a followup. * Source/WebCore/Headers.cmake: * Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp: (WebCore::NavigatorGamepad::setGamepadsRecentlyAccessedThreshold): (WebCore::NavigatorGamepad::maybeNotifyRecentAccess): (WebCore::NavigatorGamepad::gamepads): * Source/WebCore/Modules/gamepad/NavigatorGamepad.h: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/page/ChromeClient.h: (WebCore::ChromeClient::gamepadsRecentlyAccessed): * Source/WebKit/UIProcess/API/APIUIClient.h: (API::UIClient::recentlyAccessedGamepadsForTesting): (API::UIClient::stoppedAccessingGamepadsForTesting): * Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * Source/WebKit/UIProcess/Cocoa/UIDelegate.h: * Source/WebKit/UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::recentlyAccessedGamepadsForTesting): (WebKit::UIDelegate::UIClient::stoppedAccessingGamepadsForTesting): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::m_recentGamepadAccessHysteresis): (WebKit::WebPageProxy::recentGamepadAccessStateChanged): (WebKit::WebPageProxy::gamepadsRecentlyAccessed): (WebKit::m_browsingContextGroup): Deleted. * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/WebPageProxy.messages.in: * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::gamepadsRecentlyAccessed): * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::gamepadsRecentlyAccessed): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * Tools/TestWebKitAPI/Tests/mac/HIDGamepads.mm: (-[GamepadUIDelegate _webViewRecentlyAccessedGamepadsForTesting:]): (-[GamepadUIDelegate _webViewStoppedAccessingGamepadsForTesting:]): (TestWebKitAPI::(Gamepad, GamepadState)): Canonical link: https://commits.webkit.org/278782@main
- Loading branch information
Showing
20 changed files
with
220 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.