| OLD | NEW |
| 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 COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ | 5 #ifndef COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ |
| 6 #define COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ | 6 #define COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "content/public/common/zygote_fork_delegate_linux.h" | 15 #include "content/public/common/zygote_fork_delegate_linux.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 struct LaunchOptions; | 18 struct LaunchOptions; |
| 18 } | 19 } |
| 19 | 20 |
| 20 template <typename> | |
| 21 class ScopedVector; | |
| 22 | |
| 23 namespace nacl { | 21 namespace nacl { |
| 24 | 22 |
| 25 // Appends any ZygoteForkDelegate instances needed by NaCl to |*delegates|. | 23 // Appends any ZygoteForkDelegate instances needed by NaCl to |*delegates|. |
| 26 void AddNaClZygoteForkDelegates( | 24 void AddNaClZygoteForkDelegates( |
| 27 ScopedVector<content::ZygoteForkDelegate>* delegates); | 25 std::vector<std::unique_ptr<content::ZygoteForkDelegate>>* delegates); |
| 28 | 26 |
| 29 // The NaClForkDelegate is created during Chrome linux zygote | 27 // The NaClForkDelegate is created during Chrome linux zygote |
| 30 // initialization, and provides "fork()" functionality with | 28 // initialization, and provides "fork()" functionality with |
| 31 // NaCl specific process characteristics (specifically address | 29 // NaCl specific process characteristics (specifically address |
| 32 // space layout) as an alternative to forking the zygote. | 30 // space layout) as an alternative to forking the zygote. |
| 33 // A new delegate is passed in as an argument to ZygoteMain(). | 31 // A new delegate is passed in as an argument to ZygoteMain(). |
| 34 class NaClForkDelegate : public content::ZygoteForkDelegate { | 32 class NaClForkDelegate : public content::ZygoteForkDelegate { |
| 35 public: | 33 public: |
| 36 explicit NaClForkDelegate(bool nonsfi_mode); | 34 explicit NaClForkDelegate(bool nonsfi_mode); |
| 37 ~NaClForkDelegate() override; | 35 ~NaClForkDelegate() override; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 int fd_; | 71 int fd_; |
| 74 | 72 |
| 75 FRIEND_TEST_ALL_PREFIXES(NaClForkDelegateLinuxTest, EnvPassthrough); | 73 FRIEND_TEST_ALL_PREFIXES(NaClForkDelegateLinuxTest, EnvPassthrough); |
| 76 | 74 |
| 77 DISALLOW_COPY_AND_ASSIGN(NaClForkDelegate); | 75 DISALLOW_COPY_AND_ASSIGN(NaClForkDelegate); |
| 78 }; | 76 }; |
| 79 | 77 |
| 80 } // namespace nacl | 78 } // namespace nacl |
| 81 | 79 |
| 82 #endif // COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ | 80 #endif // COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ |
| OLD | NEW |