News for hackers. Stuff that matters.
Re:Chrome Issue 652543: ContextualSearchLayer::SetProperties... by theamk on Friday February 26, 2021 @06:07PM (#26280928)
My first reaction to this would be to change it to take as struct, but the ticket comments reveal why this is not a good idea: those are C++ functions called from Java, and Java's translation layer (JNI) does not support structs at all.

It looks like the "recommended" case would be to create a new class, add a setter for each parameter, and pass it. But this is a lot of extra code, and many more function calls, which will slow down the program.

If I were in their shoes, I would keep it as-is, but add an explanation comment. If this patter turns out to be both common and error-prone, I'd consider codegen which emits definition of C++ struct, Java caller and C++ receiver with matching parameter list.

Re:Chrome Issue 652543: ContextualSearchLayer::SetProperties... by rot25 on Friday February 26, 2021 @04:31PM (#26280053)
android::ContextualSearchLayer::SetProperties(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, float, scoped_refptr<cc::Layer> const&, bool, float, float, int, int, bool, float, float, int, int, bool, float, bool, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, bool, bool, float, bool, bool, float, int, int, int, float, bool, float, float, float, bool, float, float, int, int)