Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: chrome/installer/util/self_cleaning_temp_dir.cc

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 bool SelfCleaningTempDir::Delete() { 69 bool SelfCleaningTempDir::Delete() {
70 if (path().empty()) { 70 if (path().empty()) {
71 LOG(DFATAL) << "Attempting to Delete an uninitialized SelfCleaningTempDir."; 71 LOG(DFATAL) << "Attempting to Delete an uninitialized SelfCleaningTempDir.";
72 return false; 72 return false;
73 } 73 }
74 74
75 FilePath next_dir(path().DirName()); 75 FilePath next_dir(path().DirName());
76 bool schedule_deletes = false; 76 bool schedule_deletes = false;
77 77
78 // First try to recursively delete the leaf directory managed by our 78 // First try to recursively delete the leaf directory managed by our
79 // ScopedTempDir. 79 // base::ScopedTempDir.
80 if (!file_util::Delete(path(), true)) { 80 if (!file_util::Delete(path(), true)) {
81 // That failed, so schedule the temp dir and its contents for deletion after 81 // That failed, so schedule the temp dir and its contents for deletion after
82 // reboot. 82 // reboot.
83 LOG(WARNING) << "Failed to delete temporary directory " << path().value() 83 LOG(WARNING) << "Failed to delete temporary directory " << path().value()
84 << ". Scheduling for deletion at reboot."; 84 << ". Scheduling for deletion at reboot.";
85 schedule_deletes = true; 85 schedule_deletes = true;
86 if (!ScheduleDirectoryForDeletion(path().value().c_str())) 86 if (!ScheduleDirectoryForDeletion(path().value().c_str()))
87 return false; // Entirely unexpected failure (Schedule logs the reason). 87 return false; // Entirely unexpected failure (Schedule logs the reason).
88 } 88 }
89 89
(...skipping 18 matching lines...) Expand all
108 } while (true); 108 } while (true);
109 } 109 }
110 110
111 base_dir_.clear(); 111 base_dir_.clear();
112 temp_dir_.clear(); 112 temp_dir_.clear();
113 113
114 return true; 114 return true;
115 } 115 }
116 116
117 } // namespace installer 117 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/util/self_cleaning_temp_dir.h ('k') | chrome/installer/util/self_cleaning_temp_dir_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698