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

Side by Side Diff: base/process_util.h

Issue 6995121: New NaCl zygote implementation 2 (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing includes for checkdeps.py Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/process_util_posix.cc » ('j') | chrome/chrome.gyp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/namespace contains utility functions for enumerating, ending and 5 // This file/namespace contains utility functions for enumerating, ending and
6 // computing statistics of processes. 6 // computing statistics of processes.
7 7
8 #ifndef BASE_PROCESS_UTIL_H_ 8 #ifndef BASE_PROCESS_UTIL_H_
9 #define BASE_PROCESS_UTIL_H_ 9 #define BASE_PROCESS_UTIL_H_
10 #pragma once 10 #pragma once
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // Similar to the above two methods, but starts the child process in a process 279 // Similar to the above two methods, but starts the child process in a process
280 // group of its own, instead of allowing it to inherit the parent's process 280 // group of its own, instead of allowing it to inherit the parent's process
281 // group. The pgid of the child process will be the same as its pid. 281 // group. The pgid of the child process will be the same as its pid.
282 BASE_API bool LaunchAppInNewProcessGroup( 282 BASE_API bool LaunchAppInNewProcessGroup(
283 const std::vector<std::string>& argv, 283 const std::vector<std::string>& argv,
284 const environment_vector& environ, 284 const environment_vector& environ,
285 const file_handle_mapping_vector& fds_to_remap, 285 const file_handle_mapping_vector& fds_to_remap,
286 bool wait, 286 bool wait,
287 ProcessHandle* process_handle); 287 ProcessHandle* process_handle);
288 288
289 #if defined(OS_LINUX)
290 // Similar to LaunchApp variants above except uses clone(.. clone_flags ..)
291 // rather than fork(). This is useful for work inside the setuid sandbox.
292 BASE_API bool LaunchAppWithClone(const std::vector<std::string>& argv,
Mark Seaborn 2011/06/15 16:09:04 Please bear in mind Brett Wilson's post from Janua
Brad Chen 2011/06/15 18:47:47 Hmm... I'd have to mimic/copy ~100 lines of code f
Brad Chen 2011/06/20 22:09:47 Today I spent some time trying to use clone/execvp
293 const file_handle_mapping_vector& fds_to_remap,
294 bool wait, ProcessHandle* process_handle,
295 int clone_flags);
296 #endif
297
289 // AlterEnvironment returns a modified environment vector, constructed from the 298 // AlterEnvironment returns a modified environment vector, constructed from the
290 // given environment and the list of changes given in |changes|. Each key in 299 // given environment and the list of changes given in |changes|. Each key in
291 // the environment is matched against the first element of the pairs. In the 300 // the environment is matched against the first element of the pairs. In the
292 // event of a match, the value is replaced by the second of the pair, unless 301 // event of a match, the value is replaced by the second of the pair, unless
293 // the second is empty, in which case the key-value is removed. 302 // the second is empty, in which case the key-value is removed.
294 // 303 //
295 // The returned array is allocated using new[] and must be freed by the caller. 304 // The returned array is allocated using new[] and must be freed by the caller.
296 BASE_API char** AlterEnvironment(const environment_vector& changes, 305 BASE_API char** AlterEnvironment(const environment_vector& changes,
297 const char* const* const env); 306 const char* const* const env);
298 #endif // defined(OS_POSIX) 307 #endif // defined(OS_POSIX)
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 // instance running inside the parent. The parent's Breakpad instance should 684 // instance running inside the parent. The parent's Breakpad instance should
676 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler 685 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler
677 // in the child after forking will restore the standard exception handler. 686 // in the child after forking will restore the standard exception handler.
678 // See http://crbug.com/20371/ for more details. 687 // See http://crbug.com/20371/ for more details.
679 void RestoreDefaultExceptionHandler(); 688 void RestoreDefaultExceptionHandler();
680 #endif // defined(OS_MACOSX) 689 #endif // defined(OS_MACOSX)
681 690
682 } // namespace base 691 } // namespace base
683 692
684 #endif // BASE_PROCESS_UTIL_H_ 693 #endif // BASE_PROCESS_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/process_util_posix.cc » ('j') | chrome/chrome.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698