diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-10 18:22:56 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-10 18:22:56 +0000 |
commit | a2d0818cc547b463261d33500903587b6f14ca8c (patch) | |
tree | 257a58edcbecde20638e4f5e41ec051664db4435 | |
parent | ec26af2997ebc52d0c0e84ecbc65ce64dc6591bd (diff) | |
download | chromium_src-a2d0818cc547b463261d33500903587b6f14ca8c.zip chromium_src-a2d0818cc547b463261d33500903587b6f14ca8c.tar.gz chromium_src-a2d0818cc547b463261d33500903587b6f14ca8c.tar.bz2 |
[Mac] Make profile-locking error the same as failing to lock.
Previously, the profile-locking code was conservative in the face of
errors. Histograms indicate that the error rate is acceptable (no
errors seen), so flip locking errors to me failure-to-lock.
BUG=58986
TEST=none
Review URL: http://codereview.chromium.org/5717002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68871 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/process_singleton_mac.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/chrome/browser/process_singleton_mac.cc b/chrome/browser/process_singleton_mac.cc index 9666e4a..8639711 100644 --- a/chrome/browser/process_singleton_mac.cc +++ b/chrome/browser/process_singleton_mac.cc @@ -62,10 +62,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { } // Attempt to acquire an exclusive lock on an empty file in the -// profile directory. Returns |true| if it gets the lock. -// TODO(shess): The older code always returned |true|. Monitor the -// histograms and convert the marked failure cases to |false| once -// it's clear that it is safe to do. http://crbug.com/58986 +// profile directory. Returns |true| if it gets the lock. Returns +// |false| if the lock is held, or if there is an error. // TODO(shess): Rather than logging failures, popup an alert. Punting // that for now because it would require confidence that this code is // never called in a situation where an alert wouldn't work. @@ -80,8 +78,7 @@ bool ProcessSingleton::Create() { DPCHECK(lock_fd_ != -1) << "Unexpected failure opening profile lockfile"; UMA_HISTOGRAM_ENUMERATION("ProcessSingleton.OpenError", capture_errno, kMaxErrno); - // TODO(shess): Change to |false|. - return true; + return false; } // Acquire an exclusive lock in non-blocking fashion. If the lock @@ -98,8 +95,7 @@ bool ProcessSingleton::Create() { if (capture_errno != EWOULDBLOCK) { UMA_HISTOGRAM_ENUMERATION("ProcessSingleton.LockError", capture_errno, kMaxErrno); - // TODO(shess): Change to |false|. - return true; + return false; } // The file is open by another process and locked. |