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 #include "chrome/installer/util/self_cleaning_temp_dir.h" | 5 #include "chrome/installer/util/self_cleaning_temp_dir.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 if (!path().empty()) { | 52 if (!path().empty()) { |
53 LOG(DFATAL) << "Attempting to re-initialize a SelfSelfCleaningTempDir."; | 53 LOG(DFATAL) << "Attempting to re-initialize a SelfSelfCleaningTempDir."; |
54 return false; | 54 return false; |
55 } | 55 } |
56 | 56 |
57 base::FilePath temp_dir(parent_dir.Append(temp_name)); | 57 base::FilePath temp_dir(parent_dir.Append(temp_name)); |
58 base::FilePath base_dir; | 58 base::FilePath base_dir; |
59 GetTopDirToCreate(parent_dir, &base_dir); | 59 GetTopDirToCreate(parent_dir, &base_dir); |
60 | 60 |
61 if (file_util::CreateDirectory(temp_dir)) { | 61 if (base::CreateDirectory(temp_dir)) { |
62 base_dir_ = base_dir; | 62 base_dir_ = base_dir; |
63 temp_dir_ = temp_dir; | 63 temp_dir_ = temp_dir; |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
67 return false; | 67 return false; |
68 } | 68 } |
69 | 69 |
70 bool SelfCleaningTempDir::Delete() { | 70 bool SelfCleaningTempDir::Delete() { |
71 if (path().empty()) { | 71 if (path().empty()) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } while (true); | 109 } while (true); |
110 } | 110 } |
111 | 111 |
112 base_dir_.clear(); | 112 base_dir_.clear(); |
113 temp_dir_.clear(); | 113 temp_dir_.clear(); |
114 | 114 |
115 return true; | 115 return true; |
116 } | 116 } |
117 | 117 |
118 } // namespace installer | 118 } // namespace installer |
OLD | NEW |