| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // Basic configuration/initialization ------------------------------------------ | 32 // Basic configuration/initialization ------------------------------------------ |
| 33 | 33 |
| 34 // |Init()| sets up the basic Mojo system environment, making the |Mojo...()| | 34 // |Init()| sets up the basic Mojo system environment, making the |Mojo...()| |
| 35 // functions available and functional. This is never shut down (except in tests | 35 // functions available and functional. This is never shut down (except in tests |
| 36 // -- see test_embedder.h). | 36 // -- see test_embedder.h). |
| 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. The | 41 // Called in the parent process for each child process that is launched. |
| 42 // returned handle must be sent to the child process which then calls | |
| 43 // SetParentPipeHandle. | |
| 44 MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle ChildProcessLaunched( | |
| 45 base::ProcessHandle child_process); | |
| 46 // Like above, except used when the embedder establishes the pipe between the | |
| 47 // parent and child processes itself. | |
| 48 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched( | 42 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched( |
| 49 base::ProcessHandle child_process, ScopedPlatformHandle server_pipe); | 43 base::ProcessHandle child_process, ScopedPlatformHandle server_pipe); |
| 50 | 44 |
| 51 // Should be called as early as possible in the child process with the handle | 45 // Should be called as early as possible in the child process with the handle |
| 52 // that the parent received from ChildProcessLaunched. | 46 // that the parent received from ChildProcessLaunched. |
| 53 MOJO_SYSTEM_IMPL_EXPORT void SetParentPipeHandle(ScopedPlatformHandle pipe); | 47 MOJO_SYSTEM_IMPL_EXPORT void SetParentPipeHandle(ScopedPlatformHandle pipe); |
| 54 | 48 |
| 55 // Same as above but extracts the pipe handle from the command line. See | 49 // Same as above but extracts the pipe handle from the command line. See |
| 56 // PlatformChannelPair for details. | 50 // PlatformChannelPair for details. |
| 57 MOJO_SYSTEM_IMPL_EXPORT void SetParentPipeHandleFromCommandLine(); | 51 MOJO_SYSTEM_IMPL_EXPORT void SetParentPipeHandleFromCommandLine(); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 162 |
| 169 // Generates a random ASCII token string for use with CreateParentMessagePipe() | 163 // Generates a random ASCII token string for use with CreateParentMessagePipe() |
| 170 // and CreateChildMessagePipe() above. The generated token is suitably random so | 164 // and CreateChildMessagePipe() above. The generated token is suitably random so |
| 171 // as to not have to worry about collisions with other generated tokens. | 165 // as to not have to worry about collisions with other generated tokens. |
| 172 MOJO_SYSTEM_IMPL_EXPORT std::string GenerateRandomToken(); | 166 MOJO_SYSTEM_IMPL_EXPORT std::string GenerateRandomToken(); |
| 173 | 167 |
| 174 } // namespace edk | 168 } // namespace edk |
| 175 } // namespace mojo | 169 } // namespace mojo |
| 176 | 170 |
| 177 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ | 171 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
| OLD | NEW |