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

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. 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/native_file_util.h
diff --git a/webkit/fileapi/local_file_system_file_util.h b/webkit/fileapi/native_file_util.h
similarity index 50%
copy from webkit/fileapi/local_file_system_file_util.h
copy to webkit/fileapi/native_file_util.h
index 314895e4e7c3a1df757b4a4ed2c223cf0bd0c855..d4acff348cf6b5f82a424b6d9dd341755b84138f 100644
--- a/webkit/fileapi/local_file_system_file_util.h
+++ b/webkit/fileapi/native_file_util.h
@@ -2,70 +2,57 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_
-#define WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_
+#ifndef WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_
+#define WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_
-#include <vector>
-
-#include "base/callback.h"
#include "base/file_path.h"
-#include "base/file_util.h"
#include "base/file_util_proxy.h"
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/platform_file.h"
-#include "webkit/fileapi/file_system_file_util.h"
-#include "webkit/fileapi/file_system_types.h"
+#include "webkit/fileapi/fileapi_file_util.h"
namespace base {
-struct PlatformFileInfo;
-class MessageLoopProxy;
class Time;
}
-class GURL;
-
namespace fileapi {
using base::PlatformFile;
using base::PlatformFileError;
-
class FileSystemOperationContext;
-// An instance of this class is created and owned by *MountPointProvider.
-class LocalFileSystemFileUtil : public FileSystemFileUtil {
+class NativeFileUtil : public FileUtil {
ericu 2011/08/03 22:59:26 This needs a class comment that says what this par
Dai Mikurube (NOT FULLTIME) 2011/08/04 03:54:48 Done.
public:
- // |underlying_file_util| is owned by the instance. It will be deleted by
- // the owner instance. For example, it can be instanciated as follows:
- // FileSystemFileUtil* file_system_file_util =
- // new LocalFileSystemFileUtil(new FileSystemFileUtil());
- explicit LocalFileSystemFileUtil(FileSystemFileUtil* underlying_file_util);
- virtual ~LocalFileSystemFileUtil();
+ NativeFileUtil() {}
+ virtual ~NativeFileUtil() {}
virtual PlatformFileError CreateOrOpen(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path,
int file_flags,
PlatformFile* file_handle,
bool* created);
+ virtual PlatformFileError Close(
+ FileSystemOperationContext* unused,
+ PlatformFile);
+
virtual PlatformFileError EnsureFileExists(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path, bool* created);
ericu 2011/08/03 22:59:26 Please add OVERRIDE tags on all overridden methods
Dai Mikurube (NOT FULLTIME) 2011/08/04 03:54:48 Done.
virtual PlatformFileError GetLocalFilePath(
- FileSystemOperationContext* context,
- const FilePath& virtual_file,
+ FileSystemOperationContext* unused,
+ const FilePath& virtual_path,
FilePath* local_path);
virtual PlatformFileError GetFileInfo(
- FileSystemOperationContext* context,
- const FilePath& file,
+ FileSystemOperationContext* unused,
+ const FilePath& file_,
base::PlatformFileInfo* file_info,
- FilePath* platform_file);
+ FilePath* platform_path);
virtual PlatformFileError ReadDirectory(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path,
std::vector<base::FileUtilProxy::Entry>* entries);
@@ -76,65 +63,55 @@ class LocalFileSystemFileUtil : public FileSystemFileUtil {
bool recursive);
virtual PlatformFileError CopyOrMoveFile(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& src_file_path,
const FilePath& dest_file_path,
bool copy);
virtual PlatformFileError CopyInForeignFile(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& src_file_path,
const FilePath& dest_file_path);
virtual PlatformFileError DeleteFile(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path);
virtual PlatformFileError DeleteSingleDirectory(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path);
virtual PlatformFileError Touch(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path,
const base::Time& last_access_time,
const base::Time& last_modified_time);
virtual PlatformFileError Truncate(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& path,
int64 length);
virtual bool PathExists(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path);
virtual bool DirectoryExists(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path);
virtual bool IsDirectoryEmpty(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& file_path);
virtual AbstractFileEnumerator* CreateFileEnumerator(
- FileSystemOperationContext* context,
+ FileSystemOperationContext* unused,
const FilePath& root_path);
private:
- // Given the filesystem's root URL and a virtual path, produces a real, full
- // local path.
- FilePath GetLocalPath(
- FileSystemOperationContext* context,
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path);
-
- scoped_ptr<FileSystemFileUtil> underlying_file_util_;
-
- DISALLOW_COPY_AND_ASSIGN(LocalFileSystemFileUtil);
+ DISALLOW_COPY_AND_ASSIGN(NativeFileUtil);
};
} // namespace fileapi
-#endif // WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_
+#endif // WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698