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

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

Issue 2692853013: Misc. fixes to MashRunner environment (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/chrome_mash_manifest.json ('k') | no next file » | 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // 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
127 // system (e.g. the window manager). Used in the main process. 127 // system (e.g. the window manager). Used in the main process.
128 void OnInstanceQuitInMain(base::RunLoop* run_loop, 128 void OnInstanceQuitInMain(base::RunLoop* run_loop,
129 int* exit_value, 129 int* exit_value,
130 const service_manager::Identity& identity) { 130 const service_manager::Identity& identity) {
131 DCHECK(exit_value); 131 DCHECK(exit_value);
132 DCHECK(run_loop); 132 DCHECK(run_loop);
133 133
134 if (identity.name() != mash::common::GetWindowManagerServiceName() && 134 if (identity.name() != mash::common::GetWindowManagerServiceName() &&
135 identity.name() != ui::mojom::kServiceName && 135 identity.name() != ui::mojom::kServiceName &&
136 identity.name() != content::mojom::kBrowserServiceName) { 136 identity.name() != content::mojom::kPackagedServicesServiceName) {
137 return; 137 return;
138 } 138 }
139 139
140 LOG(ERROR) << "Main process exiting because service " << identity.name() 140 LOG(ERROR) << "Main process exiting because service " << identity.name()
141 << " quit unexpectedly."; 141 << " quit unexpectedly.";
142 *exit_value = 1; 142 *exit_value = 1;
143 run_loop->Quit(); 143 run_loop->Quit();
144 } 144 }
145 145
146 } // namespace 146 } // namespace
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 base::RunLoop run_loop; 201 base::RunLoop run_loop;
202 int exit_value = 0; 202 int exit_value = 0;
203 background_service_manager.SetInstanceQuitCallback( 203 background_service_manager.SetInstanceQuitCallback(
204 base::Bind(&OnInstanceQuitInMain, &run_loop, &exit_value)); 204 base::Bind(&OnInstanceQuitInMain, &run_loop, &exit_value));
205 205
206 // Ping services that we know we want to launch on startup (UI service, 206 // Ping services that we know we want to launch on startup (UI service,
207 // window manager, quick launch app). 207 // window manager, quick launch app).
208 context.connector()->Connect(ui::mojom::kServiceName); 208 context.connector()->Connect(ui::mojom::kServiceName);
209 context.connector()->Connect(mash::common::GetWindowManagerServiceName()); 209 context.connector()->Connect(mash::common::GetWindowManagerServiceName());
210 context.connector()->Connect(mash::quick_launch::mojom::kServiceName); 210 context.connector()->Connect(mash::quick_launch::mojom::kServiceName);
211 context.connector()->Connect(content::mojom::kBrowserServiceName); 211 context.connector()->Connect(content::mojom::kPackagedServicesServiceName);
212 212
213 run_loop.Run(); 213 run_loop.Run();
214 214
215 // |context| must be destroyed before the message loop. 215 // |context| must be destroyed before the message loop.
216 return exit_value; 216 return exit_value;
217 } 217 }
218 218
219 int MashRunner::RunChild() { 219 int MashRunner::RunChild() {
220 service_manager::WaitForDebuggerIfNecessary(); 220 service_manager::WaitForDebuggerIfNecessary();
221 221
(...skipping 65 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/chrome_mash_manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698