OLD | NEW |
1 // Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009-2010 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 LOGIN_MANAGER_SESSION_MANAGER_SERVICE_H_ | 5 #ifndef LOGIN_MANAGER_SESSION_MANAGER_SERVICE_H_ |
6 #define LOGIN_MANAGER_SESSION_MANAGER_SERVICE_H_ | 6 #define LOGIN_MANAGER_SESSION_MANAGER_SERVICE_H_ |
7 | 7 |
8 #include <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
9 | 9 |
10 #include <errno.h> | 10 #include <errno.h> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 | 74 |
75 // If you want to call any of these setters, you should do so before calling | 75 // If you want to call any of these setters, you should do so before calling |
76 // any other methods on this class. | 76 // any other methods on this class. |
77 void set_child_pid(pid_t pid) { child_pid_ = pid; } | 77 void set_child_pid(pid_t pid) { child_pid_ = pid; } |
78 void set_systemutils(SystemUtils* utils) { system_.reset(utils); } | 78 void set_systemutils(SystemUtils* utils) { system_.reset(utils); } |
79 void set_exit_on_child_done(bool do_exit) { exit_on_child_done_ = do_exit; } | 79 void set_exit_on_child_done(bool do_exit) { exit_on_child_done_ = do_exit; } |
80 | 80 |
81 // Returns true if |child_job_| believes it should be run. | 81 // Returns true if |child_job_| believes it should be run. |
82 bool should_run_child() { return child_job_->ShouldRun(); } | 82 bool should_run_child() { return child_job_->ShouldRun(); } |
| 83 // Returns true if |child_job_| believes it should be stopped. |
| 84 // If the child believes it should be stopped (as opposed to not run anymore) |
| 85 // we actually exit the Service as well. |
| 86 bool should_stop_child() { return child_job_->ShouldStop(); } |
83 | 87 |
84 // Fork, then call child_job_->Run() in the child and set a | 88 // Fork, then call child_job_->Run() in the child and set a |
85 // babysitter in the parent's glib default context that calls | 89 // babysitter in the parent's glib default context that calls |
86 // HandleChildExit when the child is done. | 90 // HandleChildExit when the child is done. |
87 int RunChild(); | 91 int RunChild(); |
88 | 92 |
89 // Tell us that, if we want, we can cause a graceful exit from g_main_loop. | 93 // Tell us that, if we want, we can cause a graceful exit from g_main_loop. |
90 void AllowGracefulExit(); | 94 void AllowGracefulExit(); |
91 | 95 |
92 //////////////////////////////////////////////////////////////////////////// | 96 //////////////////////////////////////////////////////////////////////////// |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 FRIEND_TEST(SessionManagerTest, SessionStartedSlowKillCleanupTest); | 172 FRIEND_TEST(SessionManagerTest, SessionStartedSlowKillCleanupTest); |
169 FRIEND_TEST(SessionManagerTest, EmailAddressTest); | 173 FRIEND_TEST(SessionManagerTest, EmailAddressTest); |
170 FRIEND_TEST(SessionManagerTest, EmailAddressNonAsciiTest); | 174 FRIEND_TEST(SessionManagerTest, EmailAddressNonAsciiTest); |
171 FRIEND_TEST(SessionManagerTest, EmailAddressNoAtTest); | 175 FRIEND_TEST(SessionManagerTest, EmailAddressNoAtTest); |
172 FRIEND_TEST(SessionManagerTest, EmailAddressTooMuchAtTest); | 176 FRIEND_TEST(SessionManagerTest, EmailAddressTooMuchAtTest); |
173 DISALLOW_COPY_AND_ASSIGN(SessionManagerService); | 177 DISALLOW_COPY_AND_ASSIGN(SessionManagerService); |
174 }; | 178 }; |
175 } // namespace login_manager | 179 } // namespace login_manager |
176 | 180 |
177 #endif // LOGIN_MANAGER_SESSION_MANAGER_SERVICE_H_ | 181 #endif // LOGIN_MANAGER_SESSION_MANAGER_SERVICE_H_ |
OLD | NEW |