| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include <string> | |
| 16 | |
| 17 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 18 #include "base/file_path.h" | 16 #include "base/file_path.h" |
| 19 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 20 | 18 |
| 21 // Firefox is designed to allow only one application to access its | 19 // Firefox is designed to allow only one application to access its |
| 22 // profile at the same time. | 20 // profile at the same time. |
| 23 // Reference: | 21 // Reference: |
| 24 // http://kb.mozillazine.org/Profile_in_use | 22 // http://kb.mozillazine.org/Profile_in_use |
| 25 // | 23 // |
| 26 // This class is based on Firefox code in: | 24 // This class is based on Firefox code in: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // Method that tries to put a fcntl lock on file specified by |lock_file_|. | 104 // Method that tries to put a fcntl lock on file specified by |lock_file_|. |
| 107 // Returns false if lock is already held by another process. true in all | 105 // Returns false if lock is already held by another process. true in all |
| 108 // other cases. | 106 // other cases. |
| 109 bool LockWithFcntl(); | 107 bool LockWithFcntl(); |
| 110 #endif | 108 #endif |
| 111 | 109 |
| 112 DISALLOW_COPY_AND_ASSIGN(FirefoxProfileLock); | 110 DISALLOW_COPY_AND_ASSIGN(FirefoxProfileLock); |
| 113 }; | 111 }; |
| 114 | 112 |
| 115 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ | 113 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_PROFILE_LOCK_H__ |
| OLD | NEW |