OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ | 5 #ifndef CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ |
6 #define CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ | 6 #define CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ |
7 | 7 |
8 #include "chrome/common/service_process_util.h" | 8 #include "chrome/common/service_process_util.h" |
9 | 9 |
10 #include <signal.h> | 10 #include <signal.h> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 }; | 57 }; |
58 | 58 |
59 struct ServiceProcessState::StateData | 59 struct ServiceProcessState::StateData |
60 : public base::RefCountedThreadSafe<ServiceProcessState::StateData> { | 60 : public base::RefCountedThreadSafe<ServiceProcessState::StateData> { |
61 StateData(); | 61 StateData(); |
62 | 62 |
63 // WatchFileDescriptor needs to be set up by the thread that is going | 63 // WatchFileDescriptor needs to be set up by the thread that is going |
64 // to be monitoring it. | 64 // to be monitoring it. |
65 void SignalReady(base::WaitableEvent* signal, bool* success); | 65 void SignalReady(base::WaitableEvent* signal, bool* success); |
66 | 66 |
67 | |
68 // TODO(jhawkins): Either make this a class or rename these public member | |
69 // variables to remove the trailing underscore. | |
70 | |
71 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
72 bool WatchExecutable(); | 68 bool WatchExecutable(); |
73 | 69 |
74 base::ScopedCFTypeRef<CFDictionaryRef> launchd_conf_; | 70 base::ScopedCFTypeRef<CFDictionaryRef> launchd_conf; |
75 base::FilePathWatcher executable_watcher_; | 71 base::FilePathWatcher executable_watcher; |
76 #endif // OS_MACOSX | 72 #endif // OS_MACOSX |
77 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 73 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
78 scoped_ptr<MultiProcessLock> initializing_lock_; | 74 scoped_ptr<MultiProcessLock> initializing_lock; |
79 scoped_ptr<MultiProcessLock> running_lock_; | 75 scoped_ptr<MultiProcessLock> running_lock; |
80 #endif | 76 #endif |
81 scoped_ptr<ServiceProcessTerminateMonitor> terminate_monitor_; | 77 scoped_ptr<ServiceProcessTerminateMonitor> terminate_monitor; |
82 base::MessageLoopForIO::FileDescriptorWatcher watcher_; | 78 base::MessageLoopForIO::FileDescriptorWatcher watcher; |
83 int sockets_[2]; | 79 int sockets[2]; |
84 struct sigaction old_action_; | 80 struct sigaction old_action; |
85 bool set_action_; | 81 bool set_action; |
86 | 82 |
87 protected: | 83 protected: |
88 friend class base::RefCountedThreadSafe<ServiceProcessState::StateData>; | 84 friend class base::RefCountedThreadSafe<ServiceProcessState::StateData>; |
89 virtual ~StateData(); | 85 virtual ~StateData(); |
90 }; | 86 }; |
91 | 87 |
92 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ | 88 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ |
OLD | NEW |