Default constructors for mojo structs with non-nullable strings generate an invalid instance |
|||
Issue descriptionSince the default ctor for WTF::String() generates a null string, and we simply use the default ctor, even if the string is non-nullable, that means the default ctor ends up generating a struct that's not valid to send (or receive). It should be possible to tweak the Blink variant to use the empty string for the default ctor when a string isn't marked nullable.
,
Jan 12
This affects all platforms except iOS, right?
,
Jan 14
It would affect iOS too. We still use some Mojo interfaces on iOS even though they're all in-process. I agree with the premise of the bug. Certainly a non-nullable string field should be initialized with a valid empty string by default. I'm not sure about nested structs. Unlike a default-constructed string object, struct fields are heap pointers and thus default-constructing them requires a heap allocation even if the field is going to be immediately replaced by something else. Maybe we don't care?
,
Jan 14
Oh right but the Blink bindings specifically for WTF::String, yeah, not iOS. |
|||
►
Sign in to add a comment |
|||
Comment 1 by dcheng@chromium.org
, Jan 11