OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MOJO_EDK_SYSTEM_CORE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CORE_H_ |
6 #define MOJO_EDK_SYSTEM_CORE_H_ | 6 #define MOJO_EDK_SYSTEM_CORE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // methods are called on this object. | 46 // methods are called on this object. |
47 void SetIOTaskRunner(scoped_refptr<base::TaskRunner> io_task_runner); | 47 void SetIOTaskRunner(scoped_refptr<base::TaskRunner> io_task_runner); |
48 | 48 |
49 // Retrieves the NodeController for the current process. | 49 // Retrieves the NodeController for the current process. |
50 NodeController* GetNodeController(); | 50 NodeController* GetNodeController(); |
51 | 51 |
52 scoped_refptr<Dispatcher> GetDispatcher(MojoHandle handle); | 52 scoped_refptr<Dispatcher> GetDispatcher(MojoHandle handle); |
53 | 53 |
54 // Called in the parent process any time a new child is launched. | 54 // Called in the parent process any time a new child is launched. |
55 void AddChild(base::ProcessHandle process_handle, | 55 void AddChild(base::ProcessHandle process_handle, |
56 ScopedPlatformHandle platform_handle); | 56 ScopedPlatformHandle platform_handle, |
| 57 const std::string& child_token); |
| 58 |
| 59 // Called in the parent process when a child process fails to launch. |
| 60 void ChildLaunchFailed(const std::string& child_token); |
57 | 61 |
58 // Called in a child process exactly once during early initialization. | 62 // Called in a child process exactly once during early initialization. |
59 void InitChild(ScopedPlatformHandle platform_handle); | 63 void InitChild(ScopedPlatformHandle platform_handle); |
60 | 64 |
61 // Creates a message pipe endpoint connected to an endpoint in a remote | 65 // Creates a message pipe endpoint connected to an endpoint in a remote |
62 // embedder. |platform_handle| is used as a channel to negotiate the | 66 // embedder. |platform_handle| is used as a channel to negotiate the |
63 // connection. | 67 // connection. |
64 ScopedMessagePipeHandle CreateMessagePipe( | 68 ScopedMessagePipeHandle CreateMessagePipe( |
65 ScopedPlatformHandle platform_handle); | 69 ScopedPlatformHandle platform_handle); |
66 | 70 |
67 // Creates a message pipe endpoint associated with |token|, which a child | 71 // Creates a message pipe endpoint associated with |token|, which a child |
68 // holding the token can later locate and connect to. | 72 // holding the token can later locate and connect to. |
69 ScopedMessagePipeHandle CreateParentMessagePipe(const std::string& token); | 73 ScopedMessagePipeHandle CreateParentMessagePipe( |
| 74 const std::string& token, const std::string& child_token); |
70 | 75 |
71 // Creates a message pipe endpoint and connects it to a pipe the parent has | 76 // Creates a message pipe endpoint and connects it to a pipe the parent has |
72 // associated with |token|. | 77 // associated with |token|. |
73 ScopedMessagePipeHandle CreateChildMessagePipe(const std::string& token); | 78 ScopedMessagePipeHandle CreateChildMessagePipe(const std::string& token); |
74 | 79 |
75 // Sets the mach port provider for this process. | 80 // Sets the mach port provider for this process. |
76 void SetMachPortProvider(base::PortProvider* port_provider); | 81 void SetMachPortProvider(base::PortProvider* port_provider); |
77 | 82 |
78 MojoHandle AddDispatcher(scoped_refptr<Dispatcher> dispatcher); | 83 MojoHandle AddDispatcher(scoped_refptr<Dispatcher> dispatcher); |
79 | 84 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 base::Lock mapping_table_lock_; // Protects |mapping_table_|. | 297 base::Lock mapping_table_lock_; // Protects |mapping_table_|. |
293 MappingTable mapping_table_; | 298 MappingTable mapping_table_; |
294 | 299 |
295 DISALLOW_COPY_AND_ASSIGN(Core); | 300 DISALLOW_COPY_AND_ASSIGN(Core); |
296 }; | 301 }; |
297 | 302 |
298 } // namespace edk | 303 } // namespace edk |
299 } // namespace mojo | 304 } // namespace mojo |
300 | 305 |
301 #endif // MOJO_EDK_SYSTEM_CORE_H_ | 306 #endif // MOJO_EDK_SYSTEM_CORE_H_ |
OLD | NEW |