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

Unified Diff: webkit/fileapi/file_system_file_util_base.h

Issue 6471019: Stackable file_util for FileAPIs. Sample code for discussion. Incomplete. Cannot be compiled. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 10 months 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: webkit/fileapi/file_system_file_util_base.h
diff --git a/webkit/fileapi/file_system_file_util_base.h b/webkit/fileapi/file_system_file_util_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..0591a906d5d2f2e92cad17197788132152612a3d
--- /dev/null
+++ b/webkit/fileapi/file_system_file_util_base.h
@@ -0,0 +1,83 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_BASE_H_
+#define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_BASE_H_
+
+#include "base/file_util.h"
+#include "base/singleton.h"
+
+namespace fileapi {
+
+class FileSystemFileUtilBase {
+ public:
+ static FileSystemFileUtilBase* GetInstance();
+ virtual ~FileSystemFileUtilBase() {}
+
+ virtual int CountFilesCreatedAfter(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& path,
+ const base::Time& file_time);
+
+ virtual int64 ComputeDirectorySize(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& root_path);
+
+ virtual int64 ComputeFilesSize(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& directory,
+ const FilePath::StringType& pattern);
+
+ virtual bool Delete(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& path, bool recursive);
+
+#if defined(OS_WIN)
+ virtual bool DeleteAfterReboot(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& path);
+#endif
+
+ virtual bool Move(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& from_path, const FilePath& to_path);
+
+ virtual bool ReplaceFile(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& from_path, const FilePath& to_path);
+
+ virtual bool CopyFile(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& from_path, const FilePath& to_path);
+
+ virtual bool CopyDirectory(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& from_path, const FilePath& to_path,
+ bool recursive);
+
+ virtual bool PathExists(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& path);
+
+ virtual bool PathIsWritable(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& path);
+
+ virtual bool DirectoryExists(
+ const FileSystemOperationContext& fs_context,
+ const FilePath& path);
+
+ // ...
Dai Mikurube (google.com) 2011/02/10 08:35:12 FYI: Actually, not all functions in file_util are
+
+ protected:
+ FileSystemFileUtilBase() {}
+
+ private:
+ friend struct DefaultSingletonTraits<FileSystemFileUtilBase>;
+ DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtilBase);
+}
+
+} // namespace fileapi
+
+#endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_BASE_H_
« no previous file with comments | « no previous file | webkit/fileapi/file_system_file_util_base.cc » ('j') | webkit/fileapi/file_system_file_util_base.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698