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/browser/zygote_host/zygote_host_impl_linux.h" | 5 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
6 | 6 |
7 #include <sys/socket.h> | 7 #include <sys/socket.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 std::vector<int> fds; | 267 std::vector<int> fds; |
268 // Scoped pointers cannot be stored in containers, so we have to use a | 268 // Scoped pointers cannot be stored in containers, so we have to use a |
269 // linked_ptr. | 269 // linked_ptr. |
270 std::vector<linked_ptr<file_util::ScopedFD> > autodelete_fds; | 270 std::vector<linked_ptr<file_util::ScopedFD> > autodelete_fds; |
271 for (std::vector<FileDescriptorInfo>::const_iterator | 271 for (std::vector<FileDescriptorInfo>::const_iterator |
272 i = mapping.begin(); i != mapping.end(); ++i) { | 272 i = mapping.begin(); i != mapping.end(); ++i) { |
273 pickle.WriteUInt32(i->id); | 273 pickle.WriteUInt32(i->id); |
274 fds.push_back(i->fd.fd); | 274 fds.push_back(i->fd.fd); |
275 if (i->fd.auto_close) { | 275 if (i->fd.auto_close) { |
276 // Auto-close means we need to close the FDs after they habe been passed | 276 // Auto-close means we need to close the FDs after they have been passed |
277 // to the other process. | 277 // to the other process. |
278 linked_ptr<file_util::ScopedFD> ptr( | 278 linked_ptr<file_util::ScopedFD> ptr( |
279 new file_util::ScopedFD(&(fds.back()))); | 279 new file_util::ScopedFD(&(fds.back()))); |
280 autodelete_fds.push_back(ptr); | 280 autodelete_fds.push_back(ptr); |
281 } | 281 } |
282 } | 282 } |
283 | 283 |
284 pid_t pid; | 284 pid_t pid; |
285 { | 285 { |
286 base::AutoLock lock(control_lock_); | 286 base::AutoLock lock(control_lock_); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 return RenderSandboxHostLinux::GetInstance()->pid(); | 504 return RenderSandboxHostLinux::GetInstance()->pid(); |
505 } | 505 } |
506 | 506 |
507 int ZygoteHostImpl::GetSandboxStatus() const { | 507 int ZygoteHostImpl::GetSandboxStatus() const { |
508 if (have_read_sandbox_status_word_) | 508 if (have_read_sandbox_status_word_) |
509 return sandbox_status_; | 509 return sandbox_status_; |
510 return 0; | 510 return 0; |
511 } | 511 } |
512 | 512 |
513 } // namespace content | 513 } // namespace content |
OLD | NEW |