| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EMBEDDER_EMBEDDER_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
| 6 #define MOJO_EDK_EMBEDDER_EMBEDDER_H_ | 6 #define MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Allows changing the default max message size. Must be called before Init. | 38 // Allows changing the default max message size. Must be called before Init. |
| 39 MOJO_SYSTEM_IMPL_EXPORT void SetMaxMessageSize(size_t bytes); | 39 MOJO_SYSTEM_IMPL_EXPORT void SetMaxMessageSize(size_t bytes); |
| 40 | 40 |
| 41 // Called in the parent process for each child process that is launched. | 41 // Called in the parent process for each child process that is launched. |
| 42 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched( | 42 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched( |
| 43 base::ProcessHandle child_process, | 43 base::ProcessHandle child_process, |
| 44 ScopedPlatformHandle server_pipe, | 44 ScopedPlatformHandle server_pipe, |
| 45 const std::string& child_token); | 45 const std::string& child_token); |
| 46 | 46 |
| 47 // Called in the parent process for each child process that is launched. |
| 48 // |bad_message_callback| is called if the system is notified of a bad message |
| 49 // from this process via the |MojoNotifyBadMessage()| API. |
| 50 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched( |
| 51 base::ProcessHandle child_process, |
| 52 ScopedPlatformHandle server_pipe, |
| 53 const std::string& child_token, |
| 54 const base::Closure& bad_message_callback); |
| 55 |
| 47 // Called in the parent process when a child process fails to launch. | 56 // Called in the parent process when a child process fails to launch. |
| 48 // Exactly one of ChildProcessLaunched() or ChildProcessLaunchFailed() must be | 57 // Exactly one of ChildProcessLaunched() or ChildProcessLaunchFailed() must be |
| 49 // called per child process launch attempt. | 58 // called per child process launch attempt. |
| 50 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunchFailed( | 59 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunchFailed( |
| 51 const std::string& child_token); | 60 const std::string& child_token); |
| 52 | 61 |
| 53 // Should be called as early as possible in the child process with the handle | 62 // Should be called as early as possible in the child process with the handle |
| 54 // that the parent received from ChildProcessLaunched. | 63 // that the parent received from ChildProcessLaunched. |
| 55 MOJO_SYSTEM_IMPL_EXPORT void SetParentPipeHandle(ScopedPlatformHandle pipe); | 64 MOJO_SYSTEM_IMPL_EXPORT void SetParentPipeHandle(ScopedPlatformHandle pipe); |
| 56 | 65 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 183 |
| 175 // Generates a random ASCII token string for use with CreateParentMessagePipe() | 184 // Generates a random ASCII token string for use with CreateParentMessagePipe() |
| 176 // and CreateChildMessagePipe() above. The generated token is suitably random so | 185 // and CreateChildMessagePipe() above. The generated token is suitably random so |
| 177 // as to not have to worry about collisions with other generated tokens. | 186 // as to not have to worry about collisions with other generated tokens. |
| 178 MOJO_SYSTEM_IMPL_EXPORT std::string GenerateRandomToken(); | 187 MOJO_SYSTEM_IMPL_EXPORT std::string GenerateRandomToken(); |
| 179 | 188 |
| 180 } // namespace edk | 189 } // namespace edk |
| 181 } // namespace mojo | 190 } // namespace mojo |
| 182 | 191 |
| 183 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ | 192 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
| OLD | NEW |