Commit 3a3eab53 authored by Robbie McElrath's avatar Robbie McElrath Committed by Commit Bot

[AW] Move CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH to AwSwitches

This moves a flag from CommandLineUtil to AwSwitches with the others,
and removes the //aw:common_commandline_java build target, which isn't
needed.

Test: ninja -C out/aw system_webview_apk
Bug: 1035235
Change-Id: Ib58d4269b8dc845948bc83a8ad788dc074376a48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2005609
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733042}
parent b893b1eb
......@@ -444,7 +444,6 @@ android_library("browser_java") {
]
deps = [
":common_aidl_java",
":common_commandline_java",
":common_crash_java",
":common_java",
":common_platform_services_java",
......@@ -558,6 +557,7 @@ android_library("common_java") {
sources = [
"java/src/org/chromium/android_webview/common/AwResource.java",
"java/src/org/chromium/android_webview/common/AwSwitches.java",
"java/src/org/chromium/android_webview/common/CommandLineUtil.java",
"java/src/org/chromium/android_webview/common/DeveloperModeUtils.java",
"java/src/org/chromium/android_webview/common/Flag.java",
"java/src/org/chromium/android_webview/common/FlagOverrideHelper.java",
......@@ -565,22 +565,11 @@ android_library("common_java") {
"java/src/org/chromium/android_webview/common/services/ServiceNames.java",
]
deps = [
":common_commandline_java",
"//base:base_java",
"//third_party/android_deps:androidx_annotation_annotation_java",
]
}
android_library("common_commandline_java") {
sources = [
"java/src/org/chromium/android_webview/common/CommandLineUtil.java",
]
deps = [
"//base:base_java",
]
}
android_aidl("common_aidl") {
import_include = [ "java/src" ]
sources = [
......
......@@ -11,7 +11,6 @@ android_library("glue") {
deps = [
"//android_webview:android_webview_product_config_java",
"//android_webview:browser_java",
"//android_webview:common_commandline_java",
"//android_webview:common_java",
"//android_webview/nonembedded:system_webview_manifest",
"//android_webview/support_library/boundary_interfaces:boundary_interface_java",
......
......@@ -15,7 +15,6 @@ import android.os.RemoteException;
import android.os.StrictMode;
import org.chromium.android_webview.common.AwSwitches;
import org.chromium.android_webview.common.CommandLineUtil;
import org.chromium.android_webview.common.PlatformServiceBridge;
import org.chromium.android_webview.common.services.ICrashReceiverService;
import org.chromium.android_webview.common.services.ServiceNames;
......@@ -214,7 +213,7 @@ public final class AwBrowserProcess {
try (ScopedSysTraceEvent e1 = ScopedSysTraceEvent.scoped(
"AwBrowserProcess.handleMinidumpsAndSetMetricsConsent")) {
final boolean enableMinidumpUploadingForTesting = CommandLine.getInstance().hasSwitch(
CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH);
AwSwitches.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH);
if (enableMinidumpUploadingForTesting) {
handleMinidumps(true /* enabled */);
}
......
......@@ -8,6 +8,10 @@ package org.chromium.android_webview.common;
* Contains command line switches that are specific to Android WebView.
*/
public final class AwSwitches {
// Native switch kEnableCrashReporterForTesting in //base/base_switches.h
public static final String CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH =
"enable-crash-reporter-for-testing";
// Allow mirroring JS console messages to system logs. This is the default behavior on
// debuggable devices (userdebug or eng), so there is no reason for a user to specify this
// explicitly. Native switch kWebViewLogJsConsoleMessages.
......
......@@ -18,10 +18,6 @@ public class CommandLineUtil {
public static final String WEBVIEW_COMMAND_LINE_FILE = "/data/local/tmp/webview-command-line";
// same switch as kEnableCrashReporterForTesting in //base/base_switches.h
public static final String CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH =
"enable-crash-reporter-for-testing";
private static final String COMMAND_LINE_UTIL_INTERNAL =
"org.chromium.android_webview.common.CommandLineUtilInternal";
......
......@@ -28,7 +28,7 @@ public final class ProductionSupportedFlagList {
+ "compositing."),
Flag.commandLine("webview-log-js-console-messages",
"Mirrors JavaScript console messages to system logs."),
Flag.commandLine(CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH,
Flag.commandLine(AwSwitches.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH,
"Used for turning on Breakpad crash reporting in a debug environment where "
+ "crash reporting is typically compiled but disabled."),
Flag.baseFeature("OutOfBlinkCors",
......
......@@ -24,7 +24,7 @@ android_library("nonembedded_java") {
":devui_java",
":services_java",
"//android_webview:android_webview_product_config_java",
"//android_webview:common_commandline_java",
"//android_webview:common_java",
"//base:base_java",
"//base:jni_java",
"//components/about_ui/android:aboutui_java",
......@@ -53,7 +53,6 @@ android_library("devui_java") {
":devui_resources",
":system_webview_manifest",
"//android_webview:common_aidl_java",
"//android_webview:common_commandline_java",
"//android_webview:common_crash_java",
"//android_webview:common_java",
"//android_webview:common_platform_services_java",
......@@ -80,7 +79,6 @@ android_library("services_java") {
deps = [
":system_webview_manifest",
"//android_webview:common_aidl_java",
"//android_webview:common_commandline_java",
"//android_webview:common_crash_java",
"//android_webview:common_java",
"//android_webview:common_platform_services_java",
......
......@@ -27,7 +27,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import org.chromium.android_webview.common.CommandLineUtil;
import org.chromium.android_webview.common.AwSwitches;
import org.chromium.android_webview.common.PlatformServiceBridge;
import org.chromium.android_webview.common.crash.CrashInfo;
import org.chromium.android_webview.common.crash.CrashInfo.UploadState;
......@@ -102,7 +102,7 @@ public class CrashesListActivity extends Activity {
mDifferentPackageError.showDialogIfDifferent();
final boolean enableMinidumpUploadingForTesting = CommandLine.getInstance().hasSwitch(
CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH);
AwSwitches.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH);
if (!enableMinidumpUploadingForTesting) {
PlatformServiceBridge.getInstance().queryMetricsSetting(enabled -> {
// enabled is a Boolean object and can be null.
......
......@@ -9,7 +9,7 @@ import android.net.ConnectivityManager;
import androidx.annotation.VisibleForTesting;
import org.chromium.android_webview.common.CommandLineUtil;
import org.chromium.android_webview.common.AwSwitches;
import org.chromium.android_webview.common.PlatformServiceBridge;
import org.chromium.android_webview.common.crash.SystemWideCrashDirectories;
import org.chromium.base.CommandLine;
......@@ -108,7 +108,7 @@ public class AwMinidumpUploaderDelegate implements MinidumpUploaderDelegate {
// on the main thread, but before the current worker thread started - so this thread
// will have seen the initialization of the CommandLine.
return CommandLine.getInstance().hasSwitch(
CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH);
AwSwitches.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH);
}
};
}
......
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