OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INSTALLER_UTIL_SELF_CLEANING_TEMP_DIR_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_SELF_CLEANING_TEMP_DIR_H_ |
6 #define CHROME_INSTALLER_UTIL_SELF_CLEANING_TEMP_DIR_H_ | 6 #define CHROME_INSTALLER_UTIL_SELF_CLEANING_TEMP_DIR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | |
9 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
10 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/macros.h" |
11 | 11 |
12 namespace installer { | 12 namespace installer { |
13 | 13 |
14 // A helper class for managing a temporary directory. In relation to | 14 // A helper class for managing a temporary directory. In relation to |
15 // base::ScopedTempDir, this class additionally cleans up all non-empty parent | 15 // base::ScopedTempDir, this class additionally cleans up all non-empty parent |
16 // directories of the temporary directory that are created by an instance. | 16 // directories of the temporary directory that are created by an instance. |
17 class SelfCleaningTempDir { | 17 class SelfCleaningTempDir { |
18 public: | 18 public: |
19 typedef base::FilePath::StringType StringType; | 19 typedef base::FilePath::StringType StringType; |
20 | 20 |
(...skipping 26 matching lines...) Expand all Loading... |
47 base::FilePath temp_dir_; | 47 base::FilePath temp_dir_; |
48 | 48 |
49 FRIEND_TEST_ALL_PREFIXES(SelfCleaningTempDirTest, TopLevel); | 49 FRIEND_TEST_ALL_PREFIXES(SelfCleaningTempDirTest, TopLevel); |
50 FRIEND_TEST_ALL_PREFIXES(SelfCleaningTempDirTest, TopLevelPlusOne); | 50 FRIEND_TEST_ALL_PREFIXES(SelfCleaningTempDirTest, TopLevelPlusOne); |
51 DISALLOW_COPY_AND_ASSIGN(SelfCleaningTempDir); | 51 DISALLOW_COPY_AND_ASSIGN(SelfCleaningTempDir); |
52 }; | 52 }; |
53 | 53 |
54 } // namespace installer | 54 } // namespace installer |
55 | 55 |
56 #endif // CHROME_INSTALLER_UTIL_SELF_CLEANING_TEMP_DIR_H_ | 56 #endif // CHROME_INSTALLER_UTIL_SELF_CLEANING_TEMP_DIR_H_ |
OLD | NEW |