Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: chrome/browser/process_singleton_mac.cc

Issue 5717002: [Mac] Make profile-locking error the same as failing to lock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_mac.cc
diff --git a/chrome/browser/process_singleton_mac.cc b/chrome/browser/process_singleton_mac.cc
index 9666e4a775c12b9ce9219ea616b7bcca66e7b0e7..863971146f6eaf024f1263054550f08538984f86 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698