| 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 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
| 6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // is dead. When |known_dead| is false, processes could be seen as | 47 // is dead. When |known_dead| is false, processes could be seen as |
| 48 // still running, even when they're not. When |known_dead| is true, the | 48 // still running, even when they're not. When |known_dead| is true, the |
| 49 // process will be SIGKILL-ed first (which should have no effect if it was | 49 // process will be SIGKILL-ed first (which should have no effect if it was |
| 50 // really dead). This is to prevent a waiting waitpid() from blocking in | 50 // really dead). This is to prevent a waiting waitpid() from blocking in |
| 51 // a single-threaded Zygote. See crbug.com/157458. | 51 // a single-threaded Zygote. See crbug.com/157458. |
| 52 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, | 52 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, |
| 53 bool known_dead, | 53 bool known_dead, |
| 54 int* exit_code); | 54 int* exit_code); |
| 55 | 55 |
| 56 // ZygoteHost implementation: | 56 // ZygoteHost implementation: |
| 57 virtual pid_t GetPid() const OVERRIDE; | 57 virtual pid_t GetPid() const override; |
| 58 virtual int GetSandboxStatus() const OVERRIDE; | 58 virtual int GetSandboxStatus() const override; |
| 59 virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle, | 59 virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle, |
| 60 int score) OVERRIDE; | 60 int score) override; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 friend struct DefaultSingletonTraits<ZygoteHostImpl>; | 63 friend struct DefaultSingletonTraits<ZygoteHostImpl>; |
| 64 | 64 |
| 65 ZygoteHostImpl(); | 65 ZygoteHostImpl(); |
| 66 virtual ~ZygoteHostImpl(); | 66 virtual ~ZygoteHostImpl(); |
| 67 | 67 |
| 68 // Notify the Zygote to exit immediately. This object should not be | 68 // Notify the Zygote to exit immediately. This object should not be |
| 69 // used afterwards. | 69 // used afterwards. |
| 70 void TearDown(); | 70 void TearDown(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 96 // A lock protecting list_of_running_zygote_children_ and | 96 // A lock protecting list_of_running_zygote_children_ and |
| 97 // should_teardown_after_last_child_exits_. | 97 // should_teardown_after_last_child_exits_. |
| 98 base::Lock child_tracking_lock_; | 98 base::Lock child_tracking_lock_; |
| 99 std::set<pid_t> list_of_running_zygote_children_; | 99 std::set<pid_t> list_of_running_zygote_children_; |
| 100 bool should_teardown_after_last_child_exits_; | 100 bool should_teardown_after_last_child_exits_; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace content | 103 } // namespace content |
| 104 | 104 |
| 105 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 105 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
| OLD | NEW |