Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | |
| 13 #include "content/public/common/zygote_fork_delegate_linux.h" | 14 #include "content/public/common/zygote_fork_delegate_linux.h" |
| 14 | 15 |
| 16 FORWARD_DECLARE_TEST(NaClForkDelegateLinuxTest, EnvPassthrough); | |
| 17 | |
| 18 namespace base { | |
| 19 struct LaunchOptions; | |
| 20 } | |
| 21 | |
| 15 template <typename> | 22 template <typename> |
| 16 class ScopedVector; | 23 class ScopedVector; |
| 17 | 24 |
| 18 namespace nacl { | 25 namespace nacl { |
| 19 | 26 |
| 20 // Appends any ZygoteForkDelegate instances needed by NaCl to |*delegates|. | 27 // Appends any ZygoteForkDelegate instances needed by NaCl to |*delegates|. |
| 21 void AddNaClZygoteForkDelegates( | 28 void AddNaClZygoteForkDelegates( |
| 22 ScopedVector<content::ZygoteForkDelegate>* delegates); | 29 ScopedVector<content::ZygoteForkDelegate>* delegates); |
| 23 | 30 |
| 24 // The NaClForkDelegate is created during Chrome linux zygote | 31 // The NaClForkDelegate is created during Chrome linux zygote |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 38 virtual bool CanHelp(const std::string& process_type, std::string* uma_name, | 45 virtual bool CanHelp(const std::string& process_type, std::string* uma_name, |
| 39 int* uma_sample, int* uma_boundary_value) OVERRIDE; | 46 int* uma_sample, int* uma_boundary_value) OVERRIDE; |
| 40 virtual pid_t Fork(const std::string& process_type, | 47 virtual pid_t Fork(const std::string& process_type, |
| 41 const std::vector<int>& fds, | 48 const std::vector<int>& fds, |
| 42 const std::string& channel_id) OVERRIDE; | 49 const std::string& channel_id) OVERRIDE; |
| 43 virtual bool GetTerminationStatus(pid_t pid, bool known_dead, | 50 virtual bool GetTerminationStatus(pid_t pid, bool known_dead, |
| 44 base::TerminationStatus* status, | 51 base::TerminationStatus* status, |
| 45 int* exit_code) OVERRIDE; | 52 int* exit_code) OVERRIDE; |
| 46 | 53 |
| 47 private: | 54 private: |
| 55 static void AddPassthroughEnvToOptions(base::LaunchOptions& options); | |
|
jln (very slow on Chromium)
2014/06/03 22:58:13
Style: this really should be a pointer.
elijahtaylor1
2014/06/03 23:22:10
In fairness, I *really* meant to do it, but didn't
| |
| 56 | |
| 48 // These values are reported via UMA and hence they become permanent | 57 // These values are reported via UMA and hence they become permanent |
| 49 // constants. Old values cannot be reused, only new ones added. | 58 // constants. Old values cannot be reused, only new ones added. |
| 50 enum NaClHelperStatus { | 59 enum NaClHelperStatus { |
| 51 kNaClHelperUnused = 0, | 60 kNaClHelperUnused = 0, |
| 52 kNaClHelperMissing = 1, | 61 kNaClHelperMissing = 1, |
| 53 kNaClHelperBootstrapMissing = 2, | 62 kNaClHelperBootstrapMissing = 2, |
| 54 kNaClHelperValgrind = 3, | 63 kNaClHelperValgrind = 3, |
| 55 kNaClHelperLaunchFailed = 4, | 64 kNaClHelperLaunchFailed = 4, |
| 56 kNaClHelperAckFailed = 5, | 65 kNaClHelperAckFailed = 5, |
| 57 kNaClHelperSuccess = 6, | 66 kNaClHelperSuccess = 6, |
| 58 kNaClHelperStatusBoundary // Must be one greater than highest value used. | 67 kNaClHelperStatusBoundary // Must be one greater than highest value used. |
| 59 }; | 68 }; |
| 60 | 69 |
| 61 const bool nonsfi_mode_; | 70 const bool nonsfi_mode_; |
| 62 NaClHelperStatus status_; | 71 NaClHelperStatus status_; |
| 63 int fd_; | 72 int fd_; |
| 64 | 73 |
| 74 FRIEND_TEST_ALL_PREFIXES(::NaClForkDelegateLinuxTest, EnvPassthrough); | |
| 75 | |
| 65 DISALLOW_COPY_AND_ASSIGN(NaClForkDelegate); | 76 DISALLOW_COPY_AND_ASSIGN(NaClForkDelegate); |
| 66 }; | 77 }; |
| 67 | 78 |
| 68 } // namespace nacl | 79 } // namespace nacl |
| 69 | 80 |
| 70 #endif // COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ | 81 #endif // COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ |
| OLD | NEW |