Commit 728f251f authored by Tim Sergeant's avatar Tim Sergeant Committed by Commit Bot

WebLayer: Ignore strictmode violations in startup path

These disk reads on the main thread are working as intended and safe
enough to ignore.

Change-Id: I67a9a2b94e26c97c7427d283a239acefc7a400a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899615
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Auto-Submit: Tim Sergeant <tsergeant@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712682}
parent fefaa848
......@@ -17,6 +17,7 @@ import org.chromium.base.CommandLine;
import org.chromium.base.ContentUriUtils;
import org.chromium.base.ContextUtils;
import org.chromium.base.PathUtils;
import org.chromium.base.StrictModeContext;
import org.chromium.base.annotations.UsedByReflection;
import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType;
......@@ -98,13 +99,21 @@ public final class WebLayerImpl extends IWebLayer.Stub {
"org.chromium.weblayer.ChildProcessService$Sandboxed");
if (!CommandLine.isInitialized()) {
// This disk read in the critical path is for development purposes only.
// TODO: Move it to debug-only (similar to WebView), or allow clients to configure the
// command line.
try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) {
CommandLine.initFromFile(COMMAND_LINE_FILE);
}
}
DeviceUtils.addDeviceSpecificUserAgentSwitch();
ContentUriUtils.setFileProviderUtil(new FileProviderHelper());
// TODO: Validate that doing this disk IO on the main thread is necessary.
try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) {
LibraryLoader.getInstance().ensureInitialized(LibraryProcessType.PROCESS_WEBLAYER);
}
GmsBridge.getInstance().setSafeBrowsingHandler();
final ValueCallback<Boolean> loadedCallback = (ValueCallback<Boolean>) ObjectWrapper.unwrap(
......
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