Commit 1da7c754 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

Respect kLogJsConsoleMessages on all platforms

kLogJsConsoleMessages feature is used to control whether to log JS
console messages, which provides developers a quick way to control
whether to log JS messages. For example, some JS code uses a lot of log
messages which can be noisy.

Currently this feature only take effect on Android where it's disabled
by default. This CL change the logic to check this feature on all
platforms. On non-Android platforms the feature is enabled by default,
which matches the existing behavior.

To disable JS console messages in terminal, use
  --disable-features=LogJsConsoleMessages

Change-Id: I0f42e71d63f55369d1d6721c2a1c5eb3b3ef4bda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2208352Reviewed-by: default avatarHazem Ashmawy <hazems@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771261}
parent 6b28a08a
...@@ -52,10 +52,8 @@ void LogConsoleMessage(blink::mojom::ConsoleMessageLevel log_level, ...@@ -52,10 +52,8 @@ void LogConsoleMessage(blink::mojom::ConsoleMessageLevel log_level,
if (is_off_the_record && !is_builtin_component) if (is_off_the_record && !is_builtin_component)
return; return;
#if defined(OS_ANDROID)
if (!base::FeatureList::IsEnabled(features::kLogJsConsoleMessages)) if (!base::FeatureList::IsEnabled(features::kLogJsConsoleMessages))
return; return;
#endif // OS_ANDROID
logging::LogMessage("CONSOLE", line_number, resolved_level).stream() logging::LogMessage("CONSOLE", line_number, resolved_level).stream()
<< "\"" << message << "\", source: " << source_id << " (" << line_number << "\"" << message << "\", source: " << source_id << " (" << line_number
......
...@@ -324,8 +324,14 @@ const base::Feature kLazyInitializeMediaControls{ ...@@ -324,8 +324,14 @@ const base::Feature kLazyInitializeMediaControls{
const base::Feature kLegacyWindowsDWriteFontFallback{ const base::Feature kLegacyWindowsDWriteFontFallback{
"LegacyWindowsDWriteFontFallback", base::FEATURE_DISABLED_BY_DEFAULT}; "LegacyWindowsDWriteFontFallback", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kLogJsConsoleMessages{"LogJsConsoleMessages", const base::Feature kLogJsConsoleMessages {
base::FEATURE_DISABLED_BY_DEFAULT}; "LogJsConsoleMessages",
#if defined(OS_ANDROID)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
#endif
};
// Enables lowering the priority of the resources in iframes. // Enables lowering the priority of the resources in iframes.
const base::Feature kLowPriorityIframes{"LowPriorityIframes", const base::Feature kLowPriorityIframes{"LowPriorityIframes",
......
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