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

Unified Diff: webkit/fileapi/file_system_mount_point_provider.h

Issue 9016020: Cleanup FileSystemOperation for preparing for adding FSO-factory method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 8 years, 11 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/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 7a085324e6e6859b66fa6ee282f0f58b2fbc69ab..f9ac834870f67476e731f2e934e2a190dcd2daf9 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"
tzik 2012/01/10 08:31:13 sort?
kinuko 2012/01/10 09:48:53 Done.
#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;

Powered by Google App Engine
This is Rietveld 408576698