| 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 <errno.h> | 7 #include <errno.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 selinux = access(kSelinuxPath.value().c_str(), X_OK) == 0 && | 480 selinux = access(kSelinuxPath.value().c_str(), X_OK) == 0 && |
| 481 has_selinux_files; | 481 has_selinux_files; |
| 482 selinux_valid = true; | 482 selinux_valid = true; |
| 483 } | 483 } |
| 484 | 484 |
| 485 if (use_suid_sandbox_for_adj_oom_score_ && !selinux) { | 485 if (use_suid_sandbox_for_adj_oom_score_ && !selinux) { |
| 486 #if defined(USE_TCMALLOC) | 486 #if defined(USE_TCMALLOC) |
| 487 // If heap profiling is running, these processes are not exiting, at least | 487 // If heap profiling is running, these processes are not exiting, at least |
| 488 // on ChromeOS. The easiest thing to do is not launch them when profiling. | 488 // on ChromeOS. The easiest thing to do is not launch them when profiling. |
| 489 // TODO(stevenjb): Investigate further and fix. | 489 // TODO(stevenjb): Investigate further and fix. |
| 490 if (IsHeapProfilerRunning()) | 490 if (base::allocator::IsHeapProfilerRunning()) |
| 491 return; | 491 return; |
| 492 #endif | 492 #endif |
| 493 std::vector<std::string> adj_oom_score_cmdline; | 493 std::vector<std::string> adj_oom_score_cmdline; |
| 494 adj_oom_score_cmdline.push_back(sandbox_binary_); | 494 adj_oom_score_cmdline.push_back(sandbox_binary_); |
| 495 adj_oom_score_cmdline.push_back(sandbox::kAdjustOOMScoreSwitch); | 495 adj_oom_score_cmdline.push_back(sandbox::kAdjustOOMScoreSwitch); |
| 496 adj_oom_score_cmdline.push_back(base::Int64ToString(pid)); | 496 adj_oom_score_cmdline.push_back(base::Int64ToString(pid)); |
| 497 adj_oom_score_cmdline.push_back(base::IntToString(score)); | 497 adj_oom_score_cmdline.push_back(base::IntToString(score)); |
| 498 | 498 |
| 499 base::Process sandbox_helper_process; | 499 base::Process sandbox_helper_process; |
| 500 base::LaunchOptions options; | 500 base::LaunchOptions options; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 } | 595 } |
| 596 | 596 |
| 597 if (!sandbox::Credentials::CanCreateProcessInNewUserNS()) { | 597 if (!sandbox::Credentials::CanCreateProcessInNewUserNS()) { |
| 598 return false; | 598 return false; |
| 599 } | 599 } |
| 600 | 600 |
| 601 return true; | 601 return true; |
| 602 } | 602 } |
| 603 | 603 |
| 604 } // namespace content | 604 } // namespace content |
| OLD | NEW |