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

Side by Side Diff: components/nacl/zygote/nacl_fork_delegate_linux.h

Issue 684513002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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) 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
(...skipping 16 matching lines...) Expand all
27 ScopedVector<content::ZygoteForkDelegate>* delegates); 27 ScopedVector<content::ZygoteForkDelegate>* delegates);
28 28
29 // The NaClForkDelegate is created during Chrome linux zygote 29 // The NaClForkDelegate is created during Chrome linux zygote
30 // initialization, and provides "fork()" functionality with 30 // initialization, and provides "fork()" functionality with
31 // NaCl specific process characteristics (specifically address 31 // NaCl specific process characteristics (specifically address
32 // space layout) as an alternative to forking the zygote. 32 // space layout) as an alternative to forking the zygote.
33 // A new delegate is passed in as an argument to ZygoteMain(). 33 // A new delegate is passed in as an argument to ZygoteMain().
34 class NaClForkDelegate : public content::ZygoteForkDelegate { 34 class NaClForkDelegate : public content::ZygoteForkDelegate {
35 public: 35 public:
36 explicit NaClForkDelegate(bool nonsfi_mode); 36 explicit NaClForkDelegate(bool nonsfi_mode);
37 virtual ~NaClForkDelegate(); 37 ~NaClForkDelegate() override;
38 38
39 virtual void Init(int sandboxdesc, bool enable_layer1_sandbox) override; 39 void Init(int sandboxdesc, bool enable_layer1_sandbox) override;
40 virtual void InitialUMA(std::string* uma_name, 40 void InitialUMA(std::string* uma_name,
41 int* uma_sample, 41 int* uma_sample,
42 int* uma_boundary_value) override; 42 int* uma_boundary_value) override;
43 virtual bool CanHelp(const std::string& process_type, std::string* uma_name, 43 bool CanHelp(const std::string& process_type,
44 int* uma_sample, int* uma_boundary_value) override; 44 std::string* uma_name,
45 virtual pid_t Fork(const std::string& process_type, 45 int* uma_sample,
46 const std::vector<int>& fds, 46 int* uma_boundary_value) override;
47 const std::string& channel_id) override; 47 pid_t Fork(const std::string& process_type,
48 virtual bool GetTerminationStatus(pid_t pid, bool known_dead, 48 const std::vector<int>& fds,
49 base::TerminationStatus* status, 49 const std::string& channel_id) override;
50 int* exit_code) override; 50 bool GetTerminationStatus(pid_t pid,
51 bool known_dead,
52 base::TerminationStatus* status,
53 int* exit_code) override;
51 54
52 private: 55 private:
53 static void AddPassthroughEnvToOptions(base::LaunchOptions* options); 56 static void AddPassthroughEnvToOptions(base::LaunchOptions* options);
54 57
55 // These values are reported via UMA and hence they become permanent 58 // These values are reported via UMA and hence they become permanent
56 // constants. Old values cannot be reused, only new ones added. 59 // constants. Old values cannot be reused, only new ones added.
57 enum NaClHelperStatus { 60 enum NaClHelperStatus {
58 kNaClHelperUnused = 0, 61 kNaClHelperUnused = 0,
59 kNaClHelperMissing = 1, 62 kNaClHelperMissing = 1,
60 kNaClHelperBootstrapMissing = 2, 63 kNaClHelperBootstrapMissing = 2,
61 kNaClHelperValgrind = 3, 64 kNaClHelperValgrind = 3,
62 kNaClHelperLaunchFailed = 4, 65 kNaClHelperLaunchFailed = 4,
63 kNaClHelperAckFailed = 5, 66 kNaClHelperAckFailed = 5,
64 kNaClHelperSuccess = 6, 67 kNaClHelperSuccess = 6,
65 kNaClHelperStatusBoundary // Must be one greater than highest value used. 68 kNaClHelperStatusBoundary // Must be one greater than highest value used.
66 }; 69 };
67 70
68 const bool nonsfi_mode_; 71 const bool nonsfi_mode_;
69 NaClHelperStatus status_; 72 NaClHelperStatus status_;
70 int fd_; 73 int fd_;
71 74
72 FRIEND_TEST_ALL_PREFIXES(NaClForkDelegateLinuxTest, EnvPassthrough); 75 FRIEND_TEST_ALL_PREFIXES(NaClForkDelegateLinuxTest, EnvPassthrough);
73 76
74 DISALLOW_COPY_AND_ASSIGN(NaClForkDelegate); 77 DISALLOW_COPY_AND_ASSIGN(NaClForkDelegate);
75 }; 78 };
76 79
77 } // namespace nacl 80 } // namespace nacl
78 81
79 #endif // COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_ 82 #endif // COMPONENTS_NACL_ZYGOTE_NACL_FORK_DELEGATE_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698