OLD | NEW |
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 CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ | 5 #ifndef CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ |
6 #define CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ | 6 #define CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
27 // Helper class to establish a connection between the Service Manager and a | 27 // Helper class to establish a connection between the Service Manager and a |
28 // single child process. Process hosts can use this when launching new processes | 28 // single child process. Process hosts can use this when launching new processes |
29 // which should be registered with the service manager. | 29 // which should be registered with the service manager. |
30 class CONTENT_EXPORT ChildConnection { | 30 class CONTENT_EXPORT ChildConnection { |
31 public: | 31 public: |
32 // Prepares a new child connection for a child process which will be | 32 // Prepares a new child connection for a child process which will be |
33 // identified to the service manager as |name|. |instance_id| must be unique | 33 // identified to the service manager as |child_identity|. |child_identity|'s |
34 // among all child connections using the same |name|. |connector| is the | 34 // instance field must be unique among all child connections using the same |
35 // connector to use to establish the connection. | 35 // service name. |connector| is the connector to use to establish the |
36 ChildConnection(const std::string& name, | 36 // connection. |
37 const std::string& instance_id, | 37 ChildConnection(const service_manager::Identity& child_identity, |
38 mojo::edk::PendingProcessConnection* process_connection, | 38 mojo::edk::PendingProcessConnection* process_connection, |
39 service_manager::Connector* connector, | 39 service_manager::Connector* connector, |
40 scoped_refptr<base::SequencedTaskRunner> io_task_runner); | 40 scoped_refptr<base::SequencedTaskRunner> io_task_runner); |
41 ~ChildConnection(); | 41 ~ChildConnection(); |
42 | 42 |
43 // Binds an implementation of |interface_name| to |interface_pipe| in the | 43 // Binds an implementation of |interface_name| to |interface_pipe| in the |
44 // child. | 44 // child. |
45 void BindInterface(const std::string& interface_name, | 45 void BindInterface(const std::string& interface_name, |
46 mojo::ScopedMessagePipeHandle interface_pipe); | 46 mojo::ScopedMessagePipeHandle interface_pipe); |
47 | 47 |
(...skipping 20 matching lines...) Expand all Loading... |
68 base::ProcessHandle process_handle_ = base::kNullProcessHandle; | 68 base::ProcessHandle process_handle_ = base::kNullProcessHandle; |
69 | 69 |
70 base::WeakPtrFactory<ChildConnection> weak_factory_; | 70 base::WeakPtrFactory<ChildConnection> weak_factory_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(ChildConnection); | 72 DISALLOW_COPY_AND_ASSIGN(ChildConnection); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace content | 75 } // namespace content |
76 | 76 |
77 #endif // CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ | 77 #endif // CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ |
OLD | NEW |