| 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 #include "content/browser/zygote_host/zygote_communication_linux.h" | 5 #include "content/browser/zygote_host/zygote_communication_linux.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/sparse_histogram.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/pickle.h" | 16 #include "base/pickle.h" |
| 17 #include "base/posix/eintr_wrapper.h" | 17 #include "base/posix/eintr_wrapper.h" |
| 18 #include "base/posix/unix_domain_socket_linux.h" | 18 #include "base/posix/unix_domain_socket_linux.h" |
| 19 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 19 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 20 #include "content/browser/zygote_host/zygote_host_impl_linux.h" | 20 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
| 21 #include "content/common/child_process_sandbox_support_impl_linux.h" | 21 #include "content/common/child_process_sandbox_support_impl_linux.h" |
| 22 #include "content/common/zygote_commands_linux.h" | 22 #include "content/common/zygote_commands_linux.h" |
| 23 #include "content/public/browser/content_browser_client.h" | 23 #include "content/public/browser/content_browser_client.h" |
| 24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
| 25 #include "content/public/common/result_codes.h" | 25 #include "content/public/common/result_codes.h" |
| 26 #include "sandbox/linux/services/namespace_sandbox.h" | 26 #include "sandbox/linux/services/namespace_sandbox.h" |
| 27 #include "sandbox/linux/suid/client/setuid_sandbox_host.h" | 27 #include "sandbox/linux/suid/client/setuid_sandbox_host.h" |
| 28 #include "ui/display/display_switches.h" |
| 28 #include "ui/gfx/switches.h" | 29 #include "ui/gfx/switches.h" |
| 29 | 30 |
| 30 namespace content { | 31 namespace content { |
| 31 | 32 |
| 32 namespace { | 33 namespace { |
| 33 | 34 |
| 34 // Receive a fixed message on fd and return the sender's PID. | 35 // Receive a fixed message on fd and return the sender's PID. |
| 35 // Returns true if the message received matches the expected message. | 36 // Returns true if the message received matches the expected message. |
| 36 bool ReceiveFixedMessage(int fd, | 37 bool ReceiveFixedMessage(int fd, |
| 37 const char* expect_msg, | 38 const char* expect_msg, |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 } | 430 } |
| 430 if (ReadSandboxStatus() == -1) { | 431 if (ReadSandboxStatus() == -1) { |
| 431 return 0; | 432 return 0; |
| 432 } | 433 } |
| 433 have_read_sandbox_status_word_ = true; | 434 have_read_sandbox_status_word_ = true; |
| 434 UMA_HISTOGRAM_SPARSE_SLOWLY("Linux.SandboxStatus", sandbox_status_); | 435 UMA_HISTOGRAM_SPARSE_SLOWLY("Linux.SandboxStatus", sandbox_status_); |
| 435 return sandbox_status_; | 436 return sandbox_status_; |
| 436 } | 437 } |
| 437 | 438 |
| 438 } // namespace content | 439 } // namespace content |
| OLD | NEW |