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

Unified Diff: services/service_manager/service_manager.cc

Issue 2576233002: Consolidating the mojo NativeRunner functionality. (Closed)
Patch Set: Merged mojo_runner_host_unittests in service_manager_unittests 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 | « services/service_manager/service_manager.h ('k') | services/service_manager/standalone/context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/service_manager/service_manager.cc
diff --git a/services/service_manager/service_manager.cc b/services/service_manager/service_manager.cc
index 5f1e81a0538a39df8a0dd1bd22049408573d366c..8a31966424c429a37b634c9e6482876b77831715 100644
--- a/services/service_manager/service_manager.cc
+++ b/services/service_manager/service_manager.cc
@@ -122,11 +122,6 @@ class ServiceManager::Instance
~Instance() override {
Stop();
-
- // Release |runner_| so that if we are called back to OnRunnerCompleted()
- // we know we're in the destructor.
- std::unique_ptr<NativeRunner> runner = std::move(runner_);
- runner.reset();
}
bool ConnectToService(std::unique_ptr<ConnectParams>* connect_params) {
@@ -182,14 +177,13 @@ class ServiceManager::Instance
bool StartWithFilePath(const base::FilePath& path) {
DCHECK(!service_);
DCHECK(!path.empty());
- runner_ = service_manager_->native_runner_factory_->Create(path);
+ runner_ = service_manager_->service_process_launcher_factory_->Create(path);
if (!runner_)
return false;
bool start_sandboxed = false;
mojom::ServicePtr service = runner_->Start(
identity_, start_sandboxed,
- base::Bind(&Instance::PIDAvailable, weak_factory_.GetWeakPtr()),
- base::Bind(&Instance::OnRunnerCompleted, weak_factory_.GetWeakPtr()));
+ base::Bind(&Instance::PIDAvailable, weak_factory_.GetWeakPtr()));
StartWithService(std::move(service));
return true;
}
@@ -430,14 +424,6 @@ class ServiceManager::Instance
service_manager_->NotifyServiceStarted(identity_, pid_);
}
- // Callback when NativeRunner completes.
- void OnRunnerCompleted() {
- if (!runner_.get())
- return; // We're in the destructor.
-
- service_manager_->OnInstanceError(this);
- }
-
// mojom::ServiceControl:
void RequestQuit() override {
// If quit is requested, oblige when there are no pending OnConnects.
@@ -455,7 +441,7 @@ class ServiceManager::Instance
const InterfaceProviderSpecMap interface_provider_specs_;
const InterfaceProviderSpec empty_spec_;
const bool allow_any_application_;
- std::unique_ptr<NativeRunner> runner_;
+ std::unique_ptr<ServiceProcessLauncher> runner_;
mojom::ServicePtr service_;
mojo::Binding<mojom::PIDReceiver> pid_receiver_binding_;
mojo::BindingSet<mojom::Connector> connectors_;
@@ -521,9 +507,11 @@ bool ServiceManager::TestAPI::HasRunningInstanceForName(
// ServiceManager, public:
ServiceManager::ServiceManager(
- std::unique_ptr<NativeRunnerFactory> native_runner_factory,
+ std::unique_ptr<ServiceProcessLauncherFactory>
+ service_process_launcher_factory,
mojom::ServicePtr catalog)
- : native_runner_factory_(std::move(native_runner_factory)),
+ : service_process_launcher_factory_(
+ std::move(service_process_launcher_factory)),
weak_ptr_factory_(this) {
mojom::ServicePtr service;
mojom::ServiceRequest request = mojo::GetProxy(&service);
« no previous file with comments | « services/service_manager/service_manager.h ('k') | services/service_manager/standalone/context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698