summaryrefslogtreecommitdiffstats
path: root/base/file_util_win.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-01 19:41:02 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-01 19:41:02 +0000
commit918efbf64de58c82ffa3cd8799d9ad822811a37a (patch)
tree5ceffb5e1576177d75f1aa8546bcae074df63c1e /base/file_util_win.cc
parente07f44f6b208541c9602bb9cc5f311612aaab64a (diff)
downloadchromium_src-918efbf64de58c82ffa3cd8799d9ad822811a37a.zip
chromium_src-918efbf64de58c82ffa3cd8799d9ad822811a37a.tar.gz
chromium_src-918efbf64de58c82ffa3cd8799d9ad822811a37a.tar.bz2
Move file_util::Delete to the base namespace
BUG= Review URL: https://codereview.chromium.org/16950028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_win.cc')
-rw-r--r--base/file_util_win.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 39da988..44367a0 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();