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

Unified Diff: webkit/fileapi/external_mount_points.cc

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/external_mount_points.h ('k') | webkit/fileapi/external_mount_points_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/external_mount_points.cc
diff --git a/webkit/fileapi/external_mount_points.cc b/webkit/fileapi/external_mount_points.cc
index bca5b2ba496ac6ef6789629e92f47d3fe1617f44..b129911695ebf36f591a20f4ca97e3e29815a811 100644
--- a/webkit/fileapi/external_mount_points.cc
+++ b/webkit/fileapi/external_mount_points.cc
@@ -20,15 +20,15 @@ namespace {
// For example, /a/b/c(1)/d would be erroneously resolved as c/d if the
// following mount points were registered: "/a/b/c", "/a/b/c(1)". (Note:
// "/a/b/c" < "/a/b/c(1)" < "/a/b/c/").
-FilePath NormalizeFilePath(const FilePath& path) {
+base::FilePath NormalizeFilePath(const base::FilePath& path) {
if (path.empty())
return path;
- FilePath::StringType path_str = path.StripTrailingSeparators().value();
- if (!FilePath::IsSeparator(path_str[path_str.length() - 1]))
+ base::FilePath::StringType path_str = path.StripTrailingSeparators().value();
+ if (!base::FilePath::IsSeparator(path_str[path_str.length() - 1]))
path_str.append(FILE_PATH_LITERAL("/"));
- return FilePath(path_str).NormalizePathSeparators();
+ return base::FilePath(path_str).NormalizePathSeparators();
}
// Wrapper around ref-counted ExternalMountPoints that will be used to lazily
@@ -53,15 +53,15 @@ class SystemMountPointsLazyWrapper {
system_mount_points_->RegisterFileSystem(
"archive",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FILE_PATH_LITERAL("/media/archive")));
+ base::FilePath(FILE_PATH_LITERAL("/media/archive")));
system_mount_points_->RegisterFileSystem(
"removable",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FILE_PATH_LITERAL("/media/removable")));
+ base::FilePath(FILE_PATH_LITERAL("/media/removable")));
system_mount_points_->RegisterFileSystem(
"oem",
fileapi::kFileSystemTypeRestrictedNativeLocal,
- FilePath(FILE_PATH_LITERAL("/usr/share/oem")));
+ base::FilePath(FILE_PATH_LITERAL("/usr/share/oem")));
#endif // defined(OS_CHROMEOS)
}
@@ -78,20 +78,20 @@ namespace fileapi {
class ExternalMountPoints::Instance {
public:
Instance(FileSystemType type,
- const FilePath& path,
+ const base::FilePath& path,
RemoteFileSystemProxyInterface* remote_proxy);
~Instance();
FileSystemType type() const { return type_; }
- const FilePath& path() const { return path_; }
+ const base::FilePath& path() const { return path_; }
RemoteFileSystemProxyInterface* remote_proxy() const {
return remote_proxy_.get();
}
private:
const FileSystemType type_;
- const FilePath path_;
+ const base::FilePath path_;
// For file systems that have a remote file system proxy.
scoped_refptr<RemoteFileSystemProxyInterface> remote_proxy_;
@@ -100,7 +100,7 @@ class ExternalMountPoints::Instance {
};
ExternalMountPoints::Instance::Instance(FileSystemType type,
- const FilePath& path,
+ const base::FilePath& path,
RemoteFileSystemProxyInterface* proxy)
: type_(type),
path_(path.StripTrailingSeparators()),
@@ -125,7 +125,7 @@ scoped_refptr<ExternalMountPoints> ExternalMountPoints::CreateRefCounted() {
bool ExternalMountPoints::RegisterFileSystem(
const std::string& mount_name,
FileSystemType type,
- const FilePath& path) {
+ const base::FilePath& path) {
return RegisterRemoteFileSystem(mount_name, type, NULL, path);
}
@@ -133,10 +133,10 @@ bool ExternalMountPoints::RegisterRemoteFileSystem(
const std::string& mount_name,
FileSystemType type,
RemoteFileSystemProxyInterface* remote_proxy,
- const FilePath& path_in) {
+ const base::FilePath& path_in) {
base::AutoLock locker(lock_);
- FilePath path = NormalizeFilePath(path_in);
+ base::FilePath path = NormalizeFilePath(path_in);
if (!ValidateNewMountPoint(mount_name, path))
return false;
@@ -164,7 +164,7 @@ bool ExternalMountPoints::RevokeFileSystem(const std::string& mount_name) {
}
bool ExternalMountPoints::GetRegisteredPath(
- const std::string& filesystem_id, FilePath* path) const {
+ const std::string& filesystem_id, base::FilePath* path) const {
DCHECK(path);
base::AutoLock locker(lock_);
NameToInstance::const_iterator found = instance_map_.find(filesystem_id);
@@ -174,10 +174,10 @@ bool ExternalMountPoints::GetRegisteredPath(
return true;
}
-bool ExternalMountPoints::CrackVirtualPath(const FilePath& virtual_path,
+bool ExternalMountPoints::CrackVirtualPath(const base::FilePath& virtual_path,
std::string* mount_name,
FileSystemType* type,
- FilePath* path) const {
+ base::FilePath* path) const {
DCHECK(mount_name);
DCHECK(path);
@@ -186,18 +186,18 @@ bool ExternalMountPoints::CrackVirtualPath(const FilePath& virtual_path,
return false;
// The virtual_path should comprise of <mount_name> and <relative_path> parts.
- std::vector<FilePath::StringType> components;
+ std::vector<base::FilePath::StringType> components;
virtual_path.GetComponents(&components);
if (components.size() < 1)
return false;
- std::vector<FilePath::StringType>::iterator component_iter =
+ std::vector<base::FilePath::StringType>::iterator component_iter =
components.begin();
- std::string maybe_mount_name = FilePath(*component_iter++).MaybeAsASCII();
+ std::string maybe_mount_name = base::FilePath(*component_iter++).MaybeAsASCII();
if (maybe_mount_name.empty())
return false;
- FilePath cracked_path;
+ base::FilePath cracked_path;
{
base::AutoLock locker(lock_);
NameToInstance::const_iterator found_instance =
@@ -230,13 +230,13 @@ FileSystemURL ExternalMountPoints::CrackURL(const GURL& url) const {
FileSystemURL ExternalMountPoints::CreateCrackedFileSystemURL(
const GURL& origin,
FileSystemType type,
- const FilePath& path) const {
+ const base::FilePath& path) const {
if (!HandlesFileSystemMountType(type))
return FileSystemURL();
std::string mount_name;
FileSystemType cracked_type;
- FilePath cracked_path;
+ base::FilePath cracked_path;
if (!CrackVirtualPath(path, &mount_name, &cracked_type, &cracked_path))
return FileSystemURL();
@@ -263,14 +263,14 @@ void ExternalMountPoints::AddMountPointInfosTo(
}
}
-bool ExternalMountPoints::GetVirtualPath(const FilePath& path_in,
- FilePath* virtual_path) {
+bool ExternalMountPoints::GetVirtualPath(const base::FilePath& path_in,
+ base::FilePath* virtual_path) {
DCHECK(virtual_path);
base::AutoLock locker(lock_);
- FilePath path = NormalizeFilePath(path_in);
- std::map<FilePath, std::string>::reverse_iterator iter(
+ 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;
@@ -281,9 +281,9 @@ bool ExternalMountPoints::GetVirtualPath(const FilePath& path_in,
return iter->first.AppendRelativePath(path, virtual_path);
}
-FilePath ExternalMountPoints::CreateVirtualRootPath(
+base::FilePath ExternalMountPoints::CreateVirtualRootPath(
const std::string& mount_name) const {
- return FilePath().AppendASCII(mount_name);
+ return base::FilePath().AppendASCII(mount_name);
}
ExternalMountPoints::ExternalMountPoints() {}
@@ -294,7 +294,7 @@ ExternalMountPoints::~ExternalMountPoints() {
}
bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
- const FilePath& path) {
+ const base::FilePath& path) {
lock_.AssertAcquired();
// Mount name must not be empty.
@@ -315,7 +315,7 @@ bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
return false;
// Check there the new path does not overlap with one of the existing ones.
- std::map<FilePath, std::string>::reverse_iterator potential_parent(
+ std::map<base::FilePath, std::string>::reverse_iterator potential_parent(
path_to_name_map_.upper_bound(path));
if (potential_parent != path_to_name_map_.rend()) {
if (potential_parent->first == path ||
@@ -324,7 +324,7 @@ bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
}
}
- std::map<FilePath, std::string>::iterator potential_child =
+ std::map<base::FilePath, std::string>::iterator potential_child =
path_to_name_map_.upper_bound(path);
if (potential_child == path_to_name_map_.end())
return true;
@@ -335,13 +335,13 @@ bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
ScopedExternalFileSystem::ScopedExternalFileSystem(
const std::string& mount_name,
FileSystemType type,
- const FilePath& path)
+ const base::FilePath& path)
: mount_name_(mount_name) {
ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
mount_name, type, path);
}
-FilePath ScopedExternalFileSystem::GetVirtualRootPath() const {
+base::FilePath ScopedExternalFileSystem::GetVirtualRootPath() const {
return ExternalMountPoints::GetSystemInstance()->
CreateVirtualRootPath(mount_name_);
}
« no previous file with comments | « webkit/fileapi/external_mount_points.h ('k') | webkit/fileapi/external_mount_points_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698