| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ZYGOTE_COMMUNICATION_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ |
| 6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ | 6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include <sys/types.h> | 13 #include <sys/types.h> |
| 14 | 14 |
| 15 #include "base/files/scoped_file.h" | 15 #include "base/files/scoped_file.h" |
| 16 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
| 17 #include "base/process/process_handle.h" | 17 #include "base/process/process_handle.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/file_descriptor_info.h" | 20 #include "content/public/browser/file_descriptor_info.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class Pickle; | 23 class Pickle; |
| 24 } // namespace base | 24 } // namespace base |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 | 27 |
| 28 // Handles interprocess communication with the Linux zygote process. The zygote |
| 29 // does not use standard Chrome IPC or mojo, see: |
| 30 // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ip
c.md |
| 28 class CONTENT_EXPORT ZygoteCommunication { | 31 class CONTENT_EXPORT ZygoteCommunication { |
| 29 public: | 32 public: |
| 30 ZygoteCommunication(); | 33 ZygoteCommunication(); |
| 31 ~ZygoteCommunication(); | 34 ~ZygoteCommunication(); |
| 32 | 35 |
| 33 void Init(); | 36 void Init(); |
| 34 | 37 |
| 35 // Tries to start a process of type indicated by process_type. | 38 // Tries to start a process of type indicated by process_type. |
| 36 // Returns its pid on success, otherwise base::kNullProcessHandle; | 39 // Returns its pid on success, otherwise base::kNullProcessHandle; |
| 37 pid_t ForkRequest(const std::vector<std::string>& command_line, | 40 pid_t ForkRequest(const std::vector<std::string>& command_line, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 base::Lock child_tracking_lock_; | 92 base::Lock child_tracking_lock_; |
| 90 int sandbox_status_; | 93 int sandbox_status_; |
| 91 bool have_read_sandbox_status_word_; | 94 bool have_read_sandbox_status_word_; |
| 92 // Set to true when the zygote is initialized successfully. | 95 // Set to true when the zygote is initialized successfully. |
| 93 bool init_; | 96 bool init_; |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 } // namespace content | 99 } // namespace content |
| 97 | 100 |
| 98 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ | 101 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ |
| OLD | NEW |