summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_path_manager.h
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 07:24:48 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 07:24:48 +0000
commitb4bbe9ad1ec0320b73e0914a6fc24ac514b30844 (patch)
tree44fe4361486ef35c5e538228a4762a2cf764a602 /webkit/fileapi/file_system_path_manager.h
parentcf1d3ee8cef29833d62a149b721dd31ff7cd17f2 (diff)
downloadchromium_src-b4bbe9ad1ec0320b73e0914a6fc24ac514b30844.zip
chromium_src-b4bbe9ad1ec0320b73e0914a6fc24ac514b30844.tar.gz
chromium_src-b4bbe9ad1ec0320b73e0914a6fc24ac514b30844.tar.bz2
Make more methods of FileSystemPathManager static and portable.
Changes: - Renamed StorageIdentifier to OriginIdentifier to better reflect its meaning. - Changed a few methods to take string origin identifier but not origin URL as its parameter, since in some cases it seems to be more convenient just to use the identifier string (which can be easily extracted from the path) than to call WebKit method to convert back the identifier to GURL. BUG=none TEST=FileSystemPathManagerTest.* Review URL: http://codereview.chromium.org/6483017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_path_manager.h')
-rw-r--r--webkit/fileapi/file_system_path_manager.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/webkit/fileapi/file_system_path_manager.h b/webkit/fileapi/file_system_path_manager.h
index f7a3803..be9ceff 100644
--- a/webkit/fileapi/file_system_path_manager.h
+++ b/webkit/fileapi/file_system_path_manager.h
@@ -23,7 +23,7 @@ namespace fileapi {
//
// <profile_dir>/FileSystem/<origin_identifier>/<type>/chrome-<unique>/...
//
-// where <type> is either one of "Temporary" or "Persistent".
+// <type> is either one of "Temporary" or "Persistent".
class FileSystemPathManager {
public:
FileSystemPathManager(scoped_refptr<base::MessageLoopProxy> file_message_loop,
@@ -51,19 +51,14 @@ class FileSystemPathManager {
GetRootPathCallback* callback);
// Cracks the given |path|, retrieves the information embedded in the path
- // and populates |origin_url| and |type|. Also it populates |virtual_path|
- // that is a sandboxed path in the file system, i.e. the relative path to
- // the file system's root path for the given origin and type.
- // It returns false if the path does not conform to the expected
- // filesystem path format.
+ // and populates |origin_url|, |type| and |virtual_path|. The |virtual_path|
+ // is a sandboxed path in the file system, i.e. the relative path to the
+ // filesystem root for the given domain and type.
bool CrackFileSystemPath(const FilePath& path,
GURL* origin_url,
FileSystemType* type,
FilePath* virtual_path) const;
- // Checks if a given |name| contains any restricted names/chars in it.
- bool IsRestrictedFileName(const FilePath& filename) const;
-
// Returns true if the given |url|'s scheme is allowed to access
// filesystem.
bool IsAllowedScheme(const GURL& url) const;
@@ -78,15 +73,19 @@ class FileSystemPathManager {
return base_path_;
}
- // Returns the filesystem name string for the given |origin_url| and |type|.
- static std::string GetFileSystemName(const GURL& url,
- fileapi::FileSystemType type);
+ // Checks if a given |name| contains any restricted names/chars in it.
+ static bool IsRestrictedFileName(const FilePath& filename);
+
+ // Returns the string for the given |type|.
+ // Returns an empty string if the |type| is invalid.
+ static std::string GetFileSystemTypeString(fileapi::FileSystemType type);
- // Returns the storage identifier string for the given |url|.
- static std::string GetStorageIdentifierFromURL(const GURL& url);
+ // Returns the origin identifier string, which is used as a part of the
+ // sandboxed path component, for the given |url|.
+ static std::string GetOriginIdentifierFromURL(const GURL& url);
// Gets a base directory path of the sandboxed filesystem that is
- // specified by |origin_url| and |type|.
+ // specified by |origin_identifier| and |type|.
// |base_path| must be pointing the FileSystem's data directory
// under the profile directory, i.e. <profile_dir>/kFileSystemDirectory.
// Returns an empty path if any of the given parameters are invalid.
@@ -94,7 +93,7 @@ class FileSystemPathManager {
// it is not an actural root path for the filesystem.
static FilePath GetFileSystemBaseDirectoryForOriginAndType(
const FilePath& base_path,
- const GURL& origin_url,
+ const std::string& origin_identifier,
fileapi::FileSystemType type);
private: