From a2c2bfdd83030cd9063926f899c28db419ff35ae Mon Sep 17 00:00:00 2001 From: "mattm@chromium.org" Date: Fri, 21 May 2010 01:52:28 +0000 Subject: 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@47875 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/process_singleton.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'chrome/browser/process_singleton.h') 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 -- cgit v1.1