Commit 3a4b1617 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

chromeos: copy command line switches to ash services

Ash related services, such as shortcut-viewer, create various objects that
read command line flags (such as ui::Compositor). This makes such services
copy the command line flags from chrome. Long term we shold move to a whitelist,
but shorterm not copying all flags is causing display problems for some devices.

BUG=906954,905569
TEST=none

Change-Id: I408798f0c0a6145b84a926f464a6d76b3a116bb9
Reviewed-on: https://chromium-review.googlesource.com/c/1346690Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610164}
parent 79f096f4
...@@ -487,10 +487,6 @@ ...@@ -487,10 +487,6 @@
#include "extensions/common/switches.h" #include "extensions/common/switches.h"
#endif // BUILDFLAG(ENABLE_EXTENSIONS) #endif // BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_MUS)
#include "services/ws/public/mojom/constants.mojom.h"
#endif
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
#include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h" #include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h"
#include "chrome/browser/plugins/flash_download_interception.h" #include "chrome/browser/plugins/flash_download_interception.h"
...@@ -2166,29 +2162,23 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( ...@@ -2166,29 +2162,23 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
void ChromeContentBrowserClient::AdjustUtilityServiceProcessCommandLine( void ChromeContentBrowserClient::AdjustUtilityServiceProcessCommandLine(
const service_manager::Identity& identity, const service_manager::Identity& identity,
base::CommandLine* command_line) { base::CommandLine* command_line) {
#if BUILDFLAG(ENABLE_MUS)
bool copy_switches = false;
if (identity.name() == ws::mojom::kServiceName) {
command_line->AppendSwitch(switches::kMessageLoopTypeUi);
copy_switches = true;
}
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
bool copy_switches = false;
if (identity.name() == ash::mojom::kServiceName) { if (identity.name() == ash::mojom::kServiceName) {
command_line->AppendSwitch(switches::kMessageLoopTypeUi);
copy_switches = true; copy_switches = true;
command_line->AppendSwitch(switches::kMessageLoopTypeUi);
} }
if (ash_service_registry::IsAshRelatedServiceName(identity.name())) { if (ash_service_registry::IsAshRelatedServiceName(identity.name())) {
// Ash services also need command line flags, as some flags are used to
// configure the compositor.
copy_switches = true;
command_line->AppendSwitchASCII(switches::kMashServiceName, command_line->AppendSwitchASCII(switches::kMashServiceName,
identity.name()); identity.name());
} }
// TODO(crbug.com/906954): whitelist flags to copy.
for (const auto& sw : base::CommandLine::ForCurrentProcess()->GetSwitches())
command_line->AppendSwitchNative(sw.first, sw.second);
#endif #endif
// TODO(sky): move to a whitelist, but currently the set of flags is rather
// sprawling.
if (copy_switches) {
for (const auto& sw : base::CommandLine::ForCurrentProcess()->GetSwitches())
command_line->AppendSwitchNative(sw.first, sw.second);
}
#endif // BUILDFLAG(ENABLE_MUS)
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// On Mac, the video-capture and audio services require a CFRunLoop, provided // On Mac, the video-capture and audio services require a CFRunLoop, provided
......
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