Simplify WebView RELRO creation and handle more cases.
Instead of having the system server search for the absolute path to the WebView's native .so file, simply pass the package name and library filename to the RELRO creation process. The RELRO creation process can then request a classloader that corresponds to that package, and use that classloader to let the system search for the library itself using the standard platform library search path logic. This significantly simplifies the WebView code, but more importantly enables the library to be found even if it's not actually present in the main WebView APK and is instead stored in a shared library APK: our previous code was never updated to handle this new case when the platform introduced it. As a side effect of no longer searching for the library, we also no longer discover the size of the library, and thus cannot use the size to calculate the amount of address space to reserve. This has been replaced with a fixed size: 100MB for 32-bit processes (the previous default size for when the size had not yet been calculated), and 1GB for 64-bit processes. We do not anticipate WebView ever needing more than 100MB of virtual address space for its native library on 32-bit platforms; it currently uses about 44MB. The unit tests covering the complex library searching logic have been removed, as the functionality they are testing no longer exists. Bug: 110790153 Test: WebView-related CTS and GTS tests Change-Id: Icc7bcd0a2b33f4dbf26d0d663e098c9e207281a5
Loading
Please register or sign in to comment