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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider.h

Issue 9004019: Cleanup: Removing FileSystemPathManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years 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/sandbox_mount_point_provider.h
diff --git a/webkit/fileapi/sandbox_mount_point_provider.h b/webkit/fileapi/sandbox_mount_point_provider.h
index 11a47737781402f63ff34d8d2af84144d8d0204f..8fa4719f75d683794dab9969731ccca90cbf6fc5 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.h
+++ b/webkit/fileapi/sandbox_mount_point_provider.h
@@ -25,6 +25,7 @@ class QuotaManagerProxy;
namespace fileapi {
+class FileSystemOptions;
class ObfuscatedFileUtil;
// An interface to construct or crack sandboxed filesystem paths for
@@ -36,6 +37,8 @@ class SandboxMountPointProvider
: public FileSystemMountPointProvider,
public FileSystemQuotaUtil {
public:
+ typedef FileSystemMountPointProvider::GetRootPathCallback GetRootPathCallback;
+
// Origin enumerator interface.
// An instance of this interface is assumed to be called on the file thread.
class OriginEnumerator {
@@ -49,51 +52,43 @@ class SandboxMountPointProvider
virtual bool HasFileSystemType(FileSystemType type) const = 0;
};
+ // The legacy [pre-obfuscation] FileSystem directory name, kept around for
+ // migration and migration testing.
+ static const FilePath::CharType kOldFileSystemDirectory[];
+ // The FileSystem directory name.
+ static const FilePath::CharType kNewFileSystemDirectory[];
+ // Where we move the old filesystem directory if migration fails.
+ static const FilePath::CharType kRenamedOldFileSystemDirectory[];
+
SandboxMountPointProvider(
- FileSystemPathManager* path_manager,
scoped_refptr<base::MessageLoopProxy> file_message_loop,
- const FilePath& profile_path);
+ const FilePath& profile_path,
+ FileSystemOptions* file_system_options);
virtual ~SandboxMountPointProvider();
- // Checks if access to |virtual_path| is allowed from |origin_url|.
- virtual bool IsAccessAllowed(const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path) OVERRIDE;
-
- // 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.
+ // FileSystemMountPointProvider overrides.
+ virtual bool IsAccessAllowed(
+ const GURL& origin_url,
+ FileSystemType type,
+ const FilePath& virtual_path) OVERRIDE;
virtual void ValidateFileSystemRootAndGetURL(
const GURL& origin_url,
FileSystemType type,
bool create,
- const FileSystemPathManager::GetRootPathCallback& callback) OVERRIDE;
-
- // Like GetFileSystemRootPath, but synchronous, and can be called only while
- // running on the file thread.
+ const GetRootPathCallback& callback) OVERRIDE;
virtual FilePath ValidateFileSystemRootAndGetPathOnFileThread(
const GURL& origin_url,
FileSystemType type,
const FilePath& unused,
bool create) OVERRIDE;
-
- // The legacy [pre-obfuscation] FileSystem directory name, kept around for
- // migration and migration testing.
- static const FilePath::CharType kOldFileSystemDirectory[];
- // The FileSystem directory name.
- static const FilePath::CharType kNewFileSystemDirectory[];
- // Where we move the old filesystem directory if migration fails.
- static const FilePath::CharType kRenamedOldFileSystemDirectory[];
+ virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
+ virtual std::vector<FilePath> GetRootDirectories() const OVERRIDE;
+ virtual FileSystemFileUtil* GetFileUtil() OVERRIDE;
FilePath old_base_path() const;
FilePath new_base_path() const;
FilePath renamed_old_base_path() const;
- // Checks if a given |name| contains any restricted names/chars in it.
- virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
-
- virtual std::vector<FilePath> GetRootDirectories() const OVERRIDE;
-
// Returns an origin enumerator of this provider.
// This method can only be called on the file thread.
OriginEnumerator* CreateOriginEnumerator() const;
@@ -109,8 +104,6 @@ class SandboxMountPointProvider
FileSystemType type,
bool create) const;
- virtual FileSystemFileUtil* GetFileUtil() OVERRIDE;
-
// Deletes the data on the origin and reports the amount of deleted data
// to the quota manager via |proxy|.
bool DeleteOriginDataOnFileThread(
@@ -158,20 +151,22 @@ class SandboxMountPointProvider
FilePath OldCreateFileSystemRootPath(
const GURL& origin_url, FileSystemType type);
+ // Returns true if the given |url|'s scheme is allowed to access
+ // filesystem.
+ bool IsAllowedScheme(const GURL& url) const;
+
class GetFileSystemRootPathTask;
friend class FileSystemTestOriginHelper;
friend class SandboxMountPointProviderMigrationTest;
friend class SandboxMountPointProviderOriginEnumeratorTest;
- // The path_manager_ isn't owned by this instance; this instance is owned by
- // the path_manager_, and they have the same lifetime.
- FileSystemPathManager* path_manager_;
-
scoped_refptr<base::MessageLoopProxy> file_message_loop_;
const FilePath profile_path_;
+ scoped_ptr<FileSystemOptions> file_system_options_;
+
scoped_refptr<ObfuscatedFileUtil> sandbox_file_util_;
// Acccessed only on the file thread.

Powered by Google App Engine
This is Rietveld 408576698