Commit 89d78cd2 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

weblayer: only read command line flags in debug builds

I believe the directory we're reading flags from is global, so
we should only attempt to do this in debug builds.

BUG=1034147
TEST=none

Change-Id: Ib7701bd12d900031470b13d73db5d88572b41e35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972210Reviewed-by: default avatarClark DuVall <cduvall@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725664}
parent 1f7499d3
......@@ -56,7 +56,7 @@ public final class WebLayerImpl extends IWebLayer.Stub {
// TODO: should there be one tag for all this code?
private static final String TAG = "WebLayer";
private static final String PRIVATE_DIRECTORY_SUFFIX = "weblayer";
// TODO: Configure this from the client.
// Command line flags are only read in debug builds.
private static final String COMMAND_LINE_FILE = "/data/local/tmp/weblayer-command-line";
private final ProfileManager mProfileManager = new ProfileManager();
......@@ -158,11 +158,13 @@ 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);
if (BuildInfo.isDebugAndroid()) {
// This disk read in the critical path is for development purposes only.
try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) {
CommandLine.initFromFile(COMMAND_LINE_FILE);
}
} else {
CommandLine.init(null);
}
}
......
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