| 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..bd4f7f352d34a936df8c9c2682faef7110fe84b5
|
| --- /dev/null
|
| +++ b/webkit/fileapi/file_system_file_util_base.h
|
| @@ -0,0 +1,130 @@
|
| +// 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/file_util_proxy.h"
|
| +#include "base/scoped_ptr.h"
|
| +#include "base/singleton.h"
|
| +#include "webkit/fileapi/file_system_operation_context.h"
|
| +
|
| +namespace fileapi {
|
| +
|
| +class FileSystemFileUtilBase {
|
| + public:
|
| + static FileSystemFileUtilBase* GetInstance();
|
| + virtual ~FileSystemFileUtilBase() {}
|
| +
|
| +virtual base::PlatformFileError CreateOrOpen(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& file_path,
|
| + int file_flags,
|
| + base::PlatformFile& file_handle,
|
| + bool& created);
|
| +
|
| +virtual base::PlatformFileError CreateTemporary(
|
| + FileSystemOperationContext* fs_context,
|
| + FilePath& file_path,
|
| + base::PlatformFile& file_handle);
|
| +
|
| +virtual base::PlatformFileError Close(
|
| + FileSystemOperationContext* fs_context,
|
| + base::PlatformFile file_handle);
|
| +
|
| +virtual base::PlatformFileError EnsureFileExists(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& file_path,
|
| + bool* created);
|
| +
|
| +virtual base::PlatformFileError Delete(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& file_path,
|
| + bool recursive);
|
| +
|
| +virtual base::PlatformFileError Copy(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& src_file_path,
|
| + const FilePath& dest_file_path);
|
| +
|
| +virtual base::PlatformFileError Move(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& src_file_path,
|
| + const FilePath& dest_file_path);
|
| +
|
| +virtual base::PlatformFileError CreateDirectory(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& file_path,
|
| + bool exclusive,
|
| + bool recursive);
|
| +
|
| +virtual base::PlatformFileError ReadDirectory(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& file_path,
|
| + std::vector<base::FileUtilProxy::Entry>& entries);
|
| +
|
| +virtual base::PlatformFileError GetFileInfo(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& file_path,
|
| + base::PlatformFileInfo& file_info);
|
| +
|
| +virtual base::PlatformFileError GetFileInfoFromPlatformFile(
|
| + FileSystemOperationContext* fs_context,
|
| + base::PlatformFile file,
|
| + base::PlatformFileInfo& file_info);
|
| +
|
| +virtual base::PlatformFileError Read(
|
| + FileSystemOperationContext* fs_context,
|
| + base::PlatformFile file,
|
| + int64 offset,
|
| + int bytes_to_read,
|
| + int& bytes_read,
|
| + char* buffer);
|
| +
|
| +virtual base::PlatformFileError Write(
|
| + FileSystemOperationContext* fs_context,
|
| + base::PlatformFile file,
|
| + int64 offset,
|
| + int bytes_to_write,
|
| + int& bytes_written,
|
| + char* buffer);
|
| +
|
| +virtual base::PlatformFileError Touch(
|
| + FileSystemOperationContext* fs_context,
|
| + base::PlatformFile file,
|
| + const base::Time& last_access_time,
|
| + const base::Time& last_modified_time);
|
| +
|
| +virtual base::PlatformFileError TouchFilePath(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& file_path,
|
| + const base::Time& last_access_time,
|
| + const base::Time& last_modified_time);
|
| +
|
| +virtual base::PlatformFileError TruncatePlatformFile(
|
| + FileSystemOperationContext* fs_context,
|
| + base::PlatformFile file,
|
| + int64 length);
|
| +
|
| +virtual base::PlatformFileError Truncate(
|
| + FileSystemOperationContext* fs_context,
|
| + const FilePath& path,
|
| + int64 length);
|
| +
|
| +virtual base::PlatformFileError Flush(
|
| + FileSystemOperationContext* fs_context,
|
| + base::PlatformFile file);
|
| +
|
| + protected:
|
| + FileSystemFileUtilBase() {}
|
| +
|
| + private:
|
| + friend struct DefaultSingletonTraits<FileSystemFileUtilBase>;
|
| + DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtilBase);
|
| +};
|
| +
|
| +} // namespace fileapi
|
| +
|
| +#endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_BASE_H_
|
|
|