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 // Used to send the reason of remote hang process termination as histogram. | |
| 53 enum RemoteHungProcessTerminateReason { | |
| 54 USER_ACCEPTED_TERMINATION, | |
| 55 NO_VISIBLE_WINDOW_FOUND, | |
| 56 NOTIFY_ATTEMPTS_EXCEEDED, | |
| 57 SOCKET_WRITE_FAILED, | |
| 58 SOCKET_READ_FAILED, | |
| 59 REMOTE_HUNG_PROCESS_TERMINATE_REASON_COUNT | |
| 60 }; | |
| 61 | |
| 62 // Used to send the result of interaction with remote process as histograms in | |
| 63 // case when remote process influences on start. | |
| 64 enum RemoteProcessInteractionResult { | |
| 65 TERMINATE_SUCCEEDED, | |
| 66 TERMINATE_FAILED, | |
| 67 TERMINATE_WAIT_TIMEOUT, | |
| 68 TERMINATE_NOT_ENOUGH_PERMISSIONS, | |
| 69 REMOTE_PROCESS_SHUTTING_DOWN, | |
| 70 PROFILE_UNLOCKED, | |
| 71 REMOTE_PROCESS_NOT_FOUND, | |
| 72 FAILED_TO_EXTRACT_PID, | |
| 73 INVALID_LOCK_FILE, | |
| 74 ORPHANED_LOCK_FILE, | |
| 75 SAME_BROWSER_INSTANCE, | |
| 76 REMOTE_PROCESS_NOTIFY_FAILED, | |
| 77 REMOTE_PROCESS_INTERACTION_RESULT_COUNT | |
| 78 }; | |
|
gab
2017/05/11 15:10:03
Split both of these into
enum MyEnum {
#if define
Alexey Seren
2017/05/11 19:18:40
Acknowledged.
| |
| 79 | |
| 52 // Logged as histograms, do not modify these values. | 80 // Logged as histograms, do not modify these values. |
| 53 enum NotifyResult { | 81 enum NotifyResult { |
| 54 PROCESS_NONE = 0, | 82 PROCESS_NONE = 0, |
| 55 PROCESS_NOTIFIED = 1, | 83 PROCESS_NOTIFIED = 1, |
| 56 PROFILE_IN_USE = 2, | 84 PROFILE_IN_USE = 2, |
| 57 LOCK_ERROR = 3, | 85 LOCK_ERROR = 3, |
| 58 LAST_VALUE = LOCK_ERROR | 86 LAST_VALUE = LOCK_ERROR |
| 59 }; | 87 }; |
| 60 | 88 |
| 61 static constexpr int kNumNotifyResults = LAST_VALUE + 1; | 89 static constexpr int kNumNotifyResults = LAST_VALUE + 1; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 // Helper class for linux specific messages. LinuxWatcher is ref counted | 206 // Helper class for linux specific messages. LinuxWatcher is ref counted |
| 179 // because it posts messages between threads. | 207 // because it posts messages between threads. |
| 180 class LinuxWatcher; | 208 class LinuxWatcher; |
| 181 scoped_refptr<LinuxWatcher> watcher_; | 209 scoped_refptr<LinuxWatcher> watcher_; |
| 182 #endif | 210 #endif |
| 183 | 211 |
| 184 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); | 212 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); |
| 185 }; | 213 }; |
| 186 | 214 |
| 187 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ | 215 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ |
| OLD | NEW |