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

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

Issue 2566663004: Revert of Build services as standalone executables (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « chrome/app/mash/BUILD.gn ('k') | chrome/test/base/mash_browser_tests_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/mash/mash_runner.cc
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc
index ddcb2605cc1a1e23ea909b28615b5319280979b4..6f43edba3363963bf5e6a841388613c073d34783 100644
--- a/chrome/app/mash/mash_runner.cc
+++ b/chrome/app/mash/mash_runner.cc
@@ -32,9 +32,10 @@
#include "services/service_manager/public/cpp/identity.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_context.h"
-#include "services/service_manager/public/cpp/standalone_service/standalone_service.h"
#include "services/service_manager/public/interfaces/service_factory.mojom.h"
#include "services/service_manager/runner/common/switches.h"
+#include "services/service_manager/runner/host/child_process.h"
+#include "services/service_manager/runner/host/child_process_base.h"
#include "services/service_manager/runner/init.h"
#include "services/service_manager/standalone/context.h"
#include "ui/base/resource/resource_bundle.h"
@@ -92,11 +93,6 @@
void AdjustCommandLineArgumentsForTarget(
const service_manager::Identity& target,
base::CommandLine* command_line) override {
- if (target.name() == kChromeMashServiceName ||
- target.name() == content::mojom::kBrowserServiceName) {
- command_line->SetProgram(
- base::CommandLine::ForCurrentProcess()->GetProgram());
- }
if (target.name() != content::mojom::kBrowserServiceName) {
// If running anything other than the browser process, launch a mash
// child process. The new process will execute MashRunner::RunChild().
@@ -193,9 +189,16 @@
service_manager::WaitForDebuggerIfNecessary();
+ base::FilePath path =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
+ switches::kChildProcess);
+ if (base::PathExists(path))
+ return service_manager::ChildProcessMain();
+
+ // If the path doesn't exist - try launching this as a packaged service.
base::i18n::InitializeICU();
InitializeResources();
- service_manager::RunStandaloneService(
+ service_manager::ChildProcessMainWithCallback(
base::Bind(&MashRunner::StartChildApp, base::Unretained(this)));
return 0;
}
« no previous file with comments | « chrome/app/mash/BUILD.gn ('k') | chrome/test/base/mash_browser_tests_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698