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

Unified Diff: webkit/fileapi/native_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 on the svn tree. Created 9 years, 3 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
« no previous file with comments | « webkit/fileapi/local_file_util_unittest.cc ('k') | webkit/fileapi/native_file_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/native_file_util.h
diff --git a/webkit/fileapi/native_file_util.h b/webkit/fileapi/native_file_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..5669680638b75a4d58bb68dff14d210ecf3dc581
--- /dev/null
+++ b/webkit/fileapi/native_file_util.h
@@ -0,0 +1,103 @@
+// 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_NATIVE_FILE_UTIL_H_
+#define WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_
+
+#include "base/file_path.h"
+#include "base/file_util_proxy.h"
+#include "base/platform_file.h"
+#include "webkit/fileapi/file_system_file_util.h"
+
+namespace base {
+class Time;
+}
+
+namespace fileapi {
+
+using base::PlatformFile;
+using base::PlatformFileError;
+class FileSystemOperationContext;
+
+// TODO(dmikurube): Add unit tests for NativeFileUtil.
+// This class handles accessing the OS native filesystem.
+class NativeFileUtil : public FileSystemFileUtil {
+ public:
+ NativeFileUtil() {}
+ virtual ~NativeFileUtil() {}
+
+ virtual PlatformFileError CreateOrOpen(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path,
+ int file_flags,
+ PlatformFile* file_handle,
+ bool* created) OVERRIDE;
+ virtual PlatformFileError Close(
+ FileSystemOperationContext* unused,
+ PlatformFile) OVERRIDE;
+ virtual PlatformFileError EnsureFileExists(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path, bool* created) OVERRIDE;
+ virtual PlatformFileError CreateDirectory(
+ FileSystemOperationContext* context,
+ const FilePath& file_path,
+ bool exclusive,
+ bool recursive) OVERRIDE;
+ virtual PlatformFileError GetFileInfo(
+ FileSystemOperationContext* unused,
+ const FilePath& file_,
+ base::PlatformFileInfo* file_info,
+ FilePath* platform_path) OVERRIDE;
+ virtual PlatformFileError ReadDirectory(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path,
+ std::vector<base::FileUtilProxy::Entry>* entries) OVERRIDE;
+ virtual AbstractFileEnumerator* CreateFileEnumerator(
+ FileSystemOperationContext* unused,
+ const FilePath& root_path) OVERRIDE;
+ virtual PlatformFileError GetLocalFilePath(
+ FileSystemOperationContext* unused,
+ const FilePath& virtual_path,
+ FilePath* local_path) OVERRIDE;
+ virtual PlatformFileError Touch(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time) OVERRIDE;
+ virtual PlatformFileError Truncate(
+ FileSystemOperationContext* unused,
+ const FilePath& path,
+ int64 length) OVERRIDE;
+ virtual bool PathExists(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path) OVERRIDE;
+ virtual bool DirectoryExists(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path) OVERRIDE;
+ virtual bool IsDirectoryEmpty(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path) OVERRIDE;
+ virtual PlatformFileError CopyOrMoveFile(
+ FileSystemOperationContext* unused,
+ const FilePath& src_file_path,
+ const FilePath& dest_file_path,
+ bool copy) OVERRIDE;
+ virtual PlatformFileError CopyInForeignFile(
+ FileSystemOperationContext* unused,
+ const FilePath& src_file_path,
+ const FilePath& dest_file_path) OVERRIDE;
+ virtual PlatformFileError DeleteFile(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path) OVERRIDE;
+ virtual PlatformFileError DeleteSingleDirectory(
+ FileSystemOperationContext* unused,
+ const FilePath& file_path) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NativeFileUtil);
+};
+
+} // namespace fileapi
+
+#endif // WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_
« no previous file with comments | « webkit/fileapi/local_file_util_unittest.cc ('k') | webkit/fileapi/native_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698