OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ | 5 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ |
6 #define CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ | 6 #define CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <windows.h> | 11 #include <windows.h> |
12 #endif | 12 #endif |
13 | 13 |
14 #include "base/basictypes.h" | |
15 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
16 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" |
17 | 17 |
18 // Firefox is designed to allow only one application to access its | 18 // Firefox is designed to allow only one application to access its |
19 // profile at the same time. | 19 // profile at the same time. |
20 // Reference: | 20 // Reference: |
21 // http://kb.mozillazine.org/Profile_in_use | 21 // http://kb.mozillazine.org/Profile_in_use |
22 // | 22 // |
23 // This class is based on Firefox code in: | 23 // This class is based on Firefox code in: |
24 // profile/dirserviceprovider/src/nsProfileLock.cpp | 24 // profile/dirserviceprovider/src/nsProfileLock.cpp |
25 // The license block is: | 25 // The license block is: |
26 | 26 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Method that tries to put a fcntl lock on file specified by |lock_file_|. | 103 // Method that tries to put a fcntl lock on file specified by |lock_file_|. |
104 // Returns false if lock is already held by another process. true in all | 104 // Returns false if lock is already held by another process. true in all |
105 // other cases. | 105 // other cases. |
106 bool LockWithFcntl(); | 106 bool LockWithFcntl(); |
107 #endif | 107 #endif |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(FirefoxProfileLock); | 109 DISALLOW_COPY_AND_ASSIGN(FirefoxProfileLock); |
110 }; | 110 }; |
111 | 111 |
112 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ | 112 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ |
OLD | NEW |