| 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 #include "content/zygote/zygote_linux.h" | 5 #include "content/zygote/zygote_linux.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <poll.h> | 9 #include <poll.h> |
| 10 #include <signal.h> | 10 #include <signal.h> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 PCHECK(pid == HANDLE_EINTR(waitpid(pid, NULL, 0))); | 88 PCHECK(pid == HANDLE_EINTR(waitpid(pid, NULL, 0))); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace | 91 } // namespace |
| 92 | 92 |
| 93 Zygote::Zygote(int sandbox_flags, | 93 Zygote::Zygote(int sandbox_flags, |
| 94 ScopedVector<ZygoteForkDelegate> helpers, | 94 ScopedVector<ZygoteForkDelegate> helpers, |
| 95 const std::vector<base::ProcessHandle>& extra_children, | 95 const std::vector<base::ProcessHandle>& extra_children, |
| 96 const std::vector<int>& extra_fds) | 96 const std::vector<int>& extra_fds) |
| 97 : sandbox_flags_(sandbox_flags), | 97 : sandbox_flags_(sandbox_flags), |
| 98 helpers_(helpers.Pass()), | 98 helpers_(std::move(helpers)), |
| 99 initial_uma_index_(0), | 99 initial_uma_index_(0), |
| 100 extra_children_(extra_children), | 100 extra_children_(extra_children), |
| 101 extra_fds_(extra_fds), | 101 extra_fds_(extra_fds), |
| 102 to_reap_() {} | 102 to_reap_() {} |
| 103 | 103 |
| 104 Zygote::~Zygote() { | 104 Zygote::~Zygote() { |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool Zygote::ProcessRequests() { | 107 bool Zygote::ProcessRequests() { |
| 108 // A SOCK_SEQPACKET socket is installed in fd 3. We get commands from the | 108 // A SOCK_SEQPACKET socket is installed in fd 3. We get commands from the |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 bool Zygote::HandleGetSandboxStatus(int fd, base::PickleIterator iter) { | 665 bool Zygote::HandleGetSandboxStatus(int fd, base::PickleIterator iter) { |
| 666 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != | 666 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != |
| 667 sizeof(sandbox_flags_)) { | 667 sizeof(sandbox_flags_)) { |
| 668 PLOG(ERROR) << "write"; | 668 PLOG(ERROR) << "write"; |
| 669 } | 669 } |
| 670 | 670 |
| 671 return false; | 671 return false; |
| 672 } | 672 } |
| 673 | 673 |
| 674 } // namespace content | 674 } // namespace content |
| OLD | NEW |