diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 22:20:32 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 22:20:32 +0000 |
commit | b2841b0739079820ae5a3f405fa777e5109a2e79 (patch) | |
tree | 4395081c3a84401c46936a6f1b89749336ce147c /chrome/browser/process_singleton.h | |
parent | bd9ca3554160c3e4cac9ff289d2713d216fcbd6f (diff) | |
download | chromium_src-b2841b0739079820ae5a3f405fa777e5109a2e79.zip chromium_src-b2841b0739079820ae5a3f405fa777e5109a2e79.tar.gz chromium_src-b2841b0739079820ae5a3f405fa777e5109a2e79.tar.bz2 |
[Mac] Lock profile against multiple uses.
Mac uses Launch Services to make sure one Chrome is started from the
GUI, and AppleEvents and Launch Services to pass in URLs. When a
developer or test launches multiple browsers against a profile, it
fails in mysterious ways. This adds a profile lock to flush out any
hidden assumptions.
BUG=22163,58986,59061
TEST=Run Chromium twice with same --user-data-dir. Second instances shouldn't launch.
Review URL: http://codereview.chromium.org/3777003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton.h')
-rw-r--r-- | chrome/browser/process_singleton.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h index 57dd446..c8f34ed 100644 --- a/chrome/browser/process_singleton.h +++ b/chrome/browser/process_singleton.h @@ -13,7 +13,7 @@ #endif #include "base/basictypes.h" -#if defined(USE_X11) +#if defined(USE_X11) || defined(OS_MACOSX) #include "base/file_path.h" #endif #include "base/logging.h" @@ -152,6 +152,14 @@ class ProcessSingleton : public NonThreadSafe { // because it posts messages between threads. class LinuxWatcher; scoped_refptr<LinuxWatcher> watcher_; +#elif defined(OS_MACOSX) + // Path in file system to the lock. + FilePath lock_path_; + + // File descriptor associated with the lockfile, valid between + // |Create()| and |Cleanup()|. Two instances cannot have a lock on + // the same file at the same time. + int lock_fd_; #endif DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); |