launch.cc 807 B

123456789101112131415161718192021222324252627
  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
  3. // found in the LICENSE file.
  4. #include "base/process/launch.h"
  5. #include "build/build_config.h"
  6. namespace base {
  7. LaunchOptions::LaunchOptions() = default;
  8. LaunchOptions::LaunchOptions(const LaunchOptions& other) = default;
  9. LaunchOptions::~LaunchOptions() = default;
  10. LaunchOptions LaunchOptionsForTest() {
  11. LaunchOptions options;
  12. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
  13. // To prevent accidental privilege sharing to an untrusted child, processes
  14. // are started with PR_SET_NO_NEW_PRIVS. Do not set that here, since this
  15. // new child will be used for testing only.
  16. options.allow_new_privs = true;
  17. #endif
  18. return options;
  19. }
  20. } // namespace base