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

Unified Diff: webkit/fileapi/file_system_url.cc

Issue 12258021: Fix filesystem API file_handlers to work for drive on ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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
Index: webkit/fileapi/file_system_url.cc
diff --git a/webkit/fileapi/file_system_url.cc b/webkit/fileapi/file_system_url.cc
index d0f8a037c20283c534c3f766cf5bcdceac33a7aa..59f2d371e02c7278763c5148f4cb88e8f93b358e 100644
--- a/webkit/fileapi/file_system_url.cc
+++ b/webkit/fileapi/file_system_url.cc
@@ -100,7 +100,8 @@ bool FileSystemURL::ParseFileSystemSchemeURL(
FileSystemURL::FileSystemURL(const GURL& url)
: type_(kFileSystemTypeUnknown),
- mount_type_(kFileSystemTypeUnknown) {
+ mount_type_(kFileSystemTypeUnknown),
+ has_underlying_url_(false) {
is_valid_ = ParseFileSystemSchemeURL(url, &origin_, &type_, &path_);
virtual_path_ = path_;
mount_type_ = type_;
@@ -114,7 +115,8 @@ FileSystemURL::FileSystemURL(const GURL& origin,
type_(type),
mount_type_(type),
path_(path.NormalizePathSeparators()),
- virtual_path_(path.NormalizePathSeparators()) {
+ virtual_path_(path.NormalizePathSeparators()),
+ has_underlying_url_(false) {
}
FileSystemURL::FileSystemURL(const GURL& origin,
@@ -129,11 +131,19 @@ FileSystemURL::FileSystemURL(const GURL& origin,
mount_type_(mount_type),
path_(cracked_path.NormalizePathSeparators()),
filesystem_id_(filesystem_id),
- virtual_path_(virtual_path.NormalizePathSeparators()) {
+ virtual_path_(virtual_path.NormalizePathSeparators()),
+ has_underlying_url_(false) {
}
FileSystemURL::~FileSystemURL() {}
+void FileSystemURL::SetUnderlyingURL(const FileSystemURL& underlying_url) {
+ has_underlying_url_ = true;
+ underlying_filesystem_id_ = underlying_url.filesystem_id();
+ underlying_type_ = underlying_url.type();
+ underlying_virtual_path_ = underlying_url.virtual_path();
+}
+
std::string FileSystemURL::DebugString() const {
if (!is_valid_)
return "invalid filesystem: URL";
@@ -160,6 +170,17 @@ bool FileSystemURL::IsParent(const FileSystemURL& child) const {
path().IsParent(child.path());
}
+FileSystemURL FileSystemURL::GetForOperations() const {
+ if (!has_underlying_url_)
+ return *this;
+ return FileSystemURL(origin_,
+ mount_type_,
+ underlying_virtual_path_,
+ underlying_filesystem_id_,
+ underlying_type_,
+ path_);
+}
+
bool FileSystemURL::operator==(const FileSystemURL& that) const {
return origin_ == that.origin_ &&
type_ == that.type_ &&

Powered by Google App Engine
This is Rietveld 408576698