| Index: webkit/fileapi/file_system_mount_point_provider.h
|
| diff --git a/webkit/fileapi/file_system_mount_point_provider.h b/webkit/fileapi/file_system_mount_point_provider.h
|
| index bad916cf67637c399596bab1ecaa9f82202028a8..7d9974c1d635f7a278070db9eece59f6af7bf5ad 100644
|
| --- a/webkit/fileapi/file_system_mount_point_provider.h
|
| +++ b/webkit/fileapi/file_system_mount_point_provider.h
|
| @@ -9,6 +9,7 @@
|
| #include <vector>
|
|
|
| #include "base/callback_forward.h"
|
| +#include "base/platform_file.h"
|
| #include "base/file_path.h"
|
| #include "webkit/fileapi/file_system_types.h"
|
|
|
| @@ -22,40 +23,37 @@ class FileSystemFileUtil;
|
| // and specialized FileSystemFileUtil instance.
|
| class FileSystemMountPointProvider {
|
| public:
|
| - // Callback for GetFileSystemRootPath.
|
| - // If the request is accepted and the root filesystem for the origin exists
|
| - // the callback is called with success=true and valid root_path and name.
|
| - // If the request is accepted, |create| is specified for
|
| - // GetFileSystemRootPath, and the root directory does not exist, it creates
|
| - // a new one and calls back with success=true if the creation has succeeded.
|
| - typedef base::Callback<void(bool /* success */,
|
| - const FilePath& /* root_path */,
|
| - const std::string& /* name */)>
|
| - GetRootPathCallback;
|
| + // Callback for ValidateFileSystemRoot.
|
| + typedef base::Callback<void(base::PlatformFileError error)>
|
| + ValidateFileSystemCallback;
|
| virtual ~FileSystemMountPointProvider() {}
|
|
|
| - // Checks if access to |virtual_path| is allowed from |origin_url|.
|
| - virtual bool IsAccessAllowed(const GURL& origin_url,
|
| - FileSystemType type,
|
| - const FilePath& virtual_path) = 0;
|
| -
|
| - // Retrieves the root path for the given |origin_url| and |type|, and
|
| - // calls the given |callback| with the root path and name.
|
| - // If |create| is true this also creates the directory if it doesn't exist.
|
| - virtual void ValidateFileSystemRootAndGetURL(
|
| + // Validates the filesystem for the given |origin_url| and |type|.
|
| + // This verifies if it is allowed to request (or create) the filesystem
|
| + // and if it can access (or create) the root directory of the mount point.
|
| + // If |create| is true this may also create the root directory for
|
| + // the filesystem if it doesn't exist.
|
| + virtual void ValidateFileSystemRoot(
|
| const GURL& origin_url,
|
| FileSystemType type,
|
| bool create,
|
| - const GetRootPathCallback& callback) = 0;
|
| + const ValidateFileSystemCallback& callback) = 0;
|
|
|
| - // Like GetFileSystemRootPath, but synchronous, and can be called only while
|
| - // running on the file thread.
|
| - virtual FilePath ValidateFileSystemRootAndGetPathOnFileThread(
|
| + // Retrieves the root path of the filesystem specified by the given
|
| + // |origin_url| and |type| on the file thread.
|
| + // If |create| is true this may also create the root directory for
|
| + // the filesystem if it doesn't exist.
|
| + virtual FilePath GetFileSystemRootPathOnFileThread(
|
| const GURL& origin_url,
|
| FileSystemType type,
|
| const FilePath& virtual_path,
|
| bool create) = 0;
|
|
|
| + // Checks if access to |virtual_path| is allowed from |origin_url|.
|
| + virtual bool IsAccessAllowed(const GURL& origin_url,
|
| + FileSystemType type,
|
| + const FilePath& virtual_path) = 0;
|
| +
|
| // Checks if a given |name| contains any restricted names/chars in it.
|
| // Callable on any thread.
|
| virtual bool IsRestrictedFileName(const FilePath& filename) const = 0;
|
|
|