diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-28 22:22:44 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-28 22:22:44 +0000 |
commit | 4a44bc32d152f0583bb196339c2568351573e304 (patch) | |
tree | fc2513a618e59b3b620fd1f001acbce24e87611b /chrome/browser/process_singleton.h | |
parent | c8b59f972e2c4b6fa92dab4101e9ccf0a15c20b4 (diff) | |
download | chromium_src-4a44bc32d152f0583bb196339c2568351573e304.zip chromium_src-4a44bc32d152f0583bb196339c2568351573e304.tar.gz chromium_src-4a44bc32d152f0583bb196339c2568351573e304.tar.bz2 |
ProcessSingleton(all): create the lock immediately after failing to connect to an existing process.
ProcessSingletonLinux: if creating the lock fails, try to notify again.
BUG=44417
TEST=manual
Review URL: http://codereview.chromium.org/2066014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton.h')
-rw-r--r-- | chrome/browser/process_singleton.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h index 4ae0b10..d2ee14f 100644 --- a/chrome/browser/process_singleton.h +++ b/chrome/browser/process_singleton.h @@ -37,6 +37,7 @@ class ProcessSingleton : public NonThreadSafe { PROCESS_NONE, PROCESS_NOTIFIED, PROFILE_IN_USE, + LOCK_ERROR, }; explicit ProcessSingleton(const FilePath& user_data_dir); @@ -52,11 +53,20 @@ class ProcessSingleton : public NonThreadSafe { // first one, so this function won't find it. NotifyResult NotifyOtherProcess(); + // Notify another process, if available. Otherwise sets ourselves as the + // singleton instance. Returns PROCESS_NONE if we became the singleton + // instance. + NotifyResult NotifyOtherProcessOrCreate(); + #if defined(OS_POSIX) && !defined(OS_MACOSX) // Exposed for testing. We use a timeout on Linux, and in tests we want // this timeout to be short. NotifyResult NotifyOtherProcessWithTimeout(const CommandLine& command_line, - int timeout_seconds); + int timeout_seconds, + bool kill_unresponsive); + NotifyResult NotifyOtherProcessWithTimeoutOrCreate( + const CommandLine& command_line, + int timeout_seconds); #endif // Sets ourself up as the singleton instance. Returns true on success. If |