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 CONTENT_BROWSER_ZYGOTE_HOST_IMPL_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_IMPL_LINUX_H_ |
6 #define CONTENT_BROWSER_ZYGOTE_HOST_IMPL_LINUX_H_ | 6 #define CONTENT_BROWSER_ZYGOTE_HOST_IMPL_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/global_descriptors_posix.h" | 12 #include "base/global_descriptors_posix.h" |
13 #include "base/process_util.h" | 13 #include "base/process_util.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "content/public/browser/zygote_host_linux.h" | 15 #include "content/public/browser/zygote_host_linux.h" |
16 | 16 |
17 template<typename Type> | 17 template<typename Type> |
18 struct DefaultSingletonTraits; | 18 struct DefaultSingletonTraits; |
19 | 19 |
20 static const char kZygoteMagic[] = "ZYGOTE_OK"; | |
21 | |
22 class CONTENT_EXPORT ZygoteHostImpl : public content::ZygoteHost { | 20 class CONTENT_EXPORT ZygoteHostImpl : public content::ZygoteHost { |
23 public: | 21 public: |
24 // Returns the singleton instance. | 22 // Returns the singleton instance. |
25 static ZygoteHostImpl* GetInstance(); | 23 static ZygoteHostImpl* GetInstance(); |
26 | 24 |
27 void Init(const std::string& sandbox_cmd); | 25 void Init(const std::string& sandbox_cmd); |
28 | 26 |
29 // Tries to start a process of type indicated by process_type. | 27 // Tries to start a process of type indicated by process_type. |
30 // Returns its pid on success, otherwise | 28 // Returns its pid on success, otherwise |
31 // base::kNullProcessHandle; | 29 // base::kNullProcessHandle; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 base::Lock control_lock_; | 69 base::Lock control_lock_; |
72 pid_t pid_; | 70 pid_t pid_; |
73 bool init_; | 71 bool init_; |
74 bool using_suid_sandbox_; | 72 bool using_suid_sandbox_; |
75 std::string sandbox_binary_; | 73 std::string sandbox_binary_; |
76 bool have_read_sandbox_status_word_; | 74 bool have_read_sandbox_status_word_; |
77 int sandbox_status_; | 75 int sandbox_status_; |
78 }; | 76 }; |
79 | 77 |
80 #endif // CONTENT_BROWSER_ZYGOTE_HOST_IMPL_LINUX_H_ | 78 #endif // CONTENT_BROWSER_ZYGOTE_HOST_IMPL_LINUX_H_ |
OLD | NEW |