| 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> |
| 11 | 11 |
| 12 #include <memory> |
| 13 |
| 12 #include "base/callback.h" | 14 #include "base/callback.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 16 | 17 |
| 17 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 18 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 18 #include "chrome/common/multi_process_lock.h" | 19 #include "chrome/common/multi_process_lock.h" |
| 19 MultiProcessLock* TakeServiceRunningLock(bool waiting); | 20 MultiProcessLock* TakeServiceRunningLock(bool waiting); |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
| 23 #include "base/files/file_path_watcher.h" | 24 #include "base/files/file_path_watcher.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // to be monitoring it. | 65 // to be monitoring it. |
| 65 void SignalReady(base::WaitableEvent* signal, bool* success); | 66 void SignalReady(base::WaitableEvent* signal, bool* success); |
| 66 | 67 |
| 67 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
| 68 bool WatchExecutable(); | 69 bool WatchExecutable(); |
| 69 | 70 |
| 70 base::ScopedCFTypeRef<CFDictionaryRef> launchd_conf; | 71 base::ScopedCFTypeRef<CFDictionaryRef> launchd_conf; |
| 71 base::FilePathWatcher executable_watcher; | 72 base::FilePathWatcher executable_watcher; |
| 72 #endif // OS_MACOSX | 73 #endif // OS_MACOSX |
| 73 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 74 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 74 scoped_ptr<MultiProcessLock> initializing_lock; | 75 std::unique_ptr<MultiProcessLock> initializing_lock; |
| 75 scoped_ptr<MultiProcessLock> running_lock; | 76 std::unique_ptr<MultiProcessLock> running_lock; |
| 76 #endif | 77 #endif |
| 77 scoped_ptr<ServiceProcessTerminateMonitor> terminate_monitor; | 78 std::unique_ptr<ServiceProcessTerminateMonitor> terminate_monitor; |
| 78 base::MessageLoopForIO::FileDescriptorWatcher watcher; | 79 base::MessageLoopForIO::FileDescriptorWatcher watcher; |
| 79 int sockets[2]; | 80 int sockets[2]; |
| 80 struct sigaction old_action; | 81 struct sigaction old_action; |
| 81 bool set_action; | 82 bool set_action; |
| 82 | 83 |
| 83 protected: | 84 protected: |
| 84 friend class base::RefCountedThreadSafe<ServiceProcessState::StateData>; | 85 friend class base::RefCountedThreadSafe<ServiceProcessState::StateData>; |
| 85 virtual ~StateData(); | 86 virtual ~StateData(); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ | 89 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_ |
| OLD | NEW |