-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebXR] Add state checking to WebXR IPC calls #23536
[WebXR] Add state checking to WebXR IPC calls #23536
Conversation
EWS run on previous version of this PR (hash 2ff5f4f) |
2ff5f4f
to
1e5485d
Compare
EWS run on previous version of this PR (hash 1e5485d) |
1e5485d
to
c61ea0a
Compare
EWS run on current version of this PR (hash c61ea0a) |
EWS run on previous version of this PR (hash c61ea0a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to accept this now, but in a future patch, I'd like to refactor the state management to use std::variant
for each state to eliminate the need to check for valid data keep in std::optional
.
This could be done in an effort to unify the WebXR ARKit system with Compositor.
@@ -146,6 +211,22 @@ void PlatformXRSystem::sessionDidUpdateVisibilityState(XRDeviceIdentifier device | |||
}); | |||
} | |||
|
|||
void PlatformXRSystem::setImmersiveSessionState(ImmersiveSessionState state) | |||
{ | |||
RELEASE_LOG_DEBUG(XR, "PlatformXRSystem: Immersive state update: Old=%d, New=%d", (int)m_immersiveSessionState, (int)state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to ship with this logging? (Dean always asked me this question)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove it.
c61ea0a
to
f43336e
Compare
EWS run on current version of this PR (hash f43336e) |
https://bugs.webkit.org/show_bug.cgi?id=268404 rdar://121553978 Reviewed by Dan Glastonbury. Track internal state in PlatformXRSystem and check that we are in the expected state when the IPC call is made. Remove unnecessary parameters in PlatformXRSystem::initializeTrackingAndRendering() as that information can be cached in this class and there's no need to pass that info over again. * Source/WebCore/Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::resolveFeaturePermissions const): We should not call into platform code for requesting permissions for simulated test devices. * Source/WebKit/Shared/XR/XRDeviceProxy.cpp: (WebKit::XRDeviceProxy::initializeTrackingAndRendering): * Source/WebKit/UIProcess/XR/PlatformXRSystem.cpp: (WebKit::PlatformXRSystem::invalidate): (WebKit::PlatformXRSystem::ensureImmersiveSessionActivity): (WebKit::checkFeaturesConsent): Helper function to check whether all the features in the first argument are included in the second list of granted features. (WebKit::PlatformXRSystem::requestPermissionOnSessionFeatures): For immersive modes, check that we are in the idle state before requesting permissions via the PlatformXRCoordinator. When we get the granted permissions back, check whether all the required features have been granted permission. Update the immersive session state accordingly based on whether the session can start. (WebKit::PlatformXRSystem::initializeTrackingAndRendering): Remove the parameters and use the cached immersive session mode and granted features instead. (WebKit::PlatformXRSystem::shutDownTrackingAndRendering): (WebKit::PlatformXRSystem::requestFrame): (WebKit::PlatformXRSystem::submitFrame): (WebKit::PlatformXRSystem::sessionDidEnd): (WebKit::PlatformXRSystem::setImmersiveSessionState): (WebKit::PlatformXRSystem::invalidateImmersiveSessionState): * Source/WebKit/UIProcess/XR/PlatformXRSystem.h: * Source/WebKit/UIProcess/XR/PlatformXRSystem.messages.in: * Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.cpp: (WebKit::PlatformXRSystemProxy::initializeTrackingAndRendering): * Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.h: Canonical link: https://commits.webkit.org/273875@main
f43336e
to
bd55010
Compare
Committed 273875@main (bd55010): https://commits.webkit.org/273875@main Reviewed commits have been landed. Closing PR #23536 and removing active labels. |
bd55010
f43336e
π wincairoπ§ͺ wpe-wk2π§ͺ ios-wk2π§ͺ api-macπ§ͺ api-wpeπ§ͺ ios-wk2-wptπ§ͺ mac-wk1π§ͺ mac-wk2π§ͺ gtk-wk2π§ͺ mac-AS-debug-wk2π§ͺ api-gtkπ tv-simπ watchπ watch-sim