Delete unused methods for replacing the "default filesystem".
Bug: webrtc:6424 Change-Id: I7f76fe71ac395088c3b632e43475933cc13e47cd Reviewed-on: https://webrtc-review.googlesource.com/83725 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23728}
This commit is contained in:
@ -117,17 +117,14 @@ std::string DirectoryIterator::Name() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
FilesystemInterface* Filesystem::default_filesystem_ = nullptr;
|
||||
|
||||
FilesystemInterface* Filesystem::EnsureDefaultFilesystem() {
|
||||
if (!default_filesystem_) {
|
||||
FilesystemInterface* Filesystem::GetFilesystem() {
|
||||
#if defined(WEBRTC_WIN)
|
||||
default_filesystem_ = new Win32Filesystem();
|
||||
static FilesystemInterface* const filesystem = new Win32Filesystem();
|
||||
#else
|
||||
default_filesystem_ = new UnixFilesystem();
|
||||
static FilesystemInterface* const filesystem = new UnixFilesystem();
|
||||
#endif
|
||||
}
|
||||
return default_filesystem_;
|
||||
|
||||
return filesystem;
|
||||
}
|
||||
|
||||
} // namespace rtc
|
||||
|
@ -103,46 +103,28 @@ class FilesystemInterface {
|
||||
|
||||
class Filesystem {
|
||||
public:
|
||||
static FilesystemInterface* default_filesystem() {
|
||||
RTC_DCHECK(default_filesystem_);
|
||||
return default_filesystem_;
|
||||
}
|
||||
|
||||
static void set_default_filesystem(FilesystemInterface* filesystem) {
|
||||
default_filesystem_ = filesystem;
|
||||
}
|
||||
|
||||
static FilesystemInterface* swap_default_filesystem(
|
||||
FilesystemInterface* filesystem) {
|
||||
FilesystemInterface* cur = default_filesystem_;
|
||||
default_filesystem_ = filesystem;
|
||||
return cur;
|
||||
}
|
||||
|
||||
static bool DeleteFile(const Pathname& filename) {
|
||||
return EnsureDefaultFilesystem()->DeleteFile(filename);
|
||||
return GetFilesystem()->DeleteFile(filename);
|
||||
}
|
||||
|
||||
static bool MoveFile(const Pathname& old_path, const Pathname& new_path) {
|
||||
return EnsureDefaultFilesystem()->MoveFile(old_path, new_path);
|
||||
return GetFilesystem()->MoveFile(old_path, new_path);
|
||||
}
|
||||
|
||||
static bool IsFolder(const Pathname& pathname) {
|
||||
return EnsureDefaultFilesystem()->IsFolder(pathname);
|
||||
return GetFilesystem()->IsFolder(pathname);
|
||||
}
|
||||
|
||||
static bool IsFile(const Pathname& pathname) {
|
||||
return EnsureDefaultFilesystem()->IsFile(pathname);
|
||||
return GetFilesystem()->IsFile(pathname);
|
||||
}
|
||||
|
||||
static bool GetFileSize(const Pathname& path, size_t* size) {
|
||||
return EnsureDefaultFilesystem()->GetFileSize(path, size);
|
||||
return GetFilesystem()->GetFileSize(path, size);
|
||||
}
|
||||
|
||||
private:
|
||||
static FilesystemInterface* default_filesystem_;
|
||||
|
||||
static FilesystemInterface* EnsureDefaultFilesystem();
|
||||
static FilesystemInterface* GetFilesystem();
|
||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user