Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/process_singleton.h

Issue 2399233002: Add histograms to the rendez-vous process (ProcessSingleton). (Closed)
Patch Set: comment on NotifyResult Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Logged as histograms, do not modify these values.
52 enum NotifyResult { 53 enum NotifyResult {
53 PROCESS_NONE, 54 PROCESS_NONE = 0,
54 PROCESS_NOTIFIED, 55 PROCESS_NOTIFIED = 1,
55 PROFILE_IN_USE, 56 PROFILE_IN_USE = 2,
56 LOCK_ERROR, 57 LOCK_ERROR = 3,
58 NUM_NOTIFY_RESULTS
57 }; 59 };
58 60
59 // Implement this callback to handle notifications from other processes. The 61 // Implement this callback to handle notifications from other processes. The
60 // callback will receive the command line and directory with which the other 62 // 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 63 // 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 64 // 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). 65 // should handle it (i.e., because the current process is shutting down).
64 using NotificationCallback = 66 using NotificationCallback =
65 base::Callback<bool(const base::CommandLine& command_line, 67 base::Callback<bool(const base::CommandLine& command_line,
66 const base::FilePath& current_directory)>; 68 const base::FilePath& current_directory)>;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Helper class for linux specific messages. LinuxWatcher is ref counted 176 // Helper class for linux specific messages. LinuxWatcher is ref counted
175 // because it posts messages between threads. 177 // because it posts messages between threads.
176 class LinuxWatcher; 178 class LinuxWatcher;
177 scoped_refptr<LinuxWatcher> watcher_; 179 scoped_refptr<LinuxWatcher> watcher_;
178 #endif 180 #endif
179 181
180 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); 182 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton);
181 }; 183 };
182 184
183 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ 185 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698