| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/callback.h" |
| 6 #include "services/service_manager/public/interfaces/service.mojom.h" |
| 7 |
| 8 namespace service_manager { |
| 9 |
| 10 using StandaloneServiceCallback = base::Callback<void(mojom::ServiceRequest)>; |
| 11 |
| 12 // Runs a standalone service in the current process. This takes care of setting |
| 13 // up a boilerplate environment, including initializing //base objects, Mojo |
| 14 // IPC, running a MessageLoop, and establishing a connection to the Service |
| 15 // Manager via canonical command-line arguments. |
| 16 // |
| 17 // Once a Service request is obtained, |callback| is invoked with it. This call |
| 18 // blocks until |callback| returns. |
| 19 // |
| 20 // NOTE: A typical service should also link against the main() defined in |
| 21 // main.cc (next to this header) and thus have no need to call this function |
| 22 // directly. |
| 23 void RunStandaloneService(const StandaloneServiceCallback& callback); |
| 24 |
| 25 } // namespace service_manager |
| OLD | NEW |