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

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: Reflected the comments. Created 9 years, 4 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/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..447e982edeb670d146cf76e11f6d67ea53469264
--- /dev/null
+++ b/webkit/fileapi/native_file_util.h
@@ -0,0 +1,119 @@
+// 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 to the OS native filesystem.
kinuko 2011/08/29 07:20:00 nit: 'access to the OS' or 'accessing the OS'?
Dai Mikurube (NOT FULLTIME) 2011/08/30 07:47:28 Done.
+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;
+
kinuko 2011/08/29 07:20:00 ditto about empty lines. Thanks!
Dai Mikurube (NOT FULLTIME) 2011/08/30 07:47:28 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698