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

Unified Diff: webkit/fileapi/file_system_path_manager.h

Issue 6426001: Add 1st cut of FileSystemUsageTracker that tracks the usage changes in FileSystem API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix for win Created 9 years, 10 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
« no previous file with comments | « no previous file | webkit/fileapi/file_system_path_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_path_manager.h
diff --git a/webkit/fileapi/file_system_path_manager.h b/webkit/fileapi/file_system_path_manager.h
index 16c71822105d341c1fca7815f4179800b13836ba..f7a38033743416f211b8615be852590b4d2348a6 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;
« no previous file with comments | « no previous file | webkit/fileapi/file_system_path_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698