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 <string> | 10 #include <string> |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Basic configuration/initialization ------------------------------------------ | 27 // Basic configuration/initialization ------------------------------------------ |
28 | 28 |
29 // |Init()| sets up the basic Mojo system environment, making the |Mojo...()| | 29 // |Init()| sets up the basic Mojo system environment, making the |Mojo...()| |
30 // functions available and functional. This is never shut down (except in tests | 30 // functions available and functional. This is never shut down (except in tests |
31 // -- see test_embedder.h). | 31 // -- see test_embedder.h). |
32 | 32 |
33 // Allows changing the default max message size. Must be called before Init. | 33 // Allows changing the default max message size. Must be called before Init. |
34 MOJO_SYSTEM_IMPL_EXPORT void SetMaxMessageSize(size_t bytes); | 34 MOJO_SYSTEM_IMPL_EXPORT void SetMaxMessageSize(size_t bytes); |
35 | 35 |
36 // Must be called before Init in the parent (unsandboxed) process. | |
37 MOJO_SYSTEM_IMPL_EXPORT void PreInitializeParentProcess(); | |
38 | |
39 // Must be called before Init in the child (sandboxed) process. | |
40 MOJO_SYSTEM_IMPL_EXPORT void PreInitializeChildProcess(); | |
41 | |
42 // Called in the parent process for each child process that is launched. The | 36 // Called in the parent process for each child process that is launched. The |
43 // returned handle must be sent to the child process which then calls | 37 // returned handle must be sent to the child process which then calls |
44 // SetParentPipeHandle. | 38 // SetParentPipeHandle. |
45 MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle ChildProcessLaunched( | 39 MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle ChildProcessLaunched( |
46 base::ProcessHandle child_process); | 40 base::ProcessHandle child_process); |
47 // Like above, except used when the embedder establishes the pipe between the | 41 // Like above, except used when the embedder establishes the pipe between the |
48 // parent and child processes itself. | 42 // parent and child processes itself. |
49 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched( | 43 MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched( |
50 base::ProcessHandle child_process, ScopedPlatformHandle server_pipe); | 44 base::ProcessHandle child_process, ScopedPlatformHandle server_pipe); |
51 | 45 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 135 |
142 // Generates a random ASCII token string for use with CreateParentMessagePipe() | 136 // Generates a random ASCII token string for use with CreateParentMessagePipe() |
143 // and CreateChildMessagePipe() above. The generated token is suitably random so | 137 // and CreateChildMessagePipe() above. The generated token is suitably random so |
144 // as to not have to worry about collisions with other generated tokens. | 138 // as to not have to worry about collisions with other generated tokens. |
145 MOJO_SYSTEM_IMPL_EXPORT std::string GenerateRandomToken(); | 139 MOJO_SYSTEM_IMPL_EXPORT std::string GenerateRandomToken(); |
146 | 140 |
147 } // namespace edk | 141 } // namespace edk |
148 } // namespace mojo | 142 } // namespace mojo |
149 | 143 |
150 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ | 144 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
OLD | NEW |