forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mobile: Part 5: Update JNI usages with JniHelper (envoyproxy#30780)
This updates the following methods: - `CallObjectMethod` - `CallStaticObjectMethod` This PR adds `[[nodiscard]]` to make sure we always assign the `unique_ptr` into a variable when calling some JNI functions to avoid any leaks. The `callObjectMethod` and `callStaticObjecMethod` from `JniHelper` has been templatized to make them easy to use, especially when casting from `jobject` to a different type. Some usages of `Envoy::JNI::checkAndClear` have also been removed since they are no longer necessary and we don't want to shallow the exceptions in most cases. Signed-off-by: Fredy Wijaya <[email protected]>
- Loading branch information
Showing
7 changed files
with
117 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.