envoy
envoy copied to clipboard
mobile: Rewrite Java/JNI stream callbacks
This PR rewrites the Java/JNI implementation of the stream callbacks by removing a lot of indirection. This should reduce the number of translation layers, copies, as well as making the code easier to read and maintain. Prior to this PR, the filter and callback implementation was somewhat shared, but it makes the code confusing to read because there's some logic that's only relevant for the filters and vice versa. With the new implementation, the stream callback implementation is separate from the filter implementation, but some common helpers have been written so that the code can still be shared between the stream callback and filter implementations. In the next PR, I will update the filter implementation, so that we can finally get rid of the C wrapper types.
This PR also introduces the use of caching for jclass
as per this recommendation: https://developer.android.com/training/articles/perf-jni#jclass,-jmethodid,-and-jfieldid
In the next PR, I will update the JNI code to cache all the jclass
, jmethodID
, and jFieldID
.
Risk Level: medium Testing: unit & integration tests Docs Changes: n/a Release Notes: n/a Platform Specific Features: mobile
As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.
Please mark your PR as ready when you want it to be reviewed!
/retest
/retest
/assign @abeyad
/retest
/retest