-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[pigeon] Use a const for custom type ids for gobject generated files (#156100) #9306
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
[pigeon] Use a const for custom type ids for gobject generated files (#156100) #9306
Conversation
9ef0df9
to
b660a0c
Compare
62b41ae
to
da4196c
Compare
packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h
Outdated
Show resolved
Hide resolved
77d7394
to
3947e4e
Compare
The FLValue headers in some places use // fl_value.h:303
FlValue* fl_value_new_custom(int type, // uses int
gconstpointer value,
GDestroyNotify destroy_notify);
// fl_standard_message_codec.h:148
gboolean fl_standard_message_codec_write_value(FlStandardMessageCodec* codec,
GByteArray* buffer, // uses GByteArray*, which is used (subclassed) in generated files:
FlValue* value,
GError** error);
// core_tests.gen.cc:2422
static gboolean
core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_an_enum(
FlStandardMessageCodec* codec, GByteArray* buffer, FlValue* value,
GError** error) {
uint8_t type = core_tests_pigeon_test_an_enum_type_id; // appends uint8_t to buffer
g_byte_array_append(buffer, &type, sizeof(uint8_t));
return fl_standard_message_codec_write_value(codec, buffer, value, error);
} I think this might be related to #152916. Maybe it is best to leave it as is, and for this PR use |
Where is the header using
|
My mistake, it's not the FlValue header that uses uint8_t, but only the generated code using the engine header. class DartGenerator extends StructuredGenerator<InternalDartOptions> {
(...)
void writeGeneralCodec() {
(...)
indent.writeln('buffer.putUint8(4);'); That makes more sense to me now. I guess that means we can keep it like it is. |
7aca7cf
to
c78a9d9
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
Pr looks good, just one question and I can lgtm
c78a9d9
to
6e4d91e
Compare
75a101f
to
70c893a
Compare
If you'd like to compare, this commit contains the changes since the last review |
57edd16
to
d5c4bde
Compare
…(#156100) Adds a custom type identifier to generated gobject headers for the user. Calling fl_value_new_custom_object is now possible with that constant. This fixes flutter/flutter#156100 Also updated the CONTRIBUTING.md file to include the gobject generator.
d5c4bde
to
2875eaf
Compare
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.
LGTM
@tarrinneal This just needs your final re-review. |
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.
Sorry, thought I'd stamped this already!
@tarrinneal Can you please autosubmit / merge? |
flutter/packages@03a6abb...25d4fa4 2025-06-17 [email protected] [google_maps_flutter] Add a new zIndexInt param to marker and deprecate zIndex (flutter/packages#8012) 2025-06-17 [email protected] [pigeon] Use a const for custom type ids for gobject generated files (#156100) (flutter/packages#9306) 2025-06-16 [email protected] [google_maps_flutter_platform_(web/android/ios)] Add a new zIndexInt param to marker and deprecate zIndex (flutter/packages#9408) 2025-06-16 [email protected] [camera_avfoundation] fix race condition when starting image stream on iOS (flutter/packages#8733) 2025-06-16 [email protected] Roll Flutter from f79452e to 8303a96 (21 revisions) (flutter/packages#9433) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Adds a custom type identifier to generated gobject headers for the user. Calling fl_value_new_custom_object is now possible with that constant.
This fixes flutter/flutter#156100
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3