diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 13:17:58 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 13:17:58 +0000 |
commit | 955dd7ebf6808dd93dd1aedc7390e7280e848f80 (patch) | |
tree | 6a9e559583084a956005c367249026647e3879bf /webkit/fileapi/file_system_path_manager.h | |
parent | 0c5e07b0a63a5aea8ab0c2b50177b4c99e7c9538 (diff) | |
download | chromium_src-955dd7ebf6808dd93dd1aedc7390e7280e848f80.zip chromium_src-955dd7ebf6808dd93dd1aedc7390e7280e848f80.tar.gz chromium_src-955dd7ebf6808dd93dd1aedc7390e7280e848f80.tar.bz2 |
Add 1st cut of FileSystemUsageTracker that tracks the usage changes in FileSystem API.
For now it has no meaningful implementation yet; mostly just for
defining a few interfaces.
BUG=
TEST=FileSystemUsageTrackerTest.DummyTest
Review URL: http://codereview.chromium.org/6426001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_path_manager.h')
-rw-r--r-- | webkit/fileapi/file_system_path_manager.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/webkit/fileapi/file_system_path_manager.h b/webkit/fileapi/file_system_path_manager.h index 16c7182..f7a3803 100644 --- a/webkit/fileapi/file_system_path_manager.h +++ b/webkit/fileapi/file_system_path_manager.h @@ -5,8 +5,6 @@ #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ #define WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ -#include <map> - #include "base/callback.h" #include "base/file_path.h" #include "base/scoped_ptr.h" @@ -20,6 +18,12 @@ class MessageLoopProxy; namespace fileapi { +// An interface to construct or crack sandboxed filesystem paths. +// Currently each sandboxed filesystem path looks like: +// +// <profile_dir>/FileSystem/<origin_identifier>/<type>/chrome-<unique>/... +// +// where <type> is either one of "Temporary" or "Persistent". class FileSystemPathManager { public: FileSystemPathManager(scoped_refptr<base::MessageLoopProxy> file_message_loop, @@ -74,9 +78,25 @@ 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); + // Returns the storage identifier string for the given |url|. static std::string GetStorageIdentifierFromURL(const GURL& url); + // Gets a base directory path of the sandboxed filesystem that is + // specified by |origin_url| 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. + // Returned directory path does not contain 'unique' part, therefore + // it is not an actural root path for the filesystem. + static FilePath GetFileSystemBaseDirectoryForOriginAndType( + const FilePath& base_path, + const GURL& origin_url, + fileapi::FileSystemType type); + private: class GetFileSystemRootPathTask; |