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

Unified Diff: base/file_util_win.cc

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 39da988059692171dc8c14e50aa1524a0c572a60..44367a0c745d6224347a2e087fea7c7027a16be9 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -27,23 +27,8 @@
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
-using base::FilePath;
-using base::g_bug108724_debug;
-
namespace base {
-FilePath MakeAbsoluteFilePath(const FilePath& input) {
- base::ThreadRestrictions::AssertIOAllowed();
- wchar_t file_path[MAX_PATH];
- if (!_wfullpath(file_path, input.value().c_str(), MAX_PATH))
- return FilePath();
- return FilePath(file_path);
-}
-
-} // namespace base
-
-namespace file_util {
-
namespace {
const DWORD kFileShareAll =
@@ -51,8 +36,16 @@ const DWORD kFileShareAll =
} // namespace
+FilePath MakeAbsoluteFilePath(const FilePath& input) {
+ ThreadRestrictions::AssertIOAllowed();
+ wchar_t file_path[MAX_PATH];
+ if (!_wfullpath(file_path, input.value().c_str(), MAX_PATH))
+ return FilePath();
+ return FilePath(file_path);
+}
+
bool Delete(const FilePath& path, bool recursive) {
- base::ThreadRestrictions::AssertIOAllowed();
+ ThreadRestrictions::AssertIOAllowed();
if (path.value().length() >= MAX_PATH)
return false;
@@ -60,8 +53,8 @@ bool Delete(const FilePath& path, bool recursive) {
if (!recursive) {
// If not recursing, then first check to see if |path| is a directory.
// If it is, then remove it with RemoveDirectory.
- base::PlatformFileInfo file_info;
- if (GetFileInfo(path, &file_info) && file_info.is_directory)
+ PlatformFileInfo file_info;
+ if (file_util::GetFileInfo(path, &file_info) && file_info.is_directory)
return RemoveDirectory(path.value().c_str()) != 0;
// Otherwise, it's a file, wildcard or non-existant. Try DeleteFile first
@@ -105,6 +98,13 @@ bool Delete(const FilePath& path, bool recursive) {
return (err == 0 || err == ERROR_FILE_NOT_FOUND || err == 0x402);
}
+} // namespace base
+
+namespace file_util {
+
+using base::FilePath;
+using base::kFileShareAll;
+
bool DeleteAfterReboot(const FilePath& path) {
base::ThreadRestrictions::AssertIOAllowed();
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698