• Clark DuVall's avatar
    [WebLayer] Use crazy linker for M- and "/." trick for N+ · 9b660407
    Clark DuVall authored
    Instead of copying libraries on M-, this changes to using the crazy
    linker, which loads the library without any knowledge of what libraries
    have been loaded by the system linker. This requires manual JNI
    registration. To make sure we only register WebLayer JNI when needed,
    a minimal set of JNI methods is registered, and the full set is
    registered later if we require WebView compatibility.
    
    In N+, we switch to prepending "/." to library paths instead of using
    symlinks, which allows us to avoid writing any files to the apps data
    directory. This simplifies the interface quite a bit, allowing
    initializeWebViewCompatibilityMode() to be sync instead of async. I will
    follow up with the Android team to make sure we have a better solution
    for future versions of Android.
    
    The API has not been used in the client app yet, so it should be safe
    to remove M- support for the copy library approach in the
    implementation. The old version of initializeWebViewCompatibilityMode()
    was kept so the WebLayer API version compat tests would still pass.
    
    TBR=agrieve@chromium.org
    
    Bug: 1051358
    Change-Id: I2cd5ae0e025feaeb5c41cf9ddfafc91cd09fbad7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090024
    Commit-Queue: Clark DuVall <cduvall@chromium.org>
    Reviewed-by: default avatarRichard Coles <torne@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#749973}
    9b660407
BUILD.gn 1.82 KB