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

Unified Diff: webkit/fileapi/external_mount_points.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/external_mount_points.cc
diff --git a/webkit/fileapi/external_mount_points.cc b/webkit/fileapi/external_mount_points.cc
index 58a8883acf53fb1348434519186a3d1d81c5a9c6..26db13850c1c1fe7a2a22a40371e92fbc3990bb6 100644
--- a/webkit/fileapi/external_mount_points.cc
+++ b/webkit/fileapi/external_mount_points.cc
@@ -225,6 +225,24 @@ FileSystemURL ExternalMountPoints::CreateCrackedFileSystemURL(
mount_name, cracked_type, cracked_path);
}
+bool ExternalMountPoints::GetVirtualPath(const base::FilePath& full_path,
+ base::FilePath* virtual_path) const {
+ DCHECK(virtual_path);
+
+ base::AutoLock locker(lock_);
+
+ base::FilePath path = NormalizeFilePath(full_path);
+ std::map<base::FilePath, std::string>::const_reverse_iterator iter(
+ path_to_name_map_.upper_bound(path));
+ if (iter == path_to_name_map_.rend())
+ return false;
+
+ *virtual_path = CreateVirtualRootPath(iter->second);
+ if (iter->first == path)
+ return true;
+ return iter->first.AppendRelativePath(path, virtual_path);
+}
+
RemoteFileSystemProxyInterface* ExternalMountPoints::GetRemoteFileSystemProxy(
const std::string& mount_name) const {
base::AutoLock locker(lock_);
@@ -244,24 +262,6 @@ void ExternalMountPoints::AddMountPointInfosTo(
}
}
-bool ExternalMountPoints::GetVirtualPath(const base::FilePath& path_in,
- base::FilePath* virtual_path) {
- DCHECK(virtual_path);
-
- base::AutoLock locker(lock_);
-
- base::FilePath path = NormalizeFilePath(path_in);
- std::map<base::FilePath, std::string>::reverse_iterator iter(
- path_to_name_map_.upper_bound(path));
- if (iter == path_to_name_map_.rend())
- return false;
-
- *virtual_path = CreateVirtualRootPath(iter->second);
- if (iter->first == path)
- return true;
- return iter->first.AppendRelativePath(path, virtual_path);
-}
-
base::FilePath ExternalMountPoints::CreateVirtualRootPath(
const std::string& mount_name) const {
return base::FilePath().AppendASCII(mount_name);

Powered by Google App Engine
This is Rietveld 408576698