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

Unified Diff: base/file_util.cc

Issue 100453006: Move Touch to base namespace, remove SetLastModifiedTime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
Index: base/file_util.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index 6140ceae28ab5980395ce2c0db96eeed76388e0f..8bcf1a46c64246634a90f29deb045ddafc1fbe77 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -173,42 +173,36 @@ bool GetFileSize(const FilePath& file_path, int64* file_size) {
return true;
}
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
-using base::FileEnumerator;
-using base::FilePath;
-using base::kMaxUniqueFiles;
-
bool TouchFile(const FilePath& path,
- const base::Time& last_accessed,
- const base::Time& last_modified) {
- int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE_ATTRIBUTES;
+ const Time& last_accessed,
+ const Time& last_modified) {
+ int flags = PLATFORM_FILE_OPEN | PLATFORM_FILE_WRITE_ATTRIBUTES;
#if defined(OS_WIN)
// On Windows, FILE_FLAG_BACKUP_SEMANTICS is needed to open a directory.
if (DirectoryExists(path))
- flags |= base::PLATFORM_FILE_BACKUP_SEMANTICS;
+ flags |= PLATFORM_FILE_BACKUP_SEMANTICS;
#endif // OS_WIN
- const base::PlatformFile file =
- base::CreatePlatformFile(path, flags, NULL, NULL);
- if (file != base::kInvalidPlatformFileValue) {
- bool result = base::TouchPlatformFile(file, last_accessed, last_modified);
- base::ClosePlatformFile(file);
+ const PlatformFile file = CreatePlatformFile(path, flags, NULL, NULL);
+ if (file != kInvalidPlatformFileValue) {
+ bool result = TouchPlatformFile(file, last_accessed, last_modified);
+ ClosePlatformFile(file);
return result;
}
return false;
}
-bool SetLastModifiedTime(const FilePath& path,
- const base::Time& last_modified) {
- return TouchFile(path, last_modified, last_modified);
-}
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
+
+using base::FileEnumerator;
+using base::FilePath;
+using base::kMaxUniqueFiles;
bool CloseFile(FILE* file) {
if (file == NULL)
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | base/files/file_util_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698