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

Allow using a = b in *.serialization.in files #9127

Conversation

achristensen07
Copy link
Contributor

@achristensen07 achristensen07 commented Jan 25, 2023

e7b14b5

Allow using a = b in *.serialization.in files
https://bugs.webkit.org/show_bug.cgi?id=251160

Reviewed by Chris Dumez.

This fixes a shortcut I took in 259180@main.
Expose the information to the IPC testing API as if b contained a,
which is equivalent from the point of view of serialization.
No actual serializers need to be generated.

* Source/WebKit/Scripts/generate-serializers.py:
(generate_serialized_type_info):
(generate_serialized_type_info.in):
(parse_serialized_types):
(main):
(main.in):
* Source/WebKit/Scripts/webkit/tests/SerializedTypeInfo.cpp:
(WebKit::allSerializedTypes):
* Source/WebKit/Scripts/webkit/tests/TestSerializedType.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/VisitedLinkStore.messages.in:
* Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.messages.in:

Canonical link: https://commits.webkit.org/259383@main

5823253

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style   πŸ›  ios   πŸ›  mac   πŸ›  wpe   πŸ›  πŸ§ͺ win
  πŸ§ͺ bindings   πŸ›  ios-sim   πŸ›  mac-AS-debug   πŸ›  gtk   πŸ›  wincairo
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac   πŸ§ͺ gtk-wk2
  πŸ§ͺ webkitpy   πŸ§ͺ api-ios   πŸ§ͺ mac-wk1   πŸ§ͺ api-gtk
  πŸ›  πŸ§ͺ jsc   πŸ›  tv   πŸ§ͺ mac-wk2   πŸ›  jsc-armv7
  πŸ›  πŸ§ͺ jsc-arm64   πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2   πŸ§ͺ jsc-armv7-tests
  πŸ§ͺ services   πŸ›  watch   πŸ§ͺ mac-wk2-stress βœ… πŸ›  jsc-mips
  πŸ›  watch-sim   πŸ§ͺ jsc-mips-tests
βœ… πŸ›  πŸ§ͺ unsafe-merge

@achristensen07 achristensen07 self-assigned this Jan 25, 2023
@achristensen07 achristensen07 added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Jan 25, 2023
@achristensen07 achristensen07 changed the title Make SharedStringHash a serializable struct Allow using a = b in *.serialization.in files Jan 25, 2023
@achristensen07 achristensen07 force-pushed the eng/Make-SharedStringHash-a-serializable-struct branch 2 times, most recently from d80add1 to 5823253 Compare January 25, 2023 20:29
Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

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

Yes, this is nicer I think.

@cdumez
Copy link
Contributor

cdumez commented Jan 25, 2023

Note that the previous serialization logic didn't even need this typedef/alias iirc. This is better than rewriting the typedef as a struct but ideally we wouldn't even need this alias in the serialization.in and we'd let the generated code figure out that SharedStringHash is a typedef to uint32_t simply by including the SharedStringHash.h header.

@achristensen07
Copy link
Contributor Author

I don't think that's possible until C++ reflection becomes part of the language. The metadata needs to be strings "WebCore::SharedStringHash" and "uint32_t". Until then, I think this is the minimum amount of metadata needed.

@achristensen07 achristensen07 added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jan 25, 2023
https://bugs.webkit.org/show_bug.cgi?id=251160

Reviewed by Chris Dumez.

This fixes a shortcut I took in 259180@main.
Expose the information to the IPC testing API as if b contained a,
which is equivalent from the point of view of serialization.
No actual serializers need to be generated.

* Source/WebKit/Scripts/generate-serializers.py:
(generate_serialized_type_info):
(generate_serialized_type_info.in):
(parse_serialized_types):
(main):
(main.in):
* Source/WebKit/Scripts/webkit/tests/SerializedTypeInfo.cpp:
(WebKit::allSerializedTypes):
* Source/WebKit/Scripts/webkit/tests/TestSerializedType.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/VisitedLinkStore.messages.in:
* Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.messages.in:

Canonical link: https://commits.webkit.org/259383@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Make-SharedStringHash-a-serializable-struct branch from 5823253 to e7b14b5 Compare January 25, 2023 20:56
@webkit-commit-queue
Copy link
Collaborator

Committed 259383@main (e7b14b5): https://commits.webkit.org/259383@main

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

@webkit-commit-queue webkit-commit-queue merged commit e7b14b5 into WebKit:main Jan 25, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).
Projects
None yet
4 participants