Commit 3defc0e7 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Remove strict mode violation exception in WebLayer class loader

This may not be needed anymore, bots seem to pass without it. It looks
like this was significantly slowing down startup, so if this does pop up
again we probably want to find a better way to deal with it.

Startup time improvements:
7.9% on android-go: https://pinpoint-dot-chromeperf.appspot.com/job/15b854a9520000
10.7% on Pixel 2: https://pinpoint-dot-chromeperf.appspot.com/job/12c81a5b520000

3.7% improvement in first contentful paint: https://pinpoint-dot-chromeperf.appspot.com/job/16b631cd520000

Bug: 1146438, 1112001
Change-Id: Icb2dd4333146c866bf67048040414c965eb93513
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2535615Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827286}
parent f67a710e
...@@ -50,19 +50,7 @@ final class WebViewCompatibilityHelper { ...@@ -50,19 +50,7 @@ final class WebViewCompatibilityHelper {
// matches what Android does when constructing class loaders, see // matches what Android does when constructing class loaders, see
// android.app.ApplicationLoaders. // android.app.ApplicationLoaders.
return new PathClassLoader( return new PathClassLoader(
dexPath, librarySearchPath, ClassLoader.getSystemClassLoader().getParent()) { dexPath, librarySearchPath, ClassLoader.getSystemClassLoader().getParent());
@Override
public Class<?> loadClass(String name) throws ClassNotFoundException {
// TODO(crbug.com/1112001): Investigate why loading classes causes strict mode
// violations in some situations.
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
return super.loadClass(name);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
}
};
} finally { } finally {
StrictMode.setThreadPolicy(oldPolicy); StrictMode.setThreadPolicy(oldPolicy);
} }
......
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