Use combined native/manual JNI registration.
Add a new mode to the JNI generator which emits both native JNI exports
and manual registration code, and use this as the default mode (except
when compiling with clang as a clang bug prevents this from working at
present).
Native JNI exports are stripped from binaries by default to enforce that
the correct manual registration code is called (and to save increasing
the dynamic symbol table size), except for binaries that explicitly opt
in to using native exports (i.e. libwebviewchromium). Native exports are
not compatible with the crazy linker, so cannot be used universally.
The WebView-specific call to InitReplacementClassLoader, required by
native export mode, has been moved to base to make it easy for other
binaries to experiment with that mode.
Manual JNI registration can be disabled with a call to
base::android::DisableManualJniRegistration at the beginning of
JNI_OnLoad and this has been added to WebView. We plan to refactor the
Android library entry points to make it possible to avoid needing this
flag by just not calling JNI registration but the work is still ongoing;
the flag gets us the desired WebView startup time improvement in the
meantime.
BUG=442327
Review URL: https://codereview.chromium.org/920883002
Cr-Commit-Position: refs/heads/master@{#317434}
CrOS-Libchrome-Original-Commit: 103bf19477cc121eee7a3c2bdc221f2874c971c3
6 files changed