-
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
base: main
Are you sure you want to change the base?
[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. |
…(#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.
3947e4e
to
fc6b92d
Compare
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