diff options
Diffstat (limited to 'content/common/file_system')
7 files changed, 57 insertions, 54 deletions
diff --git a/content/common/file_system/file_system_dispatcher.cc b/content/common/file_system/file_system_dispatcher.cc index d95a5b7..c4fe701 100644 --- a/content/common/file_system/file_system_dispatcher.cc +++ b/content/common/file_system/file_system_dispatcher.cc @@ -52,8 +52,8 @@ bool FileSystemDispatcher::OpenFileSystem( } bool FileSystemDispatcher::Move( - const FilePath& src_path, - const FilePath& dest_path, + const GURL& src_path, + const GURL& dest_path, fileapi::FileSystemCallbackDispatcher* dispatcher) { int request_id = dispatchers_.Add(dispatcher); if (!ChildThread::current()->Send(new FileSystemHostMsg_Move( @@ -66,8 +66,8 @@ bool FileSystemDispatcher::Move( } bool FileSystemDispatcher::Copy( - const FilePath& src_path, - const FilePath& dest_path, + const GURL& src_path, + const GURL& dest_path, fileapi::FileSystemCallbackDispatcher* dispatcher) { int request_id = dispatchers_.Add(dispatcher); if (!ChildThread::current()->Send(new FileSystemHostMsg_Copy( @@ -80,7 +80,7 @@ bool FileSystemDispatcher::Copy( } bool FileSystemDispatcher::Remove( - const FilePath& path, + const GURL& path, bool recursive, fileapi::FileSystemCallbackDispatcher* dispatcher) { int request_id = dispatchers_.Add(dispatcher); @@ -94,7 +94,7 @@ bool FileSystemDispatcher::Remove( } bool FileSystemDispatcher::ReadMetadata( - const FilePath& path, + const GURL& path, fileapi::FileSystemCallbackDispatcher* dispatcher) { int request_id = dispatchers_.Add(dispatcher); if (!ChildThread::current()->Send( @@ -107,7 +107,7 @@ bool FileSystemDispatcher::ReadMetadata( } bool FileSystemDispatcher::Create( - const FilePath& path, + const GURL& path, bool exclusive, bool is_directory, bool recursive, @@ -123,7 +123,7 @@ bool FileSystemDispatcher::Create( } bool FileSystemDispatcher::Exists( - const FilePath& path, + const GURL& path, bool is_directory, fileapi::FileSystemCallbackDispatcher* dispatcher) { int request_id = dispatchers_.Add(dispatcher); @@ -137,7 +137,7 @@ bool FileSystemDispatcher::Exists( } bool FileSystemDispatcher::ReadDirectory( - const FilePath& path, + const GURL& path, fileapi::FileSystemCallbackDispatcher* dispatcher) { int request_id = dispatchers_.Add(dispatcher); if (!ChildThread::current()->Send( @@ -150,7 +150,7 @@ bool FileSystemDispatcher::ReadDirectory( } bool FileSystemDispatcher::Truncate( - const FilePath& path, + const GURL& path, int64 offset, int* request_id_out, fileapi::FileSystemCallbackDispatcher* dispatcher) { @@ -167,7 +167,7 @@ bool FileSystemDispatcher::Truncate( } bool FileSystemDispatcher::Write( - const FilePath& path, + const GURL& path, const GURL& blob_url, int64 offset, int* request_id_out, @@ -198,7 +198,7 @@ bool FileSystemDispatcher::Cancel( } bool FileSystemDispatcher::TouchFile( - const FilePath& path, + const GURL& path, const base::Time& last_access_time, const base::Time& last_modified_time, fileapi::FileSystemCallbackDispatcher* dispatcher) { @@ -215,12 +215,12 @@ bool FileSystemDispatcher::TouchFile( void FileSystemDispatcher::OnOpenComplete( int request_id, bool accepted, const std::string& name, - const FilePath& root_path) { + const GURL& root) { fileapi::FileSystemCallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); DCHECK(dispatcher); if (accepted) - dispatcher->DidOpenFileSystem(name, root_path); + dispatcher->DidOpenFileSystem(name, root); else dispatcher->DidFail(base::PLATFORM_FILE_ERROR_SECURITY); dispatchers_.Remove(request_id); diff --git a/content/common/file_system/file_system_dispatcher.h b/content/common/file_system/file_system_dispatcher.h index e61a518..b898eae 100644 --- a/content/common/file_system/file_system_dispatcher.h +++ b/content/common/file_system/file_system_dispatcher.h @@ -38,39 +38,39 @@ class FileSystemDispatcher : public IPC::Channel::Listener { long long size, bool create, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool Move(const FilePath& src_path, - const FilePath& dest_path, + bool Move(const GURL& src_path, + const GURL& dest_path, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool Copy(const FilePath& src_path, - const FilePath& dest_path, + bool Copy(const GURL& src_path, + const GURL& dest_path, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool Remove(const FilePath& path, + bool Remove(const GURL& path, bool recursive, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool ReadMetadata(const FilePath& path, + bool ReadMetadata(const GURL& path, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool Create(const FilePath& path, + bool Create(const GURL& path, bool exclusive, bool is_directory, bool recursive, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool Exists(const FilePath& path, + bool Exists(const GURL& path, bool for_directory, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool ReadDirectory(const FilePath& path, + bool ReadDirectory(const GURL& path, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool Truncate(const FilePath& path, + bool Truncate(const GURL& path, int64 offset, int* request_id_out, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool Write(const FilePath& path, + bool Write(const GURL& path, const GURL& blob_url, int64 offset, int* request_id_out, fileapi::FileSystemCallbackDispatcher* dispatcher); bool Cancel(int request_id_to_cancel, fileapi::FileSystemCallbackDispatcher* dispatcher); - bool TouchFile(const FilePath& file_path, + bool TouchFile(const GURL& file_path, const base::Time& last_access_time, const base::Time& last_modified_time, fileapi::FileSystemCallbackDispatcher* dispatcher); @@ -81,7 +81,7 @@ class FileSystemDispatcher : public IPC::Channel::Listener { int request_id, bool accepted, const std::string& name, - const FilePath& root_path); + const GURL& root); void OnDidSucceed(int request_id); void OnDidReadMetadata(int request_id, const base::PlatformFileInfo& file_info, diff --git a/content/common/file_system/webfilesystem_callback_dispatcher.cc b/content/common/file_system/webfilesystem_callback_dispatcher.cc index 6903f4c..c59e377 100644 --- a/content/common/file_system/webfilesystem_callback_dispatcher.cc +++ b/content/common/file_system/webfilesystem_callback_dispatcher.cc @@ -10,6 +10,7 @@ #include "base/file_util_proxy.h" #include "base/logging.h" #include "base/utf_string_conversions.h" +#include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h" @@ -58,9 +59,9 @@ void WebFileSystemCallbackDispatcher::DidReadDirectory( } void WebFileSystemCallbackDispatcher::DidOpenFileSystem( - const std::string& name, const FilePath& root_path) { - callbacks_->didOpenFileSystem(UTF8ToUTF16(name), - webkit_glue::FilePathToWebString(root_path)); + const std::string& name, const GURL& root) { + callbacks_->didOpenFileSystem( + UTF8ToUTF16(name), UTF8ToUTF16(root.spec())); } void WebFileSystemCallbackDispatcher::DidFail( diff --git a/content/common/file_system/webfilesystem_callback_dispatcher.h b/content/common/file_system/webfilesystem_callback_dispatcher.h index 80bd183..b8c1aac 100644 --- a/content/common/file_system/webfilesystem_callback_dispatcher.h +++ b/content/common/file_system/webfilesystem_callback_dispatcher.h @@ -9,6 +9,8 @@ #include "base/platform_file.h" #include "webkit/fileapi/file_system_callback_dispatcher.h" +class GURL; + namespace WebKit { class WebFileSystemCallbacks; } @@ -28,7 +30,7 @@ class WebFileSystemCallbackDispatcher const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more); virtual void DidOpenFileSystem(const std::string&, - const FilePath&); + const GURL&); virtual void DidFail(base::PlatformFileError); virtual void DidWrite(int64 bytes, bool complete); diff --git a/content/common/file_system/webfilesystem_impl.cc b/content/common/file_system/webfilesystem_impl.cc index 43b78f3..38f1d2a 100644 --- a/content/common/file_system/webfilesystem_impl.cc +++ b/content/common/file_system/webfilesystem_impl.cc @@ -27,8 +27,8 @@ void WebFileSystemImpl::move(const WebString& src_path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Move(webkit_glue::WebStringToFilePath(src_path), - webkit_glue::WebStringToFilePath(dest_path), + dispatcher->Move(GURL(src_path), + GURL(dest_path), new WebFileSystemCallbackDispatcher(callbacks)); } @@ -37,8 +37,8 @@ void WebFileSystemImpl::copy(const WebString& src_path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Copy(webkit_glue::WebStringToFilePath(src_path), - webkit_glue::WebStringToFilePath(dest_path), + dispatcher->Copy(GURL(src_path), + GURL(dest_path), new WebFileSystemCallbackDispatcher(callbacks)); } @@ -46,7 +46,7 @@ void WebFileSystemImpl::remove(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Remove(webkit_glue::WebStringToFilePath(path), + dispatcher->Remove(GURL(path), false /* recursive */, new WebFileSystemCallbackDispatcher(callbacks)); } @@ -55,7 +55,7 @@ void WebFileSystemImpl::removeRecursively(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Remove(webkit_glue::WebStringToFilePath(path), + dispatcher->Remove(GURL(path), true /* recursive */, new WebFileSystemCallbackDispatcher(callbacks)); } @@ -64,7 +64,7 @@ void WebFileSystemImpl::readMetadata(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->ReadMetadata(webkit_glue::WebStringToFilePath(path), + dispatcher->ReadMetadata(GURL(path), new WebFileSystemCallbackDispatcher(callbacks)); } @@ -73,7 +73,7 @@ void WebFileSystemImpl::createFile(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Create(webkit_glue::WebStringToFilePath(path), exclusive, false, + dispatcher->Create(GURL(path), exclusive, false, false, new WebFileSystemCallbackDispatcher(callbacks)); } @@ -82,7 +82,7 @@ void WebFileSystemImpl::createDirectory(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Create(webkit_glue::WebStringToFilePath(path), exclusive, true, + dispatcher->Create(GURL(path), exclusive, true, false, new WebFileSystemCallbackDispatcher(callbacks)); } @@ -90,7 +90,7 @@ void WebFileSystemImpl::fileExists(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Exists(webkit_glue::WebStringToFilePath(path), false, + dispatcher->Exists(GURL(path), false, new WebFileSystemCallbackDispatcher(callbacks)); } @@ -98,7 +98,7 @@ void WebFileSystemImpl::directoryExists(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Exists(webkit_glue::WebStringToFilePath(path), true, + dispatcher->Exists(GURL(path), true, new WebFileSystemCallbackDispatcher(callbacks)); } @@ -106,11 +106,11 @@ void WebFileSystemImpl::readDirectory(const WebString& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->ReadDirectory(webkit_glue::WebStringToFilePath(path), + dispatcher->ReadDirectory(GURL(path), new WebFileSystemCallbackDispatcher(callbacks)); } WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter( const WebString& path, WebKit::WebFileWriterClient* client) { - return new WebFileWriterImpl(path, client); + return new WebFileWriterImpl(GURL(path), client); } diff --git a/content/common/file_system/webfilewriter_impl.cc b/content/common/file_system/webfilewriter_impl.cc index 196b9ec..d42caa5 100644 --- a/content/common/file_system/webfilewriter_impl.cc +++ b/content/common/file_system/webfilewriter_impl.cc @@ -32,7 +32,7 @@ class WebFileWriterImpl::CallbackDispatcher NOTREACHED(); } virtual void DidOpenFileSystem(const std::string& name, - const FilePath& root_path) { + const GURL& root) { NOTREACHED(); } virtual void DidSucceed() { @@ -53,7 +53,7 @@ class WebFileWriterImpl::CallbackDispatcher }; WebFileWriterImpl::WebFileWriterImpl( - const WebKit::WebString& path, WebKit::WebFileWriterClient* client) + const GURL& path, WebKit::WebFileWriterClient* client) : WebFileWriterBase(path, client), request_id_(0) { } @@ -61,16 +61,17 @@ WebFileWriterImpl::WebFileWriterImpl( WebFileWriterImpl::~WebFileWriterImpl() { } -void WebFileWriterImpl::DoTruncate(const FilePath& path, int64 offset) { +void WebFileWriterImpl::DoTruncate(const GURL& path, int64 offset) { // The FileSystemDispatcher takes ownership of the CallbackDispatcher. GetFileSystemDispatcher()->Truncate(path, offset, &request_id_, new CallbackDispatcher(AsWeakPtr())); } void WebFileWriterImpl::DoWrite( - const FilePath& path, const GURL& blob_url, int64 offset) { - GetFileSystemDispatcher()->Write(path, blob_url, offset, &request_id_, - new CallbackDispatcher(AsWeakPtr())); + const GURL& path, const GURL& blob_url, int64 offset) { + GetFileSystemDispatcher()->Write( + path, blob_url, offset, &request_id_, + new CallbackDispatcher(AsWeakPtr())); } void WebFileWriterImpl::DoCancel() { diff --git a/content/common/file_system/webfilewriter_impl.h b/content/common/file_system/webfilewriter_impl.h index fa34eaf..792926e 100644 --- a/content/common/file_system/webfilewriter_impl.h +++ b/content/common/file_system/webfilewriter_impl.h @@ -15,14 +15,13 @@ class FileSystemDispatcher; class WebFileWriterImpl : public fileapi::WebFileWriterBase, public base::SupportsWeakPtr<WebFileWriterImpl> { public: - WebFileWriterImpl( - const WebKit::WebString& path, WebKit::WebFileWriterClient* client); + WebFileWriterImpl(const GURL& path, WebKit::WebFileWriterClient* client); virtual ~WebFileWriterImpl(); protected: // WebFileWriterBase overrides - virtual void DoTruncate(const FilePath& path, int64 offset); - virtual void DoWrite(const FilePath& path, const GURL& blob_url, + virtual void DoTruncate(const GURL& path, int64 offset); + virtual void DoWrite(const GURL& path, const GURL& blob_url, int64 offset); virtual void DoCancel(); |