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

Unified Diff: webkit/fileapi/fileapi_file_util.h

Issue 7470037: [Refactor] to rename and re-layer the file_util stack layers. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased. Created 9 years, 5 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/fileapi_file_util.h
diff --git a/webkit/fileapi/file_system_file_util.h b/webkit/fileapi/fileapi_file_util.h
similarity index 91%
rename from webkit/fileapi/file_system_file_util.h
rename to webkit/fileapi/fileapi_file_util.h
index 8a46fbdb6d5974369ce2d8e7b12bc76663879425..3e6cca13cfef83300cad100bea0c36da872679fc 100644
--- a/webkit/fileapi/file_system_file_util.h
+++ b/webkit/fileapi/fileapi_file_util.h
@@ -5,18 +5,11 @@
#ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_
#define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_
-#include "base/callback.h"
#include "base/file_path.h"
-#include "base/file_util.h"
#include "base/file_util_proxy.h"
-#include "base/memory/ref_counted.h"
#include "base/platform_file.h"
-#include "base/tracked_objects.h"
-#include "webkit/fileapi/file_system_types.h"
namespace base {
-struct PlatformFileInfo;
-class MessageLoopProxy;
class Time;
}
@@ -44,10 +37,10 @@ class FileSystemOperationContext;
// meta logic by using other virtual methods.
// (*2) All non-virtual methods: Copy, Move, Delete, DeleteDirectoryRecursive,
// PerformCommonCheckAndPreparationForMoveAndCopy and CopyOrMoveDirectory.
-class FileSystemFileUtil {
+class FileUtil {
ericu 2011/08/03 22:59:26 It's a bit odd to call the file fileapi_file_util.
Dai Mikurube (NOT FULLTIME) 2011/08/04 03:54:48 Agreed. Renaming it to FileApiFileUtil.
public:
- FileSystemFileUtil() {}
- virtual ~FileSystemFileUtil() {}
+ FileUtil() {}
+ virtual ~FileUtil() {}
// Creates or opens a file with the given flags. It is invalid to pass NULL
// for the callback.
@@ -59,12 +52,12 @@ class FileSystemFileUtil {
const FilePath& file_path,
int file_flags,
PlatformFile* file_handle,
- bool* created);
+ bool* created) = 0;
// Close the given file handle.
virtual PlatformFileError Close(
FileSystemOperationContext* context,
- PlatformFile);
+ PlatformFile) = 0;
// Ensures that the given |file_path| exist. This creates a empty new file
// at |file_path| if the |file_path| does not exist.
@@ -77,7 +70,7 @@ class FileSystemFileUtil {
// reasons, |created| is set false and |error code| indicates the error.
virtual PlatformFileError EnsureFileExists(
FileSystemOperationContext* context,
- const FilePath& file_path, bool* created);
+ const FilePath& file_path, bool* created) = 0;
// Maps |virtual_path| given |context| into |local_path| which represents
// physical file location on the host OS. This may not always make sense for
@@ -85,7 +78,7 @@ class FileSystemFileUtil {
virtual PlatformFileError GetLocalFilePath(
FileSystemOperationContext* context,
const FilePath& virtual_path,
- FilePath* local_path);
+ FilePath* local_path) = 0;
// Retrieves the information about a file. It is invalid to pass NULL for the
// callback.
@@ -93,13 +86,13 @@ class FileSystemFileUtil {
FileSystemOperationContext* context,
const FilePath& file_,
base::PlatformFileInfo* file_info,
- FilePath* platform_path);
+ FilePath* platform_path) = 0;
// Reads the filenames in |file_path|.
virtual PlatformFileError ReadDirectory(
FileSystemOperationContext* context,
const FilePath& file_path,
- std::vector<base::FileUtilProxy::Entry>* entries);
+ std::vector<base::FileUtilProxy::Entry>* entries) = 0;
// Creates directory at given path. It's an error to create
// if |exclusive| is true and dir already exists.
@@ -107,22 +100,22 @@ class FileSystemFileUtil {
FileSystemOperationContext* context,
const FilePath& file_path,
bool exclusive,
- bool recursive);
+ bool recursive) = 0;
// Copies or moves a single file.
virtual PlatformFileError CopyOrMoveFile(
FileSystemOperationContext* context,
const FilePath& src_file_path,
const FilePath& dest_file_path,
- bool copy);
+ bool copy) = 0;
// Copies in a single file from a different filesystem. The src_file_path is
- // a true local platform path, regardless of which subclass of
- // FileSystemFileUtil is being invoked.
+ // a true local platform path, regardless of which subclass of FileUtil is
+ // being invoked.
virtual PlatformFileError CopyInForeignFile(
FileSystemOperationContext* context,
const FilePath& src_file_path,
- const FilePath& dest_file_path);
+ const FilePath& dest_file_path) = 0;
// Copies a file or a directory from |src_file_path| to |dest_file_path|.
//
@@ -176,7 +169,7 @@ class FileSystemFileUtil {
// non-virtual).
virtual PlatformFileError DeleteFile(
FileSystemOperationContext* unused,
- const FilePath& file_path);
+ const FilePath& file_path) = 0;
// Deletes a single empty directory.
// It assumes the given path points an empty directory.
@@ -185,14 +178,14 @@ class FileSystemFileUtil {
// non-virtual).
virtual PlatformFileError DeleteSingleDirectory(
FileSystemOperationContext* unused,
- const FilePath& file_path);
+ const FilePath& file_path) = 0;
// Touches a file. The callback can be NULL.
virtual PlatformFileError Touch(
FileSystemOperationContext* context,
const FilePath& file_path,
const base::Time& last_access_time,
- const base::Time& last_modified_time);
+ const base::Time& last_modified_time) = 0;
// Truncates a file to the given length. If |length| is greater than the
// current length of the file, the file will be extended with zeroes.
@@ -200,19 +193,19 @@ class FileSystemFileUtil {
virtual PlatformFileError Truncate(
FileSystemOperationContext* context,
const FilePath& path,
- int64 length);
+ int64 length) = 0;
virtual bool PathExists(
FileSystemOperationContext* unused,
- const FilePath& file_path);
+ const FilePath& file_path) = 0;
virtual bool DirectoryExists(
FileSystemOperationContext* unused,
- const FilePath& file_path);
+ const FilePath& file_path) = 0;
virtual bool IsDirectoryEmpty(
FileSystemOperationContext* unused,
- const FilePath& file_path);
+ const FilePath& file_path) = 0;
// It will be implemented by each subclass such as FileSystemFileEnumerator.
class AbstractFileEnumerator {
@@ -236,7 +229,7 @@ class FileSystemFileUtil {
// call returns to the main FILE message loop.
virtual AbstractFileEnumerator* CreateFileEnumerator(
FileSystemOperationContext* unused,
- const FilePath& root_path);
+ const FilePath& root_path) = 0;
protected:
// Deletes a directory and all entries under the directory.
@@ -278,7 +271,7 @@ class FileSystemFileUtil {
const FilePath& dest_file_path,
bool copy);
- DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil);
+ DISALLOW_COPY_AND_ASSIGN(FileUtil);
};
} // namespace fileapi

Powered by Google App Engine
This is Rietveld 408576698