Commit 802a518a authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Change WebLayer ClassLoader parent to bootstrap ClassLoader

This is the parent the system uses when creating ClassLoaders, so it
makes sense to match that:
https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/app/ApplicationLoaders.java

Startup time improvements:
8% on android-go: https://pinpoint-dot-chromeperf.appspot.com/job/10079579520000
9% on Pixel 2: https://pinpoint-dot-chromeperf.appspot.com/job/16c9aec6520000

3.4% improvement in first contentful paint: https://pinpoint-dot-chromeperf.appspot.com/job/13b83f01520000

Bug: 1146438
Change-Id: I157fb0d69ac8e2e9a4f14887d6530d02e2748090
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521936
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825421}
parent cb6a48b6
......@@ -46,8 +46,11 @@ final class WebViewCompatibilityHelper {
// this to a background thread.
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
// Use the system class loader's parent here, since it is much more efficient. This
// matches what Android does when constructing class loaders, see
// android.app.ApplicationLoaders.
return new PathClassLoader(
dexPath, librarySearchPath, ClassLoader.getSystemClassLoader()) {
dexPath, librarySearchPath, ClassLoader.getSystemClassLoader().getParent()) {
@Override
public Class<?> loadClass(String name) throws ClassNotFoundException {
// TODO(crbug.com/1112001): Investigate why loading classes causes strict mode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment