summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/obfuscated_file_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/fileapi/obfuscated_file_util.h')
-rw-r--r--webkit/fileapi/obfuscated_file_util.h83
1 files changed, 43 insertions, 40 deletions
diff --git a/webkit/fileapi/obfuscated_file_util.h b/webkit/fileapi/obfuscated_file_util.h
index aaef51f..be9fb85 100644
--- a/webkit/fileapi/obfuscated_file_util.h
+++ b/webkit/fileapi/obfuscated_file_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -17,6 +17,7 @@
#include "webkit/fileapi/file_system_directory_database.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_origin_database.h"
+#include "webkit/fileapi/file_system_path.h"
#include "webkit/fileapi/file_system_types.h"
namespace base {
@@ -68,82 +69,82 @@ class ObfuscatedFileUtil : public FileSystemFileUtil,
virtual base::PlatformFileError CreateOrOpen(
FileSystemOperationContext* context,
- const FilePath& file_path,
+ const FileSystemPath& path,
int file_flags,
base::PlatformFile* file_handle,
bool* created) OVERRIDE;
virtual base::PlatformFileError EnsureFileExists(
FileSystemOperationContext* context,
- const FilePath& file_path, bool* created) OVERRIDE;
+ const FileSystemPath& path, bool* created) OVERRIDE;
virtual base::PlatformFileError CreateDirectory(
FileSystemOperationContext* context,
- const FilePath& file_path,
+ const FileSystemPath& path,
bool exclusive,
bool recursive) OVERRIDE;
virtual base::PlatformFileError GetFileInfo(
FileSystemOperationContext* context,
- const FilePath& file,
+ const FileSystemPath& path,
base::PlatformFileInfo* file_info,
FilePath* platform_file) OVERRIDE;
virtual base::PlatformFileError ReadDirectory(
FileSystemOperationContext* context,
- const FilePath& file_path,
+ const FileSystemPath& path,
std::vector<base::FileUtilProxy::Entry>* entries) OVERRIDE;
virtual AbstractFileEnumerator* CreateFileEnumerator(
FileSystemOperationContext* context,
- const FilePath& root_path) OVERRIDE;
+ const FileSystemPath& root_path) OVERRIDE;
virtual base::PlatformFileError GetLocalFilePath(
FileSystemOperationContext* context,
- const FilePath& virtual_file,
- FilePath* local_path) OVERRIDE;
+ const FileSystemPath& file_system_path,
+ FilePath* local_file_path) OVERRIDE;
virtual base::PlatformFileError Touch(
FileSystemOperationContext* context,
- const FilePath& file_path,
+ const FileSystemPath& path,
const base::Time& last_access_time,
const base::Time& last_modified_time) OVERRIDE;
virtual base::PlatformFileError Truncate(
FileSystemOperationContext* context,
- const FilePath& path,
+ const FileSystemPath& path,
int64 length) OVERRIDE;
virtual bool PathExists(
FileSystemOperationContext* context,
- const FilePath& file_path) OVERRIDE;
+ const FileSystemPath& path) OVERRIDE;
virtual bool DirectoryExists(
FileSystemOperationContext* context,
- const FilePath& file_path) OVERRIDE;
+ const FileSystemPath& path) OVERRIDE;
virtual bool IsDirectoryEmpty(
FileSystemOperationContext* context,
- const FilePath& file_path) OVERRIDE;
+ const FileSystemPath& path) OVERRIDE;
virtual base::PlatformFileError CopyOrMoveFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
- const FilePath& dest_file_path,
+ const FileSystemPath& src_path,
+ const FileSystemPath& dest_path,
bool copy) OVERRIDE;
virtual PlatformFileError CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
- const FilePath& dest_file_path) OVERRIDE;
+ const FileSystemPath& underlying_src_path,
+ const FileSystemPath& dest_path) OVERRIDE;
virtual base::PlatformFileError DeleteFile(
FileSystemOperationContext* context,
- const FilePath& file_path) OVERRIDE;
+ const FileSystemPath& path) OVERRIDE;
virtual base::PlatformFileError DeleteSingleDirectory(
FileSystemOperationContext* context,
- const FilePath& file_path) OVERRIDE;
+ const FileSystemPath& path) OVERRIDE;
// Gets the topmost directory specific to this origin and type. This will
// contain both the directory database's files and all the backing file
@@ -196,46 +197,48 @@ class ObfuscatedFileUtil : public FileSystemFileUtil,
base::PlatformFileError GetFileInfoInternal(
FileSystemDirectoryDatabase* db,
FileSystemOperationContext* context,
+ const GURL& origin,
+ FileSystemType type,
FileId file_id,
FileInfo* local_info,
base::PlatformFileInfo* file_info,
FilePath* platform_file_path);
// Creates a new file, both the underlying backing file and the entry in the
- // database. file_info is an in-out parameter. Supply the name and
+ // database. |dest_file_info| is an in-out parameter. Supply the name and
// parent_id; data_path is ignored. On success, data_path will
// always be set to the relative path [from the root of the type-specific
// filesystem directory] of a NEW backing file, and handle, if supplied, will
// hold open PlatformFile for the backing file, which the caller is
- // responsible for closing. If you supply a path in source_path, it will be
+ // responsible for closing. If you supply a path in |source_path|, it will be
// used as a source from which to COPY data.
// Caveat: do not supply handle if you're also supplying a data path. It was
// easier not to support this, and no code has needed it so far, so it will
// DCHECK and handle will hold base::kInvalidPlatformFileValue.
base::PlatformFileError CreateFile(
FileSystemOperationContext* context,
- const GURL& origin_url, FileSystemType type,
- const FilePath& source_path, FileInfo* file_info,
- int file_flags, base::PlatformFile* handle);
-
- // Given the filesystem's root URL and a virtual path, produces a real, full
- // local path to the underlying data file. This does a database lookup, and
- // verifies that the file exists.
- FilePath GetLocalPath(
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path);
+ const FileSystemPath& source_path,
+ const GURL& dest_origin,
+ FileSystemType dest_type,
+ FileInfo* dest_file_info,
+ int file_flags,
+ base::PlatformFile* handle);
+
+ // Given a virtual path, produces a real, full local path to the
+ // underlying data file. This does a database lookup (by
+ // calling DataPathToLocalPath()), and verifies that the file exists.
+ FileSystemPath GetLocalPath(const FileSystemPath& virtual_path);
// This converts from a relative path [as is stored in the FileInfo.data_path
- // field] to an absolute local path that can be given to the operating system.
- // It does no checks as to whether the file actually exists; it's pure path
- // manipulation.
- FilePath DataPathToLocalPath(
- const GURL& origin, FileSystemType type, const FilePath& data_path);
+ // field] to an absolute local path that can be given to the underlying
+ // filesystem (as of now the returned path is assumed to be a platform path).
+ FileSystemPath DataPathToLocalPath(
+ const GURL& origin,
+ FileSystemType type,
+ const FilePath& data_file_path);
// This does the reverse of DataPathToLocalPath.
- FilePath LocalPathToDataPath(
- const GURL& origin, FileSystemType type, const FilePath& local_path);
+ FilePath LocalPathToDataPath(const FileSystemPath& local_path);
// This returns NULL if |create| flag is false and a filesystem does not
// exist for the given |origin_url| and |type|.