Delete unused method FilesystemInterface::GetFileTime.
BUG=webrtc:6424
Review-Url: https://codereview.webrtc.org/2926713007
Cr-Commit-Position: refs/heads/master@{#18564}
diff --git a/webrtc/base/fileutils.h b/webrtc/base/fileutils.h
index 9f53ac3..00b4d8d 100644
--- a/webrtc/base/fileutils.h
+++ b/webrtc/base/fileutils.h
@@ -74,8 +74,6 @@
#endif
};
-enum FileTimeType { FTT_CREATED, FTT_MODIFIED, FTT_ACCESSED };
-
class FilesystemInterface {
public:
virtual ~FilesystemInterface() {}
@@ -114,10 +112,6 @@
// Determines the size of the file indicated by path.
virtual bool GetFileSize(const Pathname& path, size_t* size) = 0;
-
- // Determines a timestamp associated with the file indicated by path.
- virtual bool GetFileTime(const Pathname& path, FileTimeType which,
- time_t* time) = 0;
};
class Filesystem {
@@ -176,11 +170,6 @@
return EnsureDefaultFilesystem()->GetFileSize(path, size);
}
- static bool GetFileTime(const Pathname& path, FileTimeType which,
- time_t* time) {
- return EnsureDefaultFilesystem()->GetFileTime(path, which, time);
- }
-
private:
static FilesystemInterface* default_filesystem_;
diff --git a/webrtc/base/unixfilesystem.cc b/webrtc/base/unixfilesystem.cc
index d106bbd..4901412 100644
--- a/webrtc/base/unixfilesystem.cc
+++ b/webrtc/base/unixfilesystem.cc
@@ -218,27 +218,6 @@
return true;
}
-bool UnixFilesystem::GetFileTime(const Pathname& path, FileTimeType which,
- time_t* time) {
- struct stat st;
- if (::stat(path.pathname().c_str(), &st) != 0)
- return false;
- switch (which) {
- case FTT_CREATED:
- *time = st.st_ctime;
- break;
- case FTT_MODIFIED:
- *time = st.st_mtime;
- break;
- case FTT_ACCESSED:
- *time = st.st_atime;
- break;
- default:
- return false;
- }
- return true;
-}
-
char* UnixFilesystem::CopyString(const std::string& str) {
size_t size = str.length() + 1;
diff --git a/webrtc/base/unixfilesystem.h b/webrtc/base/unixfilesystem.h
index 457cbca..742f4c2 100644
--- a/webrtc/base/unixfilesystem.h
+++ b/webrtc/base/unixfilesystem.h
@@ -72,9 +72,6 @@
const std::string* append) override;
bool GetFileSize(const Pathname& path, size_t* size) override;
- bool GetFileTime(const Pathname& path,
- FileTimeType which,
- time_t* time) override;
private:
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
diff --git a/webrtc/base/win32filesystem.cc b/webrtc/base/win32filesystem.cc
index faca8e9..5445140 100644
--- a/webrtc/base/win32filesystem.cc
+++ b/webrtc/base/win32filesystem.cc
@@ -152,26 +152,4 @@
return true;
}
-bool Win32Filesystem::GetFileTime(const Pathname& path, FileTimeType which,
- time_t* time) {
- WIN32_FILE_ATTRIBUTE_DATA data = {0};
- if (::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(),
- GetFileExInfoStandard, &data) == 0)
- return false;
- switch (which) {
- case FTT_CREATED:
- FileTimeToUnixTime(data.ftCreationTime, time);
- break;
- case FTT_MODIFIED:
- FileTimeToUnixTime(data.ftLastWriteTime, time);
- break;
- case FTT_ACCESSED:
- FileTimeToUnixTime(data.ftLastAccessTime, time);
- break;
- default:
- return false;
- }
- return true;
-}
-
} // namespace rtc
diff --git a/webrtc/base/win32filesystem.h b/webrtc/base/win32filesystem.h
index 1a52d62..566cbaf 100644
--- a/webrtc/base/win32filesystem.h
+++ b/webrtc/base/win32filesystem.h
@@ -51,9 +51,6 @@
const std::string& prefix) override;
bool GetFileSize(const Pathname& path, size_t* size) override;
- bool GetFileTime(const Pathname& path,
- FileTimeType which,
- time_t* time) override;
// A folder appropriate for storing temporary files (Contents are
// automatically deleted when the program exists)