-
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] Port enum classes to new serialization format #21161
[WebXR] Port enum classes to new serialization format #21161
Conversation
EWS run on previous version of this PR (hash 6fd1d1c) |
This is untested as I don't have the means to build a XR platform. Someone who is actually working on WebXR should try it first, it's possible that it won't work out of the box. Marking as a draft for that reason, but hopefully someone can give me feedback on it. |
6fd1d1c
to
42ecf56
Compare
EWS run on previous version of this PR (hash 42ecf56) |
42ecf56
to
6463484
Compare
EWS run on current version of this PR (hash 6463484) |
ImmersiveAr, | ||
}; | ||
|
||
[Nested] enum class PlatformXR::ReferenceSpaceType : uint8_t { |
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.
Q: For my own understanding, why does this one need the [Nested]
attribute?
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 compiled without [Nested]
and it works, so I'd suggest removing it.
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.
My understanding is that you can use Nested if the class is only serialized as part of another class, simplifying a bit the declaration. Removing [Nested]
adds the following forward declarations to the GeneratedSerializers.h
header, which is not really necessary in this case:
@@ -73,6 +73,9 @@ enum class SessionFeature : uint8_t;
enum class SessionMode : uint8_t;
#endif
#if ENABLE(WEBXR)
+enum class ReferenceSpaceType : uint8_t;
+#endif
+#if ENABLE(WEBXR)
enum class VisibilityState : uint8_t;
#endif
#if ENABLE(WEBXR)
@@ -7688,6 +7691,9 @@ template<> bool isValidEnum<PlatformXR::
template<> bool isValidEnum<PlatformXR::SessionMode, void>(uint8_t);
#endif
#if ENABLE(WEBXR)
+template<> bool isValidEnum<PlatformXR::ReferenceSpaceType, void>(uint8_t);
+#endif
+#if ENABLE(WEBXR)
template<> bool isValidEnum<PlatformXR::VisibilityState, void>(uint8_t);
#endif
#if ENABLE(WEBXR)
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.
@djg Based on the explanation above I am going to merge-as-is, please let me know if you disagree.
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.
@csaavedra I'll test it for you. |
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.
ImmersiveAr, | ||
}; | ||
|
||
[Nested] enum class PlatformXR::ReferenceSpaceType : uint8_t { |
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 compiled without [Nested]
and it works, so I'd suggest removing it.
Thanks btw! :) |
https://bugs.webkit.org/show_bug.cgi?id=265665 Reviewed by Dan Glastonbury. Move the XR enums to the new serialization format to be able to get rid of the enum traits for them. * Source/WebCore/platform/xr/PlatformXR.h: * Source/WebKit/Shared/XR/XRSystem.serialization.in: Canonical link: https://commits.webkit.org/271466@main
6463484
to
3fb2a42
Compare
Committed 271466@main (3fb2a42): https://commits.webkit.org/271466@main Reviewed commits have been landed. Closing PR #21161 and removing active labels. |
3fb2a42
6463484
π§ͺ wpe-wk2