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

Side by Side Diff: content/browser/child_process_launcher.h

Issue 2019973002: [mojo-edk] Bind a child token to child launches and port reservations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_
6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ 6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_
7 7
8 #include "base/files/scoped_file.h" 8 #include "base/files/scoped_file.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Launches the process asynchronously, calling the client when the result is 67 // Launches the process asynchronously, calling the client when the result is
68 // ready. Deleting this object before the process is created is safe, since 68 // ready. Deleting this object before the process is created is safe, since
69 // the callback won't be called. If the process is still running by the time 69 // the callback won't be called. If the process is still running by the time
70 // this object destructs, it will be terminated. 70 // this object destructs, it will be terminated.
71 // Takes ownership of cmd_line. 71 // Takes ownership of cmd_line.
72 ChildProcessLauncher( 72 ChildProcessLauncher(
73 SandboxedProcessLauncherDelegate* delegate, 73 SandboxedProcessLauncherDelegate* delegate,
74 base::CommandLine* cmd_line, 74 base::CommandLine* cmd_line,
75 int child_process_id, 75 int child_process_id,
76 Client* client, 76 Client* client,
77 const std::string& mojo_child_token,
77 bool terminate_on_shutdown = true); 78 bool terminate_on_shutdown = true);
78 ~ChildProcessLauncher(); 79 ~ChildProcessLauncher();
79 80
80 // True if the process is being launched and so the handle isn't available. 81 // True if the process is being launched and so the handle isn't available.
81 bool IsStarting(); 82 bool IsStarting();
82 83
83 // Getter for the process. Only call after the process has started. 84 // Getter for the process. Only call after the process has started.
84 const base::Process& GetProcess() const; 85 const base::Process& GetProcess() const;
85 86
86 // Call this when the child process exits to know what happened to it. 87 // Call this when the child process exits to know what happened to it.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 base::TerminationStatus termination_status_; 151 base::TerminationStatus termination_status_;
151 int exit_code_; 152 int exit_code_;
152 ZygoteHandle zygote_; 153 ZygoteHandle zygote_;
153 bool starting_; 154 bool starting_;
154 // Controls whether the child process should be terminated on browser 155 // Controls whether the child process should be terminated on browser
155 // shutdown. Default behavior is to terminate the child. 156 // shutdown. Default behavior is to terminate the child.
156 const bool terminate_child_on_shutdown_; 157 const bool terminate_child_on_shutdown_;
157 158
158 // Host side platform handle to establish Mojo IPC. 159 // Host side platform handle to establish Mojo IPC.
159 mojo::edk::ScopedPlatformHandle mojo_host_platform_handle_; 160 mojo::edk::ScopedPlatformHandle mojo_host_platform_handle_;
161 const std::string mojo_child_token_;
160 162
161 base::WeakPtrFactory<ChildProcessLauncher> weak_factory_; 163 base::WeakPtrFactory<ChildProcessLauncher> weak_factory_;
162 164
163 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); 165 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher);
164 }; 166 };
165 167
166 } // namespace content 168 } // namespace content
167 169
168 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ 170 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_
OLDNEW
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698