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 CHROME_BROWSER_PROCESS_SINGLETON_H_ | 5 #ifndef CHROME_BROWSER_PROCESS_SINGLETON_H_ |
6 #define CHROME_BROWSER_PROCESS_SINGLETON_H_ | 6 #define CHROME_BROWSER_PROCESS_SINGLETON_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // process or have grabbed the singleton (unless the profile is locked by an | 75 // process or have grabbed the singleton (unless the profile is locked by an |
76 // unreachable process). | 76 // unreachable process). |
77 // TODO(brettw): Make the implementation of this method non-platform-specific | 77 // TODO(brettw): Make the implementation of this method non-platform-specific |
78 // by making Linux re-use the Windows implementation. | 78 // by making Linux re-use the Windows implementation. |
79 NotifyResult NotifyOtherProcessOrCreate(); | 79 NotifyResult NotifyOtherProcessOrCreate(); |
80 | 80 |
81 // Sets ourself up as the singleton instance. Returns true on success. If | 81 // Sets ourself up as the singleton instance. Returns true on success. If |
82 // false is returned, we are not the singleton instance and the caller must | 82 // false is returned, we are not the singleton instance and the caller must |
83 // exit. | 83 // exit. |
84 // NOTE: Most callers should generally prefer NotifyOtherProcessOrCreate() to | 84 // NOTE: Most callers should generally prefer NotifyOtherProcessOrCreate() to |
85 // this method, only callers for whom failure is prefered to notifying another | 85 // this method, only callers for whom failure is preferred to notifying |
86 // process should call this directly. | 86 // another process should call this directly. |
87 bool Create(); | 87 bool Create(); |
88 | 88 |
89 // Clear any lock state during shutdown. | 89 // Clear any lock state during shutdown. |
90 void Cleanup(); | 90 void Cleanup(); |
91 | 91 |
92 #if defined(OS_POSIX) && !defined(OS_ANDROID) | 92 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
93 static void DisablePromptForTesting(); | 93 static void DisablePromptForTesting(); |
94 #endif | 94 #endif |
95 | 95 |
96 protected: | 96 protected: |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Helper class for linux specific messages. LinuxWatcher is ref counted | 168 // Helper class for linux specific messages. LinuxWatcher is ref counted |
169 // because it posts messages between threads. | 169 // because it posts messages between threads. |
170 class LinuxWatcher; | 170 class LinuxWatcher; |
171 scoped_refptr<LinuxWatcher> watcher_; | 171 scoped_refptr<LinuxWatcher> watcher_; |
172 #endif | 172 #endif |
173 | 173 |
174 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); | 174 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); |
175 }; | 175 }; |
176 | 176 |
177 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ | 177 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ |
OLD | NEW |