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

Side by Side Diff: base/process/launch.h

Issue 98603007: Launches a privileged utility process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removes unnecessary casts, extra tests and cleans up launch.cc Created 6 years, 10 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // This file contains functions for launching subprocesses. 5 // This file contains functions for launching subprocesses.
6 6
7 #ifndef BASE_PROCESS_LAUNCH_H_ 7 #ifndef BASE_PROCESS_LAUNCH_H_
8 #define BASE_PROCESS_LAUNCH_H_ 8 #define BASE_PROCESS_LAUNCH_H_
9 9
10 #include <set> 10 #include <set>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // 141 //
142 // The first command line argument should be the path to the process, 142 // The first command line argument should be the path to the process,
143 // and don't forget to quote it. 143 // and don't forget to quote it.
144 // 144 //
145 // Example (including literal quotes) 145 // Example (including literal quotes)
146 // cmdline = "c:\windows\explorer.exe" -foo "c:\bar\" 146 // cmdline = "c:\windows\explorer.exe" -foo "c:\bar\"
147 BASE_EXPORT bool LaunchProcess(const string16& cmdline, 147 BASE_EXPORT bool LaunchProcess(const string16& cmdline,
148 const LaunchOptions& options, 148 const LaunchOptions& options,
149 ProcessHandle* process_handle); 149 ProcessHandle* process_handle);
150 150
151 // Launches a process with elevated privileges. This does not behave exactly
152 // like LaunchProcess as it uses ShellExecuteEx instead of CreateProcess to
153 // create the process. This means the process will have elevated privileges
154 // and thus some common operations like OpenProcess will fail. The process will
155 // be available through the |process_handle| argument. Currently the only
156 // option that is supported from LaunchOptions are |start_hidden| and |wait|.
157 BASE_EXPORT bool LaunchElevatedProcess(const CommandLine& cmdline,
158 const LaunchOptions& options,
159 ProcessHandle* process_handle);
160
151 #elif defined(OS_POSIX) 161 #elif defined(OS_POSIX)
152 // A POSIX-specific version of LaunchProcess that takes an argv array 162 // A POSIX-specific version of LaunchProcess that takes an argv array
153 // instead of a CommandLine. Useful for situations where you need to 163 // instead of a CommandLine. Useful for situations where you need to
154 // control the command line arguments directly, but prefer the 164 // control the command line arguments directly, but prefer the
155 // CommandLine version if launching Chrome itself. 165 // CommandLine version if launching Chrome itself.
156 BASE_EXPORT bool LaunchProcess(const std::vector<std::string>& argv, 166 BASE_EXPORT bool LaunchProcess(const std::vector<std::string>& argv,
157 const LaunchOptions& options, 167 const LaunchOptions& options,
158 ProcessHandle* process_handle); 168 ProcessHandle* process_handle);
159 169
160 // Close all file descriptors, except those which are a destination in the 170 // Close all file descriptors, except those which are a destination in the
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 #if defined(OS_MACOSX) 217 #if defined(OS_MACOSX)
208 // Restore the default exception handler, setting it to Apple Crash Reporter 218 // Restore the default exception handler, setting it to Apple Crash Reporter
209 // (ReportCrash). When forking and execing a new process, the child will 219 // (ReportCrash). When forking and execing a new process, the child will
210 // inherit the parent's exception ports, which may be set to the Breakpad 220 // inherit the parent's exception ports, which may be set to the Breakpad
211 // instance running inside the parent. The parent's Breakpad instance should 221 // instance running inside the parent. The parent's Breakpad instance should
212 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler 222 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler
213 // in the child after forking will restore the standard exception handler. 223 // in the child after forking will restore the standard exception handler.
214 // See http://crbug.com/20371/ for more details. 224 // See http://crbug.com/20371/ for more details.
215 void RestoreDefaultExceptionHandler(); 225 void RestoreDefaultExceptionHandler();
216 #endif // defined(OS_MACOSX) 226 #endif // defined(OS_MACOSX)
217
218 } // namespace base 227 } // namespace base
219 228
220 #endif // BASE_PROCESS_LAUNCH_H_ 229 #endif // BASE_PROCESS_LAUNCH_H_
OLDNEW
« no previous file with comments | « no previous file | base/process/launch_win.cc » ('j') | chrome/utility/chrome_content_utility_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698