• Tibor Goldschwendt's avatar
    Auto-generate Java that provide information about modules at runtime · c748dfca
    Tibor Goldschwendt authored
    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 <tiborg@chromium.org>
    Commit-Queue: Christopher Grant <cjgrant@chromium.org>
    Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
    Reviewed-by: default avatarChristopher Grant <cjgrant@chromium.org>
    Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#709165}
    c748dfca
module_desc_java.py 2.13 KB