Auto-generate Java that provide information about modules at runtime
The first piece of information is the native libraries a module depends
on. We will use this info in following CLs to auto-load the libraries
on first module access.
The Java is generated in the chrome_feature_module template via a new
module_desc_java template. Module_desc_java lives in
//components/module_installer since this component is using the Java and
has expectations about its format.
Modules that don't use module descriptors (e.g. they are packaged into
base such as tab_management in this CL) have to manually create a
module_desc_java to be able to use Module.java's loading goodies.
APKs won't automatically have module_desc_javas. In order to make the
Module.java API work in APKs (e.g. test APKs) we use stub descriptors.
This should be fine as APKs already load all native libraries at
startup.
See go/native-dfm-load-v2 for more context and details.
Also in this CL, moving native lib loading before impl initialization
so that the module is fully set up by the time module code is handed
control.
Bug: 870055
Change-Id: I8b6112bfc57b7d49698702b4fc12d2874b55fa12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1873911
Commit-Queue: Tibor Goldschwendt <[email protected]>
Commit-Queue: Christopher Grant <[email protected]>
Auto-Submit: Tibor Goldschwendt <[email protected]>
Reviewed-by: Christopher Grant <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Cr-Commit-Position: refs/heads/master@{#709165}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index e67a8c2..8de4ce3 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1351,6 +1351,7 @@
'build/android/test_wrapper/logdog_wrapper.pydeps',
'build/protoc_java.pydeps',
'chrome/android/features/create_stripped_java_factory.pydeps',
+ 'components/module_installer/android/module_desc_java.pydeps',
'net/tools/testserver/testserver.pydeps',
'testing/scripts/run_android_wpt.pydeps',
'third_party/android_platform/development/scripts/stack.pydeps',