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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/app/mash/mash_runner.h" 5 #include "chrome/app/mash/mash_runner.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 10 matching lines...) Expand all
21 #include "base/path_service.h" 21 #include "base/path_service.h"
22 #include "base/process/launch.h" 22 #include "base/process/launch.h"
23 #include "base/process/process.h" 23 #include "base/process/process.h"
24 #include "base/run_loop.h" 24 #include "base/run_loop.h"
25 #include "base/sys_info.h" 25 #include "base/sys_info.h"
26 #include "base/task_scheduler/task_scheduler.h" 26 #include "base/task_scheduler/task_scheduler.h"
27 #include "base/threading/sequenced_worker_pool.h" 27 #include "base/threading/sequenced_worker_pool.h"
28 #include "base/threading/thread.h" 28 #include "base/threading/thread.h"
29 #include "base/trace_event/trace_event.h" 29 #include "base/trace_event/trace_event.h"
30 #include "chrome/app/mash/chrome_mash_catalog.h" 30 #include "chrome/app/mash/chrome_mash_catalog.h"
31 #include "chrome/common/chrome_switches.h"
31 #include "components/tracing/common/trace_to_console.h" 32 #include "components/tracing/common/trace_to_console.h"
32 #include "components/tracing/common/tracing_switches.h" 33 #include "components/tracing/common/tracing_switches.h"
33 #include "content/public/common/content_switches.h" 34 #include "content/public/common/content_switches.h"
34 #include "content/public/common/service_names.mojom.h" 35 #include "content/public/common/service_names.mojom.h"
35 #include "mash/common/config.h" 36 #include "mash/common/config.h"
36 #include "mash/package/mash_packaged_service.h" 37 #include "mash/package/mash_packaged_service.h"
37 #include "mash/quick_launch/public/interfaces/constants.mojom.h" 38 #include "mash/quick_launch/public/interfaces/constants.mojom.h"
38 #include "mojo/edk/embedder/embedder.h" 39 #include "mojo/edk/embedder/embedder.h"
39 #include "mojo/edk/embedder/scoped_ipc_support.h" 40 #include "mojo/edk/embedder/scoped_ipc_support.h"
40 #include "mojo/public/cpp/bindings/binding_set.h" 41 #include "mojo/public/cpp/bindings/binding_set.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // child process. The new process will execute MashRunner::RunChild(). 104 // child process. The new process will execute MashRunner::RunChild().
104 command_line->AppendSwitchASCII(switches::kProcessType, kMashChild); 105 command_line->AppendSwitchASCII(switches::kProcessType, kMashChild);
105 #if defined(OS_WIN) 106 #if defined(OS_WIN)
106 command_line->AppendArg(switches::kPrefetchArgumentOther); 107 command_line->AppendArg(switches::kPrefetchArgumentOther);
107 #endif 108 #endif
108 return; 109 return;
109 } 110 }
110 111
111 // When launching the browser process, ensure that we don't inherit the 112 // When launching the browser process, ensure that we don't inherit the
112 // --mash flag so it proceeds with the normal content/browser startup path. 113 // --mash flag so it proceeds with the normal content/browser startup path.
113 // Eliminate all copies in case the developer passed more than one. 114 base::CommandLine::SwitchMap new_switches = command_line->GetSwitches();
114 base::CommandLine::StringVector new_argv; 115 new_switches.erase(switches::kMash);
115 for (const base::CommandLine::StringType& arg : command_line->argv()) { 116 *command_line = base::CommandLine(command_line->GetProgram());
116 if (arg != FILE_PATH_LITERAL("--mash")) 117 for (const std::pair<std::string, base::CommandLine::StringType>& sw :
117 new_argv.push_back(arg); 118 new_switches) {
119 command_line->AppendSwitchNative(sw.first, sw.second);
118 } 120 }
119 *command_line = base::CommandLine(new_argv);
120 } 121 }
121 122
122 DISALLOW_COPY_AND_ASSIGN(ServiceProcessLauncherDelegateImpl); 123 DISALLOW_COPY_AND_ASSIGN(ServiceProcessLauncherDelegateImpl);
123 }; 124 };
124 125
125 // Quits |run_loop| if the |identity| of the quitting service is critical to the 126 // Quits |run_loop| if the |identity| of the quitting service is critical to the
126 // system (e.g. the window manager). Used in the main process. 127 // system (e.g. the window manager). Used in the main process.
127 void OnInstanceQuitInMain(base::RunLoop* run_loop, 128 void OnInstanceQuitInMain(base::RunLoop* run_loop,
128 int* exit_value, 129 int* exit_value,
129 const service_manager::Identity& identity) { 130 const service_manager::Identity& identity) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 command_line->GetSwitchValueASCII(switches::kWaitForDebugger)) { 286 command_line->GetSwitchValueASCII(switches::kWaitForDebugger)) {
286 return; 287 return;
287 } 288 }
288 289
289 // Include the pid as logging may not have been initialized yet (the pid 290 // Include the pid as logging may not have been initialized yet (the pid
290 // printed out by logging is wrong). 291 // printed out by logging is wrong).
291 LOG(WARNING) << "waiting for debugger to attach for service " << service_name 292 LOG(WARNING) << "waiting for debugger to attach for service " << service_name
292 << " pid=" << base::Process::Current().Pid(); 293 << " pid=" << base::Process::Current().Pid();
293 base::debug::WaitForDebugger(120, true); 294 base::debug::WaitForDebugger(120, true);
294 } 295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698