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

Side by Side Diff: base/files/scoped_temp_dir.cc

Issue 18584011: Rename base::Delete to base::DeleteFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months 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
« no previous file with comments | « base/files/important_file_writer.cc ('k') | base/files/scoped_temp_dir_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return false; 56 return false;
57 57
58 path_ = path; 58 path_ = path;
59 return true; 59 return true;
60 } 60 }
61 61
62 bool ScopedTempDir::Delete() { 62 bool ScopedTempDir::Delete() {
63 if (path_.empty()) 63 if (path_.empty())
64 return false; 64 return false;
65 65
66 bool ret = base::Delete(path_, true); 66 bool ret = base::DeleteFile(path_, true);
67 if (ret) { 67 if (ret) {
68 // We only clear the path if deleted the directory. 68 // We only clear the path if deleted the directory.
69 path_.clear(); 69 path_.clear();
70 } 70 }
71 71
72 return ret; 72 return ret;
73 } 73 }
74 74
75 FilePath ScopedTempDir::Take() { 75 FilePath ScopedTempDir::Take() {
76 FilePath ret = path_; 76 FilePath ret = path_;
77 path_ = FilePath(); 77 path_ = FilePath();
78 return ret; 78 return ret;
79 } 79 }
80 80
81 bool ScopedTempDir::IsValid() const { 81 bool ScopedTempDir::IsValid() const {
82 return !path_.empty() && DirectoryExists(path_); 82 return !path_.empty() && DirectoryExists(path_);
83 } 83 }
84 84
85 } // namespace base 85 } // namespace base
OLDNEW
« no previous file with comments | « base/files/important_file_writer.cc ('k') | base/files/scoped_temp_dir_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698