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

Side by Side Diff: services/service_manager/runner/common/client_util.h

Issue 2680973006: Mojo EDK: Add safe process connection API (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
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 #ifndef SERVICES_SERVICE_MANAGER_RUNNER_COMMON_CLIENT_UTIL_H_ 5 #ifndef SERVICES_SERVICE_MANAGER_RUNNER_COMMON_CLIENT_UTIL_H_
6 #define SERVICES_SERVICE_MANAGER_RUNNER_COMMON_CLIENT_UTIL_H_ 6 #define SERVICES_SERVICE_MANAGER_RUNNER_COMMON_CLIENT_UTIL_H_
7 7
8 #include <string>
9
10 #include "services/service_manager/public/interfaces/service.mojom.h" 8 #include "services/service_manager/public/interfaces/service.mojom.h"
11 9
12 namespace base { 10 namespace base {
13 class CommandLine; 11 class CommandLine;
14 } 12 }
15 13
14 namespace mojo {
15 namespace edk {
16 class PendingProcessConnection;
17 }
18 }
19
16 namespace service_manager { 20 namespace service_manager {
17 21
18 // Creates a new Service pipe and returns one end of it. The other end is 22 // Creates a new Service pipe for connection to a not-yet-launched child process
19 // passed via a token in |command_line|. A child of the calling process may 23 // and returns one end of it. The other end is passed via a token in
20 // extract a ServiceRequest from this by calling 24 // |command_line|. The launched process may extract the corresponding
21 // GetServiceRequestFromCommandLine(). 25 // ServiceRequest by calling GetServiceRequestFromCommandLine().
22 mojom::ServicePtr PassServiceRequestOnCommandLine( 26 mojom::ServicePtr PassServiceRequestOnCommandLine(
23 base::CommandLine* command_line, const std::string& child_token); 27 mojo::edk::PendingProcessConnection* connection,
28 base::CommandLine* command_line);
24 29
25 // Extracts a ServiceRequest from the command line of the current process. 30 // Extracts a ServiceRequest from the command line of the current process.
26 // The parent of this process should have passed a request using 31 // The parent of this process should have passed a request using
27 // PassServiceRequestOnCommandLine(). 32 // PassServiceRequestOnCommandLine().
28 mojom::ServiceRequest GetServiceRequestFromCommandLine(); 33 mojom::ServiceRequest GetServiceRequestFromCommandLine();
29 34
30 // Returns true if the ServiceRequest came via the command line from a service 35 // Returns true if the ServiceRequest came via the command line from a service
31 // manager 36 // manager
32 // instance in another process. 37 // instance in another process.
33 bool ServiceManagerIsRemote(); 38 bool ServiceManagerIsRemote();
34 39
35 } // namespace service_manager 40 } // namespace service_manager
36 41
37 #endif // SERVICES_SERVICE_MANAGER_RUNNER_COMMON_CLIENT_UTIL_H_ 42 #endif // SERVICES_SERVICE_MANAGER_RUNNER_COMMON_CLIENT_UTIL_H_
OLDNEW
« no previous file with comments | « services/service_manager/runner/common/BUILD.gn ('k') | services/service_manager/runner/common/client_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698