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

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

Issue 2399233002: Add histograms to the rendez-vous process (ProcessSingleton). (Closed)
Patch Set: fix compile 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/process_singleton_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 LAST_VALUE = LOCK_ERROR
57 }; 59 };
58 60
61 static constexpr int kNumNotifyResults = LAST_VALUE + 1;
62
59 // Implement this callback to handle notifications from other processes. The 63 // Implement this callback to handle notifications from other processes. The
60 // callback will receive the command line and directory with which the other 64 // 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 65 // 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 66 // 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). 67 // should handle it (i.e., because the current process is shutting down).
64 using NotificationCallback = 68 using NotificationCallback =
65 base::Callback<bool(const base::CommandLine& command_line, 69 base::Callback<bool(const base::CommandLine& command_line,
66 const base::FilePath& current_directory)>; 70 const base::FilePath& current_directory)>;
67 71
68 ProcessSingleton(const base::FilePath& user_data_dir, 72 ProcessSingleton(const base::FilePath& user_data_dir,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Helper class for linux specific messages. LinuxWatcher is ref counted 178 // Helper class for linux specific messages. LinuxWatcher is ref counted
175 // because it posts messages between threads. 179 // because it posts messages between threads.
176 class LinuxWatcher; 180 class LinuxWatcher;
177 scoped_refptr<LinuxWatcher> watcher_; 181 scoped_refptr<LinuxWatcher> watcher_;
178 #endif 182 #endif
179 183
180 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); 184 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton);
181 }; 185 };
182 186
183 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ 187 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/process_singleton_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698