| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 | 8 |
| 9 // This class is based on Firefox code in: | 9 // This class is based on Firefox code in: |
| 10 // profile/dirserviceprovider/src/nsProfileLock.cpp | 10 // profile/dirserviceprovider/src/nsProfileLock.cpp |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 * under the terms of either the GPL or the LGPL, and not to allow others to | 45 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 46 * use your version of this file under the terms of the MPL, indicate your | 46 * use your version of this file under the terms of the MPL, indicate your |
| 47 * decision by deleting the provisions above and replace them with the notice | 47 * decision by deleting the provisions above and replace them with the notice |
| 48 * and other provisions required by the GPL or the LGPL. If you do not delete | 48 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 49 * the provisions above, a recipient may use your version of this file under | 49 * the provisions above, a recipient may use your version of this file under |
| 50 * the terms of any one of the MPL, the GPL or the LGPL. | 50 * the terms of any one of the MPL, the GPL or the LGPL. |
| 51 * | 51 * |
| 52 * ***** END LICENSE BLOCK ***** */ | 52 * ***** END LICENSE BLOCK ***** */ |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 #if defined(OS_LINUX) |
| 56 // TODO(rahulk): Even though this is called OLD_LOCK_FILE_NAME in Firefox code |
| 57 // http://www.google.com/codesearch/p?hl=en#e_ObwTAVPyo/profile/dirserviceprovid
er/src/nsProfileLock.cpp&l=433 |
| 58 // this seems to work with Firefox 3.0. |
| 59 const FilePath::CharType* FirefoxProfileLock::kLockFileName = |
| 60 FILE_PATH_LITERAL("lock"); |
| 61 #else |
| 55 const FilePath::CharType* FirefoxProfileLock::kLockFileName = | 62 const FilePath::CharType* FirefoxProfileLock::kLockFileName = |
| 56 FILE_PATH_LITERAL("parent.lock"); | 63 FILE_PATH_LITERAL("parent.lock"); |
| 64 #endif |
| 57 | 65 |
| 58 FirefoxProfileLock::FirefoxProfileLock(const std::wstring& path) { | 66 FirefoxProfileLock::FirefoxProfileLock(const std::wstring& path) { |
| 59 Init(); | 67 Init(); |
| 60 lock_file_ = FilePath::FromWStringHack(path).Append(kLockFileName); | 68 lock_file_ = FilePath::FromWStringHack(path).Append(kLockFileName); |
| 61 Lock(); | 69 Lock(); |
| 62 } | 70 } |
| 63 | 71 |
| 64 FirefoxProfileLock::~FirefoxProfileLock() { | 72 FirefoxProfileLock::~FirefoxProfileLock() { |
| 65 Unlock(); | 73 Unlock(); |
| 66 } | 74 } |
| OLD | NEW |