Chromium Code Reviews| Index: chrome/app/mash/mash_runner.cc |
| diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc |
| index e05f7ecf9dc7394c072c0346d9d9f0c514764425..6eb3cf3f62bf12d89b96e87479e020a21652b411 100644 |
| --- a/chrome/app/mash/mash_runner.cc |
| +++ b/chrome/app/mash/mash_runner.cc |
| @@ -28,6 +28,7 @@ |
| #include "base/threading/thread.h" |
| #include "base/trace_event/trace_event.h" |
| #include "chrome/app/mash/chrome_mash_catalog.h" |
| +#include "chrome/common/chrome_switches.h" |
| #include "components/tracing/common/trace_to_console.h" |
| #include "components/tracing/common/tracing_switches.h" |
| #include "content/public/common/content_switches.h" |
| @@ -116,13 +117,11 @@ class ServiceProcessLauncherDelegateImpl |
| // When launching the browser process, ensure that we don't inherit the |
| // --mash flag so it proceeds with the normal content/browser startup path. |
| - // Eliminate all copies in case the developer passed more than one. |
| - base::CommandLine::StringVector new_argv; |
| - for (const base::CommandLine::StringType& arg : command_line->argv()) { |
| - if (arg != FILE_PATH_LITERAL("--mash")) |
| - new_argv.push_back(arg); |
| - } |
| - *command_line = base::CommandLine(new_argv); |
| + base::CommandLine::SwitchMap new_switches = command_line->GetSwitches(); |
| + new_switches.erase(switches::kMash); |
| + *command_line = base::CommandLine(command_line->GetProgram()); |
| + for (const auto& sw : new_switches) |
|
sky
2017/02/08 23:30:36
optional: don't use auto, it hurts readability her
mfomitchev
2017/02/09 01:10:33
Done.
|
| + command_line->AppendSwitchNative(sw.first, sw.second); |
| } |
| DISALLOW_COPY_AND_ASSIGN(ServiceProcessLauncherDelegateImpl); |