 Chromium Code Reviews
 Chromium Code Reviews Issue 6904063:
  String->URL cleanup, chromium-side.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 6904063:
  String->URL cleanup, chromium-side.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| Index: webkit/tools/test_shell/simple_file_system.cc | 
| diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc | 
| index e5959ce3a77c14f3cfd55b7e352f53b5311e71ac..8c3d2a521bf1f6068f6672260e0ce1cfc8d52f81 100644 | 
| --- a/webkit/tools/test_shell/simple_file_system.cc | 
| +++ b/webkit/tools/test_shell/simple_file_system.cc | 
| @@ -16,6 +16,7 @@ | 
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemEntry.h" | 
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 
| #include "webkit/fileapi/file_system_callback_dispatcher.h" | 
| #include "webkit/fileapi/file_system_context.h" | 
| @@ -37,6 +38,7 @@ using WebKit::WebFileWriterClient; | 
| using WebKit::WebFrame; | 
| using WebKit::WebSecurityOrigin; | 
| using WebKit::WebString; | 
| +using WebKit::WebURL; | 
| using WebKit::WebVector; | 
| using fileapi::FileSystemCallbackDispatcher; | 
| @@ -105,8 +107,13 @@ class SimpleFileSystemCallbackDispatcher | 
| if (!root.is_valid()) | 
| callbacks_->didFail(WebKit::WebFileErrorSecurity); | 
| else | 
| +// Temporary hack to ease a 4-phase Chromium/WebKit commit. | 
| +#ifdef WEBFILESYSTEMCALLBACKS_USE_URL_NOT_STRING | 
| + callbacks_->didOpenFileSystem(WebString::fromUTF8(name), WebURL(root)); | 
| +#else | 
| callbacks_->didOpenFileSystem( | 
| WebString::fromUTF8(name), WebString::fromUTF8(root.spec())); | 
| +#endif | 
| } | 
| virtual void DidFail(base::PlatformFileError error_code) { | 
| @@ -173,61 +180,120 @@ void SimpleFileSystem::OpenFileSystem( | 
| GetNewOperation(callbacks)->OpenFileSystem(origin_url, type, create); | 
| } | 
| +void SimpleFileSystem::move(const WebString& src_path, | 
| + const WebString& dest_path, | 
| 
kinuko
2011/05/06 07:46:57
nit: indent (here and below)
 
ericu
2011/05/11 22:02:18
Done, thanks; I'm not sure how I did that.
 | 
| + WebFileSystemCallbacks* callbacks) { | 
| + move(WebURL(GURL(src_path)), WebURL(GURL(dest_path)), callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::copy(const WebString& src_path, | 
| + const WebString& dest_path, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + copy(WebURL(GURL(src_path)), WebURL(GURL(dest_path)), callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::remove(const WebString& path, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + remove(WebURL(GURL(path)), callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::removeRecursively(const WebString& path, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + removeRecursively(WebURL(GURL(path)), callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::readMetadata(const WebString& path, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + readMetadata(WebURL(GURL(path)), callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::createFile(const WebString& path, | 
| + bool exclusive, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + createFile(WebURL(GURL(path)), exclusive, callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::createDirectory(const WebString& path, | 
| + bool exclusive, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + createDirectory(WebURL(GURL(path)), exclusive, callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::fileExists(const WebString& path, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + fileExists(WebURL(GURL(path)), callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::directoryExists(const WebString& path, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + directoryExists(WebURL(GURL(path)), callbacks); | 
| +} | 
| + | 
| +void SimpleFileSystem::readDirectory(const WebString& path, | 
| + WebFileSystemCallbacks* callbacks) { | 
| + readDirectory(WebURL(GURL(path)), callbacks); | 
| +} | 
| + | 
| +WebKit::WebFileWriter* SimpleFileSystem::createFileWriter( | 
| + const WebString& path, WebKit::WebFileWriterClient* client) { | 
| + return createFileWriter(WebURL(GURL(path)), client); | 
| +} | 
| + | 
| void SimpleFileSystem::move( | 
| - const WebString& src_path, | 
| - const WebString& dest_path, WebFileSystemCallbacks* callbacks) { | 
| + const WebURL& src_path, | 
| + const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { | 
| GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path)); | 
| } | 
| void SimpleFileSystem::copy( | 
| - const WebString& src_path, const WebString& dest_path, | 
| + const WebURL& src_path, const WebURL& dest_path, | 
| WebFileSystemCallbacks* callbacks) { | 
| GetNewOperation(callbacks)->Copy(GURL(src_path), GURL(dest_path)); | 
| } | 
| void SimpleFileSystem::remove( | 
| - const WebString& path, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->Remove(GURL(path), false /* recursive */); | 
| + const WebURL& path, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->Remove(path, false /* recursive */); | 
| } | 
| void SimpleFileSystem::removeRecursively( | 
| - const WebString& path, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->Remove(GURL(path), true /* recursive */); | 
| + const WebURL& path, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->Remove(path, true /* recursive */); | 
| } | 
| void SimpleFileSystem::readMetadata( | 
| - const WebString& path, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->GetMetadata(GURL(path)); | 
| + const WebURL& path, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->GetMetadata(path); | 
| } | 
| void SimpleFileSystem::createFile( | 
| - const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->CreateFile(GURL(path), exclusive); | 
| + const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->CreateFile(path, exclusive); | 
| } | 
| void SimpleFileSystem::createDirectory( | 
| - const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->CreateDirectory(GURL(path), exclusive, false); | 
| + const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->CreateDirectory(path, exclusive, false); | 
| } | 
| void SimpleFileSystem::fileExists( | 
| - const WebString& path, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->FileExists(GURL(path)); | 
| + const WebURL& path, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->FileExists(path); | 
| } | 
| void SimpleFileSystem::directoryExists( | 
| - const WebString& path, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->DirectoryExists(GURL(path)); | 
| + const WebURL& path, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->DirectoryExists(path); | 
| } | 
| void SimpleFileSystem::readDirectory( | 
| - const WebString& path, WebFileSystemCallbacks* callbacks) { | 
| - GetNewOperation(callbacks)->ReadDirectory(GURL(path)); | 
| + const WebURL& path, WebFileSystemCallbacks* callbacks) { | 
| + GetNewOperation(callbacks)->ReadDirectory(path); | 
| } | 
| WebFileWriter* SimpleFileSystem::createFileWriter( | 
| - const WebString& path, WebFileWriterClient* client) { | 
| - return new SimpleFileWriter(GURL(path), client, file_system_context_.get()); | 
| + const WebURL& path, WebFileWriterClient* client) { | 
| + return new SimpleFileWriter(path, client, file_system_context_.get()); | 
| } | 
| FileSystemOperation* SimpleFileSystem::GetNewOperation( |