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

Side by Side Diff: mojo/edk/system/core.h

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: Created 3 years, 9 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 | « mojo/edk/system/channel_posix.cc ('k') | mojo/edk/system/core.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // Retrieves the NodeController for the current process. 50 // Retrieves the NodeController for the current process.
51 NodeController* GetNodeController(); 51 NodeController* GetNodeController();
52 52
53 scoped_refptr<Dispatcher> GetDispatcher(MojoHandle handle); 53 scoped_refptr<Dispatcher> GetDispatcher(MojoHandle handle);
54 54
55 void SetDefaultProcessErrorCallback(const ProcessErrorCallback& callback); 55 void SetDefaultProcessErrorCallback(const ProcessErrorCallback& callback);
56 56
57 // Called in the parent process any time a new child is launched. 57 // Called in the parent process any time a new child is launched.
58 void AddChild(base::ProcessHandle process_handle, 58 void AddChild(base::ProcessHandle process_handle,
59 ScopedPlatformHandle platform_handle, 59 ConnectionParam connection_param,
60 const std::string& child_token, 60 const std::string& child_token,
61 const ProcessErrorCallback& process_error_callback); 61 const ProcessErrorCallback& process_error_callback);
62 62
63 // Called in the parent process when a child process fails to launch. 63 // Called in the parent process when a child process fails to launch.
64 void ChildLaunchFailed(const std::string& child_token); 64 void ChildLaunchFailed(const std::string& child_token);
65 65
66 // Called to connect to a peer process. This should be called only if there 66 // Called to connect to a peer process. This should be called only if there
67 // is no common ancestor for the processes involved within this mojo system. 67 // is no common ancestor for the processes involved within this mojo system.
68 // Both processes must call this function, each passing one end of a platform 68 // Both processes must call this function, each passing one end of a platform
69 // channel. This returns one end of a message pipe to each process. 69 // channel. This returns one end of a message pipe to each process.
70 ScopedMessagePipeHandle ConnectToPeerProcess(ScopedPlatformHandle pipe_handle, 70 ScopedMessagePipeHandle ConnectToPeerProcess(ScopedPlatformHandle pipe_handle,
71 const std::string& peer_token); 71 const std::string& peer_token);
72 void ClosePeerConnection(const std::string& peer_token); 72 void ClosePeerConnection(const std::string& peer_token);
73 73
74 // Called in a child process exactly once during early initialization. 74 // Called in a child process exactly once during early initialization.
75 void InitChild(ScopedPlatformHandle platform_handle); 75 void InitChild(ConnectionParam connection_param);
76 76
77 // Creates a message pipe endpoint associated with |token|, which a child 77 // Creates a message pipe endpoint associated with |token|, which a child
78 // holding the token can later locate and connect to. 78 // holding the token can later locate and connect to.
79 ScopedMessagePipeHandle CreateParentMessagePipe( 79 ScopedMessagePipeHandle CreateParentMessagePipe(
80 const std::string& token, const std::string& child_token); 80 const std::string& token, const std::string& child_token);
81 81
82 // Creates a message pipe endpoint and connects it to a pipe the parent has 82 // Creates a message pipe endpoint and connects it to a pipe the parent has
83 // associated with |token|. 83 // associated with |token|.
84 ScopedMessagePipeHandle CreateChildMessagePipe(const std::string& token); 84 ScopedMessagePipeHandle CreateChildMessagePipe(const std::string& token);
85 85
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // Properties that can be read using the MojoGetProperty() API. 309 // Properties that can be read using the MojoGetProperty() API.
310 bool property_sync_call_allowed_ = true; 310 bool property_sync_call_allowed_ = true;
311 311
312 DISALLOW_COPY_AND_ASSIGN(Core); 312 DISALLOW_COPY_AND_ASSIGN(Core);
313 }; 313 };
314 314
315 } // namespace edk 315 } // namespace edk
316 } // namespace mojo 316 } // namespace mojo
317 317
318 #endif // MOJO_EDK_SYSTEM_CORE_H_ 318 #endif // MOJO_EDK_SYSTEM_CORE_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/channel_posix.cc ('k') | mojo/edk/system/core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698