| 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 88%
|
| rename from webkit/fileapi/file_system_file_util.h
|
| rename to webkit/fileapi/fileapi_file_util.h
|
| index 8a46fbdb6d5974369ce2d8e7b12bc76663879425..630ad25f9636ee1b6a17f4d8cd995a76493d19c1 100644
|
| --- a/webkit/fileapi/file_system_file_util.h
|
| +++ b/webkit/fileapi/fileapi_file_util.h
|
| @@ -2,21 +2,14 @@
|
| // 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_H_
|
| -#define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_
|
| +#ifndef WEBKIT_FILEAPI_FILE_UTIL_H_
|
| +#define WEBKIT_FILEAPI_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 FileApiFileUtil {
|
| public:
|
| - FileSystemFileUtil() {}
|
| - virtual ~FileSystemFileUtil() {}
|
| + FileApiFileUtil() {}
|
| + virtual ~FileApiFileUtil() {}
|
|
|
| // 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.
|
| + // FileApiFileUtil 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 {
|
| @@ -231,12 +224,12 @@ class FileSystemFileUtil {
|
| };
|
|
|
| // Returns a pointer to a new instance of AbstractFileEnumerator which is
|
| - // implemented for each FileUtil subclass. The instance needs to be freed
|
| - // by the caller, and its lifetime should not extend past when the current
|
| - // call returns to the main FILE message loop.
|
| + // implemented for each FileApiFileUtil subclass. The instance needs to be
|
| + // freed by the caller, and its lifetime should not extend past when the
|
| + // current 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,9 +271,9 @@ class FileSystemFileUtil {
|
| const FilePath& dest_file_path,
|
| bool copy);
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil);
|
| + DISALLOW_COPY_AND_ASSIGN(FileApiFileUtil);
|
| };
|
|
|
| } // namespace fileapi
|
|
|
| -#endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_
|
| +#endif // WEBKIT_FILEAPI_FILE_UTIL_H_
|
|
|