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

Unified Diff: webkit/fileapi/file_system_url.h

Issue 10823273: Integrate external mount points to IsolatedContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove too strict DCHECK Created 8 years, 4 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 | « webkit/fileapi/file_system_types.h ('k') | webkit/fileapi/file_system_url.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_url.h
diff --git a/webkit/fileapi/file_system_url.h b/webkit/fileapi/file_system_url.h
index 1d1d57956b957e1f01e369be7f39f3cbb8049c04..238965fe54fa287d86bad069809f38b29b1bd6a1 100644
--- a/webkit/fileapi/file_system_url.h
+++ b/webkit/fileapi/file_system_url.h
@@ -17,6 +17,31 @@ namespace fileapi {
// A class representing a filesystem URL which consists of origin URL,
// type and an internal path used inside the filesystem.
+//
+// When a FileSystemURL instance is created for regular sandbox file systems
+// each accessor method would return following values:
+//
+// Example: For a URL 'filesystem:http://foo.com/temporary/foo/bar':
+// origin() returns 'http://foo.com',
+// type() returns kFileSystemTypeTemporary,
+// path() and virtual_path() return 'foo/bar', and
+// filesystem_id() returns an empty string.
+//
+// path() and virtual_path() usually return the same value, but they
+// have different values if an instance is created for Isolated or External
+// FileSystem URL, for which we may mount different paths from its exposed
+// virtual paths.
+//
+// Example: Assume a path '/media/removable' is mounted at mount name
+// 'mount_name' with type kFileSystemTypeFoo as an external file system.
+// For a URL 'filesystem:http://bar.com/external/mount_name/foo/bar':
+// origin() returns 'http://bar.com',
+// type() returns the kFileSystemTypeFoo,
+// path() returns '/media/removable/foo/bar',
+// virtual_path() returns 'mount_name/foo/bar',
+// filesystem_id() returns 'mount_name', and
+// mount_type() returns kFileSystemMountTypeExternal.
+//
class FILEAPI_EXPORT FileSystemURL {
public:
FileSystemURL();
@@ -26,16 +51,31 @@ class FILEAPI_EXPORT FileSystemURL {
const FilePath& internal_path);
~FileSystemURL();
+ // Returns true if this instance represents a valid FileSystem URL.
bool is_valid() const { return is_valid_; }
+
+ // Returns the origin part of this URL. See the class comment for details.
const GURL& origin() const { return origin_; }
+
+ // Returns the type part of this URL. See the class comment for details.
FileSystemType type() const { return type_; }
- // TODO(kinuko): this must be std::string.
+ // Returns the path part of this URL. See the class comment for details.
+ // TODO(kinuko): this must return std::string.
const FilePath& path() const { return path_; }
- // For isolated filesystem.
+ // Returns the original path part of this URL.
+ // See the class comment for details.
+ // TODO(kinuko): this must return std::string.
+ const FilePath& virtual_path() const { return virtual_path_; }
+
+ // Returns the filesystem ID/name for isolated/external file system URLs.
+ // See the class comment for details.
const std::string& filesystem_id() const { return filesystem_id_; }
+ // Returns the mount type of this URL for isolated/external file system URLs.
+ FileSystemMountType mount_type() const { return mount_type_; }
+
std::string spec() const;
// Returns a new FileSystemURL with the given path.
@@ -50,7 +90,11 @@ class FILEAPI_EXPORT FileSystemURL {
GURL origin_;
FileSystemType type_;
FilePath path_;
- std::string filesystem_id_; // For isolated filesystem.
+
+ // For isolated filesystem.
+ std::string filesystem_id_;
+ FilePath virtual_path_;
+ FileSystemMountType mount_type_;
bool is_valid_;
};
« no previous file with comments | « webkit/fileapi/file_system_types.h ('k') | webkit/fileapi/file_system_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698