summaryrefslogtreecommitdiffstats
path: root/chrome/browser/process_singleton.h
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-28 12:39:59 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-28 12:39:59 +0000
commitdd85d45bfb6d0253a088521ceca46405b39f18e2 (patch)
treece611af56fdf0befb5f2e724618cc1c9693a170b /chrome/browser/process_singleton.h
parent4ad65c3a4747321e98974fa27db4ebab895daaf7 (diff)
downloadchromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.zip
chromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.tar.gz
chromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.tar.bz2
Simplify the ProcessSingleton API.
Instead of having multiple functions that take a callback to initialize a member variable, intitialize the member once during the constructor. This reduces the variability of the internal state of ProcessSingleton. BUG=170726, 170734 Review URL: https://chromiumcodereview.appspot.com/12668027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton.h')
-rw-r--r--chrome/browser/process_singleton.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h
index 0cded79..439e170 100644
--- a/chrome/browser/process_singleton.h
+++ b/chrome/browser/process_singleton.h
@@ -60,28 +60,26 @@ class ProcessSingleton : public base::NonThreadSafe {
const CommandLine& command_line,
const base::FilePath& current_directory)> NotificationCallback;
- explicit ProcessSingleton(const base::FilePath& user_data_dir);
+ ProcessSingleton(const base::FilePath& user_data_dir,
+ const NotificationCallback& notification_callback);
~ProcessSingleton();
// Notify another process, if available. Otherwise sets ourselves as the
- // singleton instance and stores the provided callback for notification from
- // future processes. Returns PROCESS_NONE if we became the singleton
+ // singleton instance. Returns PROCESS_NONE if we became the singleton
// instance. Callers are guaranteed to either have notified an existing
// process or have grabbed the singleton (unless the profile is locked by an
// unreachable process).
// TODO(brettw): Make the implementation of this method non-platform-specific
// by making Linux re-use the Windows implementation.
- NotifyResult NotifyOtherProcessOrCreate(
- const NotificationCallback& notification_callback);
+ NotifyResult NotifyOtherProcessOrCreate();
// Sets ourself up as the singleton instance. Returns true on success. If
// false is returned, we are not the singleton instance and the caller must
- // exit. Otherwise, stores the provided callback for notification from
- // future processes.
+ // exit.
// NOTE: Most callers should generally prefer NotifyOtherProcessOrCreate() to
// this method, only callers for whom failure is prefered to notifying another
// process should call this directly.
- bool Create(const NotificationCallback& notification_callback);
+ bool Create();
// Clear any lock state during shutdown.
void Cleanup();
@@ -133,7 +131,6 @@ class ProcessSingleton : public base::NonThreadSafe {
bool kill_unresponsive);
NotifyResult NotifyOtherProcessWithTimeoutOrCreate(
const CommandLine& command_line,
- const NotificationCallback& notification_callback,
int timeout_seconds);
void OverrideCurrentPidForTesting(base::ProcessId pid);
void OverrideKillCallbackForTesting(