Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1476)

Side by Side Diff: mojo/edk/embedder/embedder.h

Issue 2043713004: Mojo: Add NotifyBadMessage API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | mojo/edk/embedder/embedder.cc » ('j') | mojo/edk/system/node_controller.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/embedder/embedder.cc » ('j') | mojo/edk/system/node_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698