summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_util.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
commita3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e (patch)
treebdd4dac76e6034ef6cf33450e203269a715ea0e6 /webkit/fileapi/file_system_util.cc
parent8bc574c57115e9ffd0169f33131c0865997dcb35 (diff)
downloadchromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.zip
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.gz
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.bz2
Add FilePath to base namespace.
This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes. Review URL: https://codereview.chromium.org/12163003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_util.cc')
-rw-r--r--webkit/fileapi/file_system_util.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc
index 07db153..7e017f7 100644
--- a/webkit/fileapi/file_system_util.cc
+++ b/webkit/fileapi/file_system_util.cc
@@ -27,26 +27,26 @@ const char kTestDir[] = "/test";
// TODO(ericu): Consider removing support for '\', even on Windows, if possible.
// There's a lot of test code that will need reworking, and we may have trouble
-// with FilePath elsewhere [e.g. DirName and other methods may also need
+// with base::FilePath elsewhere [e.g. DirName and other methods may also need
// replacement].
-FilePath VirtualPath::BaseName(const FilePath& virtual_path) {
- FilePath::StringType path = virtual_path.value();
+base::FilePath VirtualPath::BaseName(const base::FilePath& virtual_path) {
+ base::FilePath::StringType path = virtual_path.value();
// Keep everything after the final separator, but if the pathname is only
// one character and it's a separator, leave it alone.
- while (path.size() > 1 && FilePath::IsSeparator(path[path.size() - 1]))
+ while (path.size() > 1 && base::FilePath::IsSeparator(path[path.size() - 1]))
path.resize(path.size() - 1);
- FilePath::StringType::size_type last_separator =
- path.find_last_of(FilePath::kSeparators);
- if (last_separator != FilePath::StringType::npos &&
+ base::FilePath::StringType::size_type last_separator =
+ path.find_last_of(base::FilePath::kSeparators);
+ if (last_separator != base::FilePath::StringType::npos &&
last_separator < path.size() - 1)
path.erase(0, last_separator + 1);
- return FilePath(path);
+ return base::FilePath(path);
}
void VirtualPath::GetComponents(
- const FilePath& path, std::vector<FilePath::StringType>* components) {
+ const base::FilePath& path, std::vector<base::FilePath::StringType>* components) {
DCHECK(components);
if (!components)
return;
@@ -54,12 +54,12 @@ void VirtualPath::GetComponents(
if (path.value().empty())
return;
- std::vector<FilePath::StringType> ret_val;
- FilePath current = path;
- FilePath base;
+ std::vector<base::FilePath::StringType> ret_val;
+ base::FilePath current = path;
+ base::FilePath base;
- // Due to the way things are implemented, FilePath::DirName works here,
- // whereas FilePath::BaseName doesn't.
+ // Due to the way things are implemented, base::FilePath::DirName works here,
+ // whereas base::FilePath::BaseName doesn't.
while (current != current.DirName()) {
base = BaseName(current);
ret_val.push_back(base.value());
@@ -67,7 +67,7 @@ void VirtualPath::GetComponents(
}
*components =
- std::vector<FilePath::StringType>(ret_val.rbegin(), ret_val.rend());
+ std::vector<base::FilePath::StringType>(ret_val.rbegin(), ret_val.rend());
}
GURL GetFileSystemRootURI(const GURL& origin_url, FileSystemType type) {
@@ -193,7 +193,7 @@ std::string GetFileSystemTypeString(FileSystemType type) {
return std::string();
}
-std::string FilePathToString(const FilePath& file_path) {
+std::string FilePathToString(const base::FilePath& file_path) {
#if defined(OS_WIN)
return UTF16ToUTF8(file_path.value());
#elif defined(OS_POSIX)
@@ -201,11 +201,11 @@ std::string FilePathToString(const FilePath& file_path) {
#endif
}
-FilePath StringToFilePath(const std::string& file_path_string) {
+base::FilePath StringToFilePath(const std::string& file_path_string) {
#if defined(OS_WIN)
- return FilePath(UTF8ToUTF16(file_path_string));
+ return base::FilePath(UTF8ToUTF16(file_path_string));
#elif defined(OS_POSIX)
- return FilePath(file_path_string);
+ return base::FilePath(file_path_string);
#endif
}
@@ -282,7 +282,7 @@ std::string GetIsolatedFileSystemRootURIString(
root.append(filesystem_id);
root.append("/");
if (!optional_root_name.empty()) {
- DCHECK(!FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent());
+ DCHECK(!base::FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent());
root.append(optional_root_name);
root.append("/");
}