Chromium Code Reviews| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 // each other. It is named according to the user data directory, so | 42 // each other. It is named according to the user data directory, so |
| 43 // we can be sure that no more than one copy of the application can be | 43 // we can be sure that no more than one copy of the application can be |
| 44 // running at once with a given data directory. | 44 // running at once with a given data directory. |
| 45 // | 45 // |
| 46 // Implementation notes: | 46 // Implementation notes: |
| 47 // - the Windows implementation uses an invisible global message window; | 47 // - the Windows implementation uses an invisible global message window; |
| 48 // - the Linux implementation uses a Unix domain socket in the user data dir. | 48 // - the Linux implementation uses a Unix domain socket in the user data dir. |
| 49 | 49 |
| 50 class ProcessSingleton : public base::NonThreadSafe { | 50 class ProcessSingleton : public base::NonThreadSafe { |
| 51 public: | 51 public: |
| 52 enum NotifyResult { | 52 enum NotifyResult { |
|
manzagop (departed)
2016/10/07 14:23:29
Add comment that these are logged as histograms an
gab
2016/10/07 16:12:04
Done.
| |
| 53 PROCESS_NONE, | 53 PROCESS_NONE, |
| 54 PROCESS_NOTIFIED, | 54 PROCESS_NOTIFIED, |
| 55 PROFILE_IN_USE, | 55 PROFILE_IN_USE, |
| 56 LOCK_ERROR, | 56 LOCK_ERROR, |
| 57 NUM_NOTIFY_RESULTS | |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 // Implement this callback to handle notifications from other processes. The | 60 // Implement this callback to handle notifications from other processes. The |
| 60 // callback will receive the command line and directory with which the other | 61 // callback will receive the command line and directory with which the other |
| 61 // Chrome process was launched. Return true if the command line will be | 62 // Chrome process was launched. Return true if the command line will be |
| 62 // handled within the current browser instance or false if the remote process | 63 // handled within the current browser instance or false if the remote process |
| 63 // should handle it (i.e., because the current process is shutting down). | 64 // should handle it (i.e., because the current process is shutting down). |
| 64 using NotificationCallback = | 65 using NotificationCallback = |
| 65 base::Callback<bool(const base::CommandLine& command_line, | 66 base::Callback<bool(const base::CommandLine& command_line, |
| 66 const base::FilePath& current_directory)>; | 67 const base::FilePath& current_directory)>; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 // Helper class for linux specific messages. LinuxWatcher is ref counted | 175 // Helper class for linux specific messages. LinuxWatcher is ref counted |
| 175 // because it posts messages between threads. | 176 // because it posts messages between threads. |
| 176 class LinuxWatcher; | 177 class LinuxWatcher; |
| 177 scoped_refptr<LinuxWatcher> watcher_; | 178 scoped_refptr<LinuxWatcher> watcher_; |
| 178 #endif | 179 #endif |
| 179 | 180 |
| 180 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); | 181 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); |
| 181 }; | 182 }; |
| 182 | 183 |
| 183 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ | 184 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ |
| OLD | NEW |