Commit a8f6fbe9 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

[AW][Dev-UI] generate AwSwitches from aw_switches.cc

No change to logic. This generates AwSwitches.java from aw_switches.cc
using java_cpp_strings.

Fixed: 956803
Test: autoninja -C out/Default system_webview_google_apk
Test: run_webview_instrumentation_test_apk -f=SafeBrowsingTest.*
Change-Id: I1933e812e5206eb8ae087d30e1abf61d2695991a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343951
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796505}
parent 7dbfe501
...@@ -647,11 +647,17 @@ android_library("common_crash_java") { ...@@ -647,11 +647,17 @@ android_library("common_crash_java") {
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
} }
java_cpp_strings("common_java_switches_srcjar") {
# External code should depend on "common_java" instead.
visibility = [ ":*" ]
sources = [ "common/aw_switches.cc" ]
template = "java/src/org/chromium/android_webview/common/AwSwitches.java.tmpl"
}
android_library("common_java") { android_library("common_java") {
sources = [ sources = [
"java/src/org/chromium/android_webview/common/AwFeatures.java", "java/src/org/chromium/android_webview/common/AwFeatures.java",
"java/src/org/chromium/android_webview/common/AwResource.java", "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/CommandLineUtil.java",
"java/src/org/chromium/android_webview/common/DeveloperModeUtils.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/Flag.java",
...@@ -664,6 +670,7 @@ android_library("common_java") { ...@@ -664,6 +670,7 @@ android_library("common_java") {
"//components/metrics:metrics_java", "//components/metrics:metrics_java",
"//third_party/android_deps:androidx_annotation_annotation_java", "//third_party/android_deps:androidx_annotation_annotation_java",
] ]
srcjar_deps = [ ":common_java_switches_srcjar" ]
} }
android_aidl("common_aidl") { android_aidl("common_aidl") {
......
...@@ -11,10 +11,42 @@ const char kWebViewLogJsConsoleMessages[] = "webview-log-js-console-messages"; ...@@ -11,10 +11,42 @@ const char kWebViewLogJsConsoleMessages[] = "webview-log-js-console-messages";
const char kWebViewSandboxedRenderer[] = "webview-sandboxed-renderer"; const char kWebViewSandboxedRenderer[] = "webview-sandboxed-renderer";
// used to disable safebrowsing functionality in webview // used to disable safebrowsing functionality in webview
const char kWebViewDisableSafeBrowsingSupport[] = const char kWebViewDisableSafebrowsingSupport[] =
"webview-disable-safebrowsing-support"; "webview-disable-safebrowsing-support";
// Used to enable vulkan draw mode instead of interop draw mode for webview. // Used to enable vulkan draw mode instead of interop draw mode for webview.
const char kWebViewEnableVulkan[] = "webview-enable-vulkan"; const char kWebViewEnableVulkan[] = "webview-enable-vulkan";
// Enables SafeBrowsing and causes WebView to treat all resources as malicious.
// Use care: this will block all resources from loading.
const char kWebViewSafebrowsingBlockAllResources[] =
"webview-safebrowsing-block-all-resources";
// Highlight the contents (including web contents) of all WebViews with a yellow
// tint. This is useful for identifying WebViews in an Android application.
const char kHighlightAllWebViews[] = "highlight-all-webviews";
// WebView will log additional debugging information to logcat, such as
// variations and commandline state.
const char kWebViewVerboseLogging[] = "webview-verbose-logging";
// The length of time in seconds that an app's copy of the variations seed
// should be considered fresh. If an app's seed is older than this, a new seed
// will be requested from WebView's IVariationsSeedServer.
const char kFinchSeedExpirationAge[] = "finch-seed-expiration-age";
// Forces WebView's service to always schedule a new variations seed download
// job, even if one is already pending.
const char kFinchSeedIgnorePendingDownload[] =
"finch-seed-ignore-pending-download";
// The minimum amount of time in seconds that WebView's service will wait
// between two variations seed downloads from the variations server.
const char kFinchSeedMinDownloadPeriod[] = "finch-seed-min-download-period";
// The minimum amount of time in seconds that the embedded WebView
// implementation will wait between two requests to WebView's service for a new
// variations seed.
const char kFinchSeedMinUpdatePeriod[] = "finch-seed-min-update-period";
} // namespace switches } // namespace switches
...@@ -9,12 +9,15 @@ namespace switches { ...@@ -9,12 +9,15 @@ namespace switches {
extern const char kWebViewLogJsConsoleMessages[]; extern const char kWebViewLogJsConsoleMessages[];
extern const char kWebViewSandboxedRenderer[]; extern const char kWebViewSandboxedRenderer[];
extern const char kWebViewDisableSafeBrowsingSupport[]; extern const char kWebViewDisableSafebrowsingSupport[];
extern const char kWebViewEnableVulkan[]; extern const char kWebViewEnableVulkan[];
extern const char kWebViewSafebrowsingBlockAllResources[];
// Please note that if you are adding a flag that is intended for a renderer, extern const char kHighlightAllWebViews[];
// you also need to add it into extern const char kWebViewVerboseLogging[];
// AwContentBrowserClient::AppendExtraCommandLineSwitches. extern const char kFinchSeedExpirationAge[];
extern const char kFinchSeedIgnorePendingDownload[];
extern const char kFinchSeedMinDownloadPeriod[];
extern const char kFinchSeedMinUpdatePeriod[];
} // namespace switches } // namespace switches
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
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";
// Highlight the contents (including web contents) of all WebViews with a yellow tint. This is
// useful for identifying WebViews in an Android application.
public static final String HIGHLIGHT_ALL_WEBVIEWS = "highlight-all-webviews";
// WebView will log additional debugging information to logcat, such as variations and
// commandline state.
public static final String WEBVIEW_VERBOSE_LOGGING = "webview-verbose-logging";
// 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.
public static final String WEBVIEW_LOG_JS_CONSOLE_MESSAGES = "webview-log-js-console-messages";
// Indicate that renderers are running in a sandbox. Enables
// kInProcessGPU and sets kRendererProcessLimit to 1.
// Native switch kWebViewSandboxedRenderer.
public static final String WEBVIEW_SANDBOXED_RENDERER = "webview-sandboxed-renderer";
// Disables safebrowsing functionality in webview.
// Native switch kWebViewDisableSafeBrowsingSupport.
public static final String WEBVIEW_DISABLE_SAFEBROWSING_SUPPORT =
"webview-disable-safebrowsing-support";
// Enables SafeBrowsing and causes WebView to treat all resources as malicious. Use care: this
// will block all resources from loading.
// No native switch.
public static final String WEBVIEW_SAFEBROWSING_BLOCK_ALL_RESOURCES =
"webview-safebrowsing-block-all-resources";
// The length of time in seconds that an app's copy of the variations seed should be considered
// fresh. If an app's seed is older than this, a new seed will be requested from WebView's
// IVariationsSeedServer.
// No native switch.
public static final String FINCH_SEED_EXPIRATION_AGE = "finch-seed-expiration-age";
// Forces WebView's service to always schedule a new variations seed download job, even if one
// is already pending.
// No native switch.
public static final String FINCH_SEED_IGNORE_PENDING_DOWNLOAD =
"finch-seed-ignore-pending-download";
// The minimum amount of time in seconds that WebView's service will wait between two
// variations seed downloads from the variations server.
// No native switch.
public static final String FINCH_SEED_MIN_DOWNLOAD_PERIOD = "finch-seed-min-download-period";
// The minimum amount of time in seconds that the embedded WebView implementation will wait
// between two requests to WebView's service for a new variations seed.
// No native switch.
public static final String FINCH_SEED_MIN_UPDATE_PERIOD = "finch-seed-min-update-period";
// Do not instantiate this class.
private AwSwitches() {}
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.android_webview.common;
/**
* Contains command line switches that are specific to Android WebView.
*/
public final class AwSwitches {{
{NATIVE_STRINGS}
// Native switch kEnableCrashReporterForTesting in //base/base_switches.h
public static final String CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH =
"enable-crash-reporter-for-testing";
// Do not instantiate this class.
private AwSwitches() {{}}
}}
...@@ -51,7 +51,7 @@ public final class ProductionSupportedFlagList { ...@@ -51,7 +51,7 @@ public final class ProductionSupportedFlagList {
"Forces WebView's metrics reporting to be enabled. This overrides user " "Forces WebView's metrics reporting to be enabled. This overrides user "
+ "settings and capacity sampling, but does not override the app's " + "settings and capacity sampling, but does not override the app's "
+ "choice to opt-out."), + "choice to opt-out."),
Flag.commandLine("webview-log-js-console-messages", Flag.commandLine(AwSwitches.WEBVIEW_LOG_JS_CONSOLE_MESSAGES,
"Mirrors JavaScript console messages to system logs."), "Mirrors JavaScript console messages to system logs."),
Flag.commandLine(AwSwitches.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 " "Used for turning on Breakpad crash reporting in a debug environment where "
......
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