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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Retrieves the NodeController for the current process. | 44 // Retrieves the NodeController for the current process. |
45 NodeController* GetNodeController(); | 45 NodeController* GetNodeController(); |
46 | 46 |
47 scoped_refptr<Dispatcher> GetDispatcher(MojoHandle handle); | 47 scoped_refptr<Dispatcher> GetDispatcher(MojoHandle handle); |
48 | 48 |
49 // Called in the parent process any time a new child is launched. | 49 // Called in the parent process any time a new child is launched. |
50 void AddChild(base::ProcessHandle process_handle, | 50 void AddChild(base::ProcessHandle process_handle, |
51 ScopedPlatformHandle platform_handle); | 51 ScopedPlatformHandle platform_handle); |
52 | 52 |
53 // Called in a child process exactly once during early initialization. | 53 // Called in the parent process any time a new child is launched. |secret| |
| 54 // must be received from the child process before normal handshake can begin. |
| 55 // |
| 56 // NOTE: This should be used only on Windows. |
| 57 void AddChild(base::ProcessHandle process_handle, |
| 58 ScopedPlatformHandle platform_handle, |
| 59 const std::string& secret); |
| 60 |
| 61 // Called in a child process exactly once during early initialization to |
| 62 // establish a connection to the parent process. |
54 void InitChild(ScopedPlatformHandle platform_handle); | 63 void InitChild(ScopedPlatformHandle platform_handle); |
55 | 64 |
| 65 // Called in a child process exactly once during early initialization to |
| 66 // establish a connection to the parent process. |secret| is transmitted |
| 67 // before beginning normal handshake. |
| 68 // |
| 69 // NOTE: This should be used only on Windows. |
| 70 void InitChild(ScopedPlatformHandle platform_handle, |
| 71 const std::string& secret); |
| 72 |
56 // Creates a message pipe endpoint connected to an endpoint in a remote | 73 // Creates a message pipe endpoint connected to an endpoint in a remote |
57 // embedder. |platform_handle| is used as a channel to negotiate the | 74 // embedder. |platform_handle| is used as a channel to negotiate the |
58 // connection. | 75 // connection. |
59 ScopedMessagePipeHandle CreateMessagePipe( | 76 ScopedMessagePipeHandle CreateMessagePipe( |
60 ScopedPlatformHandle platform_handle); | 77 ScopedPlatformHandle platform_handle); |
61 | 78 |
62 // Creates a message pipe endpoint associated with |token|, which a child | 79 // Creates a message pipe endpoint associated with |token|, which a child |
63 // holding the token can later locate and connect to. | 80 // holding the token can later locate and connect to. |
64 ScopedMessagePipeHandle CreateParentMessagePipe(const std::string& token); | 81 ScopedMessagePipeHandle CreateParentMessagePipe(const std::string& token); |
65 | 82 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 base::Lock mapping_table_lock_; // Protects |mapping_table_|. | 246 base::Lock mapping_table_lock_; // Protects |mapping_table_|. |
230 MappingTable mapping_table_; | 247 MappingTable mapping_table_; |
231 | 248 |
232 DISALLOW_COPY_AND_ASSIGN(Core); | 249 DISALLOW_COPY_AND_ASSIGN(Core); |
233 }; | 250 }; |
234 | 251 |
235 } // namespace edk | 252 } // namespace edk |
236 } // namespace mojo | 253 } // namespace mojo |
237 | 254 |
238 #endif // MOJO_EDK_SYSTEM_CORE_H_ | 255 #endif // MOJO_EDK_SYSTEM_CORE_H_ |
OLD | NEW |