Skip to content
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

Conversation

csaavedra
Copy link
Member

@csaavedra csaavedra commented Dec 1, 2023

@csaavedra csaavedra self-assigned this Dec 1, 2023
@csaavedra csaavedra added the WebXR For bugs in WebXR label Dec 1, 2023
@csaavedra csaavedra marked this pull request as draft December 1, 2023 15:47
@csaavedra
Copy link
Member Author

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.

@csaavedra csaavedra requested a review from djg December 1, 2023 15:49
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 1, 2023
@csaavedra csaavedra removed the merging-blocked Applied to prevent a change from being merged label Dec 1, 2023
@csaavedra csaavedra force-pushed the eng/WebXR-Port-enum-classes-to-new-serialization-format branch from 6fd1d1c to 42ecf56 Compare December 1, 2023 17:15
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 1, 2023
@csaavedra csaavedra removed the merging-blocked Applied to prevent a change from being merged label Dec 1, 2023
@csaavedra csaavedra force-pushed the eng/WebXR-Port-enum-classes-to-new-serialization-format branch from 42ecf56 to 6463484 Compare December 1, 2023 20:49
ImmersiveAr,
};

[Nested] enum class PlatformXR::ReferenceSpaceType : uint8_t {
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Member Author

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)

Copy link
Member Author

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.

Copy link
Contributor

@djg djg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@djg djg self-requested a review December 3, 2023 22:53
@djg
Copy link
Contributor

djg commented Dec 3, 2023

@csaavedra I'll test it for you.

Copy link
Contributor

@djg djg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

ImmersiveAr,
};

[Nested] enum class PlatformXR::ReferenceSpaceType : uint8_t {
Copy link
Contributor

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.

@csaavedra csaavedra added the merge-queue Applied to send a pull request to merge-queue label Dec 4, 2023
@csaavedra
Copy link
Member Author

@csaavedra I'll test it for you.

Thanks btw! :)

@csaavedra csaavedra marked this pull request as ready for review December 4, 2023 09:49
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
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WebXR-Port-enum-classes-to-new-serialization-format branch from 6463484 to 3fb2a42 Compare December 4, 2023 10:42
@webkit-commit-queue
Copy link
Collaborator

Committed 271466@main (3fb2a42): https://commits.webkit.org/271466@main

Reviewed commits have been landed. Closing PR #21161 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Dec 4, 2023
@webkit-commit-queue webkit-commit-queue merged commit 3fb2a42 into WebKit:main Dec 4, 2023
@csaavedra csaavedra deleted the eng/WebXR-Port-enum-classes-to-new-serialization-format branch December 12, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebXR For bugs in WebXR
Projects
None yet
5 participants