Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: chrome/app/mash/mash_runner.cc

Issue 2681663004: Mustash: Ignore --mash flag when comparing flags in UserSessionManager. (Closed)
Patch Set: Adding braces. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/app/mash/mash_runner.cc
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc
index e436fbd92f3dbb085ba22ab8f9138f98e3eac7dc..fc63098cb8090adfc130ea8be43d4cbc660d853f 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"
@@ -110,13 +111,13 @@ 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);
+ base::CommandLine::SwitchMap new_switches = command_line->GetSwitches();
+ new_switches.erase(switches::kMash);
+ *command_line = base::CommandLine(command_line->GetProgram());
+ for (const std::pair<std::string, base::CommandLine::StringType>& sw :
+ new_switches) {
+ command_line->AppendSwitchNative(sw.first, sw.second);
}
- *command_line = base::CommandLine(new_argv);
}
DISALLOW_COPY_AND_ASSIGN(ServiceProcessLauncherDelegateImpl);

Powered by Google App Engine
This is Rietveld 408576698