summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/simple_file_system.cc
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 19:53:30 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 19:53:30 +0000
commit41e889432dacf1044c38d23a49b7edbc44d273b6 (patch)
treea797a6dae1c5035f2a291bbae9276fb5dafeb6fe /webkit/tools/test_shell/simple_file_system.cc
parent2d90cbded0eff1772c1baec0ad4a7034542c15c1 (diff)
downloadchromium_src-41e889432dacf1044c38d23a49b7edbc44d273b6.zip
chromium_src-41e889432dacf1044c38d23a49b7edbc44d273b6.tar.gz
chromium_src-41e889432dacf1044c38d23a49b7edbc44d273b6.tar.bz2
More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where
possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/, which bounced recently. There are a few changes here that weren't there [most notably in file_system_operation_write_unittest.cc and file_system_operation.cc], but they're pretty trivial build/test fixes. Review URL: http://codereview.chromium.org/6833007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81463 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/simple_file_system.cc')
-rw-r--r--webkit/tools/test_shell/simple_file_system.cc50
1 files changed, 14 insertions, 36 deletions
diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc
index ecbc6d5..ff634eeb 100644
--- a/webkit/tools/test_shell/simple_file_system.cc
+++ b/webkit/tools/test_shell/simple_file_system.cc
@@ -95,13 +95,13 @@ class SimpleFileSystemCallbackDispatcher
}
virtual void DidOpenFileSystem(
- const std::string& name, const FilePath& path) {
+ const std::string& name, const GURL& root) {
DCHECK(file_system_);
- if (path.empty())
+ if (!root.is_valid())
callbacks_->didFail(WebKit::WebFileErrorSecurity);
else
callbacks_->didOpenFileSystem(
- UTF8ToUTF16(name), webkit_glue::FilePathToWebString(path));
+ WebString::fromUTF8(name), WebString::fromUTF8(root.spec()));
}
virtual void DidFail(base::PlatformFileError error_code) {
@@ -168,80 +168,58 @@ void SimpleFileSystem::OpenFileSystem(
void SimpleFileSystem::move(
const WebString& src_path,
const WebString& dest_path, WebFileSystemCallbacks* callbacks) {
- FilePath dest_filepath(webkit_glue::WebStringToFilePath(dest_path));
- FilePath src_filepath(webkit_glue::WebStringToFilePath(src_path));
-
- GetNewOperation(callbacks)->Move(src_filepath, dest_filepath);
+ GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path));
}
void SimpleFileSystem::copy(
const WebString& src_path, const WebString& dest_path,
WebFileSystemCallbacks* callbacks) {
- FilePath dest_filepath(webkit_glue::WebStringToFilePath(dest_path));
- FilePath src_filepath(webkit_glue::WebStringToFilePath(src_path));
-
- GetNewOperation(callbacks)->Copy(src_filepath, dest_filepath);
+ GetNewOperation(callbacks)->Copy(GURL(src_path), GURL(dest_path));
}
void SimpleFileSystem::remove(
const WebString& path, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->Remove(filepath, false /* recursive */);
+ GetNewOperation(callbacks)->Remove(GURL(path), false /* recursive */);
}
void SimpleFileSystem::removeRecursively(
const WebString& path, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->Remove(filepath, true /* recursive */);
+ GetNewOperation(callbacks)->Remove(GURL(path), true /* recursive */);
}
void SimpleFileSystem::readMetadata(
const WebString& path, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->GetMetadata(filepath);
+ GetNewOperation(callbacks)->GetMetadata(GURL(path));
}
void SimpleFileSystem::createFile(
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->CreateFile(filepath, exclusive);
+ GetNewOperation(callbacks)->CreateFile(GURL(path), exclusive);
}
void SimpleFileSystem::createDirectory(
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->CreateDirectory(filepath, exclusive, false);
+ GetNewOperation(callbacks)->CreateDirectory(GURL(path), exclusive, false);
}
void SimpleFileSystem::fileExists(
const WebString& path, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->FileExists(filepath);
+ GetNewOperation(callbacks)->FileExists(GURL(path));
}
void SimpleFileSystem::directoryExists(
const WebString& path, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->DirectoryExists(filepath);
+ GetNewOperation(callbacks)->DirectoryExists(GURL(path));
}
void SimpleFileSystem::readDirectory(
const WebString& path, WebFileSystemCallbacks* callbacks) {
- FilePath filepath(webkit_glue::WebStringToFilePath(path));
-
- GetNewOperation(callbacks)->ReadDirectory(filepath);
+ GetNewOperation(callbacks)->ReadDirectory(GURL(path));
}
WebFileWriter* SimpleFileSystem::createFileWriter(
const WebString& path, WebFileWriterClient* client) {
- return new SimpleFileWriter(path, client, file_system_context_.get());
+ return new SimpleFileWriter(GURL(path), client, file_system_context_.get());
}
FileSystemOperation* SimpleFileSystem::GetNewOperation(