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

Side by Side Diff: chrome/app/mash/mash_runner.cc

Issue 2695803004: Make browser process a singleton service (Closed)
Patch Set: . 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
« no previous file with comments | « chrome/app/mash/BUILD.gn ('k') | chrome/browser/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 public: 87 public:
88 ServiceProcessLauncherDelegateImpl() {} 88 ServiceProcessLauncherDelegateImpl() {}
89 ~ServiceProcessLauncherDelegateImpl() override {} 89 ~ServiceProcessLauncherDelegateImpl() override {}
90 90
91 private: 91 private:
92 // service_manager::ServiceProcessLauncher::Delegate: 92 // service_manager::ServiceProcessLauncher::Delegate:
93 void AdjustCommandLineArgumentsForTarget( 93 void AdjustCommandLineArgumentsForTarget(
94 const service_manager::Identity& target, 94 const service_manager::Identity& target,
95 base::CommandLine* command_line) override { 95 base::CommandLine* command_line) override {
96 if (target.name() == kChromeMashServiceName || 96 if (target.name() == kChromeMashServiceName ||
97 target.name() == content::mojom::kBrowserServiceName) { 97 target.name() == content::mojom::kPackagedServicesServiceName) {
98 base::FilePath exe_path; 98 base::FilePath exe_path;
99 base::PathService::Get(base::FILE_EXE, &exe_path); 99 base::PathService::Get(base::FILE_EXE, &exe_path);
100 command_line->SetProgram(exe_path); 100 command_line->SetProgram(exe_path);
101 } 101 }
102 if (target.name() != content::mojom::kBrowserServiceName) { 102 if (target.name() != content::mojom::kPackagedServicesServiceName) {
103 // If running anything other than the browser process, launch a mash 103 // If running anything other than the browser process, launch a mash
104 // child process. The new process will execute MashRunner::RunChild(). 104 // child process. The new process will execute MashRunner::RunChild().
105 command_line->AppendSwitchASCII(switches::kProcessType, kMashChild); 105 command_line->AppendSwitchASCII(switches::kProcessType, kMashChild);
106 #if defined(OS_WIN) 106 #if defined(OS_WIN)
107 command_line->AppendArg(switches::kPrefetchArgumentOther); 107 command_line->AppendArg(switches::kPrefetchArgumentOther);
108 #endif 108 #endif
109 return; 109 return;
110 } 110 }
111 111
112 // 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
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 command_line->GetSwitchValueASCII(switches::kWaitForDebugger)) { 287 command_line->GetSwitchValueASCII(switches::kWaitForDebugger)) {
288 return; 288 return;
289 } 289 }
290 290
291 // Include the pid as logging may not have been initialized yet (the pid 291 // Include the pid as logging may not have been initialized yet (the pid
292 // printed out by logging is wrong). 292 // printed out by logging is wrong).
293 LOG(WARNING) << "waiting for debugger to attach for service " << service_name 293 LOG(WARNING) << "waiting for debugger to attach for service " << service_name
294 << " pid=" << base::Process::Current().Pid(); 294 << " pid=" << base::Process::Current().Pid();
295 base::debug::WaitForDebugger(120, true); 295 base::debug::WaitForDebugger(120, true);
296 } 296 }
OLDNEW
« no previous file with comments | « chrome/app/mash/BUILD.gn ('k') | chrome/browser/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698