summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortommycli@chromium.org <tommycli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 23:21:39 +0000
committertommycli@chromium.org <tommycli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 23:21:39 +0000
commit3075512bc3609dc550233ce28ce48d142869c9d8 (patch)
tree86c700b6a3bdf4fe4371972c2ee924e107e4c780
parent2d3802c4d26058b3d191d601433888d1484a26b0 (diff)
downloadchromium_src-3075512bc3609dc550233ce28ce48d142869c9d8.zip
chromium_src-3075512bc3609dc550233ce28ce48d142869c9d8.tar.gz
chromium_src-3075512bc3609dc550233ce28ce48d142869c9d8.tar.bz2
Clarify naming and comments in FileSystemURL in preparation for converting virtual_path to an std::string based representation.
BUG=134992 Review URL: https://chromiumcodereview.appspot.com/15012011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199046 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/fileapi/file_system_url.cc37
-rw-r--r--webkit/fileapi/file_system_url.h21
2 files changed, 29 insertions, 29 deletions
diff --git a/webkit/fileapi/file_system_url.cc b/webkit/fileapi/file_system_url.cc
index f636daf1..90e5d2b 100644
--- a/webkit/fileapi/file_system_url.cc
+++ b/webkit/fileapi/file_system_url.cc
@@ -32,17 +32,17 @@ FileSystemURL FileSystemURL::CreateForTest(const GURL& url) {
}
FileSystemURL FileSystemURL::CreateForTest(const GURL& origin,
- FileSystemType type,
- const base::FilePath& path) {
- return FileSystemURL(origin, type, path);
+ FileSystemType mount_type,
+ const base::FilePath& virtual_path) {
+ return FileSystemURL(origin, mount_type, virtual_path);
}
// static
bool FileSystemURL::ParseFileSystemSchemeURL(
const GURL& url,
GURL* origin_url,
- FileSystemType* type,
- base::FilePath* file_path) {
+ FileSystemType* mount_type,
+ base::FilePath* virtual_path) {
GURL origin;
FileSystemType file_system_type = kFileSystemTypeUnknown;
@@ -89,10 +89,10 @@ bool FileSystemURL::ParseFileSystemSchemeURL(
if (origin_url)
*origin_url = url.GetOrigin();
- if (type)
- *type = file_system_type;
- if (file_path)
- *file_path = converted_path.NormalizePathSeparators().
+ if (mount_type)
+ *mount_type = file_system_type;
+ if (virtual_path)
+ *virtual_path = converted_path.NormalizePathSeparators().
StripTrailingSeparators();
return true;
@@ -101,20 +101,21 @@ bool FileSystemURL::ParseFileSystemSchemeURL(
FileSystemURL::FileSystemURL(const GURL& url)
: mount_type_(kFileSystemTypeUnknown),
type_(kFileSystemTypeUnknown) {
- is_valid_ = ParseFileSystemSchemeURL(url, &origin_, &type_, &path_);
- virtual_path_ = path_;
- mount_type_ = type_;
+ is_valid_ = ParseFileSystemSchemeURL(url, &origin_, &mount_type_,
+ &virtual_path_);
+ path_ = virtual_path_;
+ type_ = mount_type_;
}
FileSystemURL::FileSystemURL(const GURL& origin,
- FileSystemType type,
- const base::FilePath& path)
+ FileSystemType mount_type,
+ const base::FilePath& virtual_path)
: is_valid_(true),
origin_(origin),
- mount_type_(type),
- virtual_path_(path.NormalizePathSeparators()),
- type_(type),
- path_(path.NormalizePathSeparators()) {
+ mount_type_(mount_type),
+ virtual_path_(virtual_path.NormalizePathSeparators()),
+ type_(mount_type),
+ path_(virtual_path.NormalizePathSeparators()) {
}
FileSystemURL::FileSystemURL(const GURL& origin,
diff --git a/webkit/fileapi/file_system_url.h b/webkit/fileapi/file_system_url.h
index 5d72e90..8a18118 100644
--- a/webkit/fileapi/file_system_url.h
+++ b/webkit/fileapi/file_system_url.h
@@ -23,10 +23,10 @@ namespace fileapi {
//
// Example: For a URL 'filesystem:http://foo.com/temporary/foo/bar':
// origin() returns 'http://foo.com',
-// type() returns kFileSystemTypeTemporary,
-// path() returns 'foo/bar',
-// virtual_path() returns the same value as path()
-// mount_type() returns the same value as type()
+// mount_type() returns kFileSystemTypeTemporary,
+// virtual_path() returns 'foo/bar',
+// type() returns the same value as mount_type(),
+// path() returns the same value as virtual_path(),
//
// All other accessors return empty or invalid value.
//
@@ -49,10 +49,10 @@ namespace fileapi {
// would create a FileSystemURL whose accessors return:
//
// origin() returns 'http://bar.com',
+// mount_type() returns kFileSystemTypeExternal,
+// virtual_path() returns 'mount_name/foo/bar',
// type() returns the kFileSystemTypeFoo,
// path() returns '/media/removable/foo/bar',
-// virtual_path() returns 'mount_name/foo/bar',
-// mount_type() returns kFileSystemTypeExternal.
//
// Note that in either case virtual_path() always returns the path part after
// 'type' part in the original URL, and mount_type() always returns the 'type'
@@ -67,7 +67,7 @@ namespace fileapi {
// <Friend>::CrackURL, <Friend>::CreateCrackedFileSystemURL, where <Friend> is
// one of the friended classes.
//
-// TODO(ericu): Look into making path() [and all FileSystem API virtual
+// TODO(ericu): Look into making virtual_path() [and all FileSystem API virtual
// paths] just an std::string, to prevent platform-specific base::FilePath behavior
// from getting invoked by accident. Currently the base::FilePath returned here needs
// special treatment, as it may contain paths that are illegal on the current
@@ -88,8 +88,8 @@ class WEBKIT_STORAGE_EXPORT FileSystemURL {
// Parses filesystem scheme |url| into uncracked FileSystemURL components.
static bool ParseFileSystemSchemeURL(const GURL& url,
GURL* origin,
- FileSystemType* type,
- base::FilePath* file_path);
+ FileSystemType* mount_type,
+ base::FilePath* virtual_path);
// Returns true if this instance represents a valid FileSystem URL.
bool is_valid() const { return is_valid_; }
@@ -100,8 +100,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemURL {
// Returns the type part of this URL. See the class comment for details.
FileSystemType type() const { return type_; }
- // Returns the path part of this URL. See the class comment for details.
- // TODO(kinuko): this must return std::string.
+ // Returns the cracked path of this URL. See the class comment for details.
const base::FilePath& path() const { return path_; }
// Returns the original path part of this URL.