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

Side by Side Diff: chrome/browser/importer/firefox_profile_lock_posix.cc

Issue 114047: Add import progress indicator dialog. (Closed)
Patch Set: code review fixes Created 11 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/importer/firefox_importer_utils.cc ('k') | chrome/browser/importer/importer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/importer/firefox_profile_lock.h" 5 #include "chrome/browser/importer/firefox_profile_lock.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (HasAcquired()) 63 if (HasAcquired())
64 return; 64 return;
65 lock_fd_ = open(lock_file_.value().c_str(), O_CREAT | O_EXCL, 0644); 65 lock_fd_ = open(lock_file_.value().c_str(), O_CREAT | O_EXCL, 0644);
66 } 66 }
67 67
68 void FirefoxProfileLock::Unlock() { 68 void FirefoxProfileLock::Unlock() {
69 if (!HasAcquired()) 69 if (!HasAcquired())
70 return; 70 return;
71 close(lock_fd_); 71 close(lock_fd_);
72 lock_fd_ = -1; 72 lock_fd_ = -1;
73 file_util::Delete(lock_file_, false);
73 } 74 }
74 75
75 bool FirefoxProfileLock::HasAcquired() { 76 bool FirefoxProfileLock::HasAcquired() {
76 return (lock_fd_ >= 0); 77 return (lock_fd_ >= 0);
77 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/firefox_importer_utils.cc ('k') | chrome/browser/importer/importer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698