summaryrefslogtreecommitdiffstats
path: root/base/files
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/files
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/files')
-rw-r--r--base/files/file_path_watcher_browsertest.cc24
-rw-r--r--base/files/file_util_proxy.cc2
-rw-r--r--base/files/file_util_proxy_unittest.cc2
-rw-r--r--base/files/important_file_writer.cc6
-rw-r--r--base/files/scoped_temp_dir.cc2
-rw-r--r--base/files/scoped_temp_dir_unittest.cc2
6 files changed, 19 insertions, 19 deletions
diff --git a/base/files/file_path_watcher_browsertest.cc b/base/files/file_path_watcher_browsertest.cc
index 7c37432..2a8b0cf 100644
--- a/base/files/file_path_watcher_browsertest.cc
+++ b/base/files/file_path_watcher_browsertest.cc
@@ -274,7 +274,7 @@ TEST_F(FilePathWatcherTest, DeletedFile) {
ASSERT_TRUE(SetupWatch(test_file(), &watcher, delegate.get(), false));
// Now make sure we get notified if the file is deleted.
- file_util::Delete(test_file(), false);
+ base::Delete(test_file(), false);
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
}
@@ -369,7 +369,7 @@ TEST_F(FilePathWatcherTest, NonExistentDirectory) {
VLOG(1) << "Waiting for file change";
ASSERT_TRUE(WaitForEvents());
- ASSERT_TRUE(file_util::Delete(file, false));
+ ASSERT_TRUE(base::Delete(file, false));
VLOG(1) << "Waiting for file deletion";
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
@@ -421,7 +421,7 @@ TEST_F(FilePathWatcherTest, DisappearingDirectory) {
scoped_ptr<TestDelegate> delegate(new TestDelegate(collector()));
ASSERT_TRUE(SetupWatch(file, &watcher, delegate.get(), false));
- ASSERT_TRUE(file_util::Delete(dir, true));
+ ASSERT_TRUE(base::Delete(dir, true));
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
}
@@ -433,7 +433,7 @@ TEST_F(FilePathWatcherTest, DeleteAndRecreate) {
scoped_ptr<TestDelegate> delegate(new TestDelegate(collector()));
ASSERT_TRUE(SetupWatch(test_file(), &watcher, delegate.get(), false));
- ASSERT_TRUE(file_util::Delete(test_file(), false));
+ ASSERT_TRUE(base::Delete(test_file(), false));
VLOG(1) << "Waiting for file deletion";
ASSERT_TRUE(WaitForEvents());
@@ -466,7 +466,7 @@ TEST_F(FilePathWatcherTest, WatchDirectory) {
ASSERT_TRUE(WaitForEvents());
#endif // !OS_MACOSX
- ASSERT_TRUE(file_util::Delete(file1, false));
+ ASSERT_TRUE(base::Delete(file1, false));
VLOG(1) << "Waiting for file1 deletion";
ASSERT_TRUE(WaitForEvents());
@@ -548,11 +548,11 @@ TEST_F(FilePathWatcherTest, RecursiveWatch) {
ASSERT_TRUE(WaitForEvents());
// Delete "$dir/subdir/subdir_file1".
- ASSERT_TRUE(file_util::Delete(subdir_file1, false));
+ ASSERT_TRUE(base::Delete(subdir_file1, false));
ASSERT_TRUE(WaitForEvents());
// Delete "$dir/subdir/subdir_child_dir/child_dir_file1".
- ASSERT_TRUE(file_util::Delete(child_dir_file1, false));
+ ASSERT_TRUE(base::Delete(child_dir_file1, false));
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
}
@@ -640,7 +640,7 @@ TEST_F(FilePathWatcherTest, DeleteLink) {
ASSERT_TRUE(SetupWatch(test_link(), &watcher, delegate.get(), false));
// Now make sure we get notified if the link is deleted.
- ASSERT_TRUE(file_util::Delete(test_link(), false));
+ ASSERT_TRUE(base::Delete(test_link(), false));
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
}
@@ -687,7 +687,7 @@ TEST_F(FilePathWatcherTest, DeleteTargetLinkedFile) {
ASSERT_TRUE(SetupWatch(test_link(), &watcher, delegate.get(), false));
// Now make sure we get notified if the target file is deleted.
- ASSERT_TRUE(file_util::Delete(test_file(), false));
+ ASSERT_TRUE(base::Delete(test_file(), false));
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
}
@@ -715,7 +715,7 @@ TEST_F(FilePathWatcherTest, LinkedDirectoryPart1) {
VLOG(1) << "Waiting for file change";
ASSERT_TRUE(WaitForEvents());
- ASSERT_TRUE(file_util::Delete(file, false));
+ ASSERT_TRUE(base::Delete(file, false));
VLOG(1) << "Waiting for file deletion";
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
@@ -745,7 +745,7 @@ TEST_F(FilePathWatcherTest, LinkedDirectoryPart2) {
VLOG(1) << "Waiting for file change";
ASSERT_TRUE(WaitForEvents());
- ASSERT_TRUE(file_util::Delete(file, false));
+ ASSERT_TRUE(base::Delete(file, false));
VLOG(1) << "Waiting for file deletion";
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
@@ -773,7 +773,7 @@ TEST_F(FilePathWatcherTest, LinkedDirectoryPart3) {
VLOG(1) << "Waiting for file change";
ASSERT_TRUE(WaitForEvents());
- ASSERT_TRUE(file_util::Delete(file, false));
+ ASSERT_TRUE(base::Delete(file, false));
VLOG(1) << "Waiting for file deletion";
ASSERT_TRUE(WaitForEvents());
DeleteDelegateOnFileThread(delegate.release());
diff --git a/base/files/file_util_proxy.cc b/base/files/file_util_proxy.cc
index a1c568a..9f65da8e 100644
--- a/base/files/file_util_proxy.cc
+++ b/base/files/file_util_proxy.cc
@@ -213,7 +213,7 @@ PlatformFileError DeleteAdapter(const FilePath& file_path, bool recursive) {
if (!file_util::PathExists(file_path)) {
return PLATFORM_FILE_ERROR_NOT_FOUND;
}
- if (!file_util::Delete(file_path, recursive)) {
+ if (!base::Delete(file_path, recursive)) {
if (!recursive && !file_util::IsDirectoryEmpty(file_path)) {
return PLATFORM_FILE_ERROR_NOT_EMPTY;
}
diff --git a/base/files/file_util_proxy_unittest.cc b/base/files/file_util_proxy_unittest.cc
index ef23fd8..a4ba571 100644
--- a/base/files/file_util_proxy_unittest.cc
+++ b/base/files/file_util_proxy_unittest.cc
@@ -219,7 +219,7 @@ TEST_F(FileUtilProxyTest, CreateTemporary) {
EXPECT_EQ("test", data);
// Make sure we can & do delete the created file to prevent leaks on the bots.
- EXPECT_TRUE(file_util::Delete(path_, false));
+ EXPECT_TRUE(base::Delete(path_, false));
}
TEST_F(FileUtilProxyTest, GetFileInfo_File) {
diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc
index ab62cc3..f10e7e6 100644
--- a/base/files/important_file_writer.cc
+++ b/base/files/important_file_writer.cc
@@ -73,20 +73,20 @@ bool ImportantFileWriter::WriteFileAtomically(const FilePath& path,
if (!ClosePlatformFile(tmp_file)) {
LogFailure(path, FAILED_CLOSING, "failed to close temporary file");
- file_util::Delete(tmp_file_path, false);
+ base::Delete(tmp_file_path, false);
return false;
}
if (bytes_written < static_cast<int>(data.length())) {
LogFailure(path, FAILED_WRITING, "error writing, bytes_written=" +
IntToString(bytes_written));
- file_util::Delete(tmp_file_path, false);
+ base::Delete(tmp_file_path, false);
return false;
}
if (!file_util::ReplaceFile(tmp_file_path, path)) {
LogFailure(path, FAILED_RENAMING, "could not rename temporary file");
- file_util::Delete(tmp_file_path, false);
+ base::Delete(tmp_file_path, false);
return false;
}
diff --git a/base/files/scoped_temp_dir.cc b/base/files/scoped_temp_dir.cc
index 509f808..5666ce1 100644
--- a/base/files/scoped_temp_dir.cc
+++ b/base/files/scoped_temp_dir.cc
@@ -64,7 +64,7 @@ bool ScopedTempDir::Delete() {
if (path_.empty())
return false;
- bool ret = file_util::Delete(path_, true);
+ bool ret = base::Delete(path_, true);
if (ret) {
// We only clear the path if deleted the directory.
path_.clear();
diff --git a/base/files/scoped_temp_dir_unittest.cc b/base/files/scoped_temp_dir_unittest.cc
index 8497ac6..7acec84 100644
--- a/base/files/scoped_temp_dir_unittest.cc
+++ b/base/files/scoped_temp_dir_unittest.cc
@@ -77,7 +77,7 @@ TEST(ScopedTempDir, UniqueTempDirUnderPath) {
EXPECT_TRUE(test_path.value().find(base_path.value()) != std::string::npos);
}
EXPECT_FALSE(file_util::DirectoryExists(test_path));
- file_util::Delete(base_path, true);
+ base::Delete(base_path, true);
}
TEST(ScopedTempDir, MultipleInvocations) {