diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/common/file_system/webfilesystem_callback_dispatcher.cc | 10 | ||||
-rw-r--r-- | content/common/file_system/webfilesystem_impl.cc | 89 | ||||
-rw-r--r-- | content/common/file_system/webfilesystem_impl.h | 50 |
3 files changed, 134 insertions, 15 deletions
diff --git a/content/common/file_system/webfilesystem_callback_dispatcher.cc b/content/common/file_system/webfilesystem_callback_dispatcher.cc index c59e377..00c3cdc 100644 --- a/content/common/file_system/webfilesystem_callback_dispatcher.cc +++ b/content/common/file_system/webfilesystem_callback_dispatcher.cc @@ -15,12 +15,14 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebFileInfo; using WebKit::WebFileSystemCallbacks; using WebKit::WebFileSystemEntry; using WebKit::WebString; +using WebKit::WebURL; using WebKit::WebVector; WebFileSystemCallbackDispatcher::WebFileSystemCallbackDispatcher( @@ -60,8 +62,12 @@ void WebFileSystemCallbackDispatcher::DidReadDirectory( void WebFileSystemCallbackDispatcher::DidOpenFileSystem( const std::string& name, const GURL& root) { - callbacks_->didOpenFileSystem( - UTF8ToUTF16(name), UTF8ToUTF16(root.spec())); +// Temporary hack to ease a 4-phase Chromium/WebKit commit. +#ifdef WEBFILESYSTEMCALLBACKS_USE_URL_NOT_STRING + callbacks_->didOpenFileSystem(UTF8ToUTF16(name), root); +#else + callbacks_->didOpenFileSystem(UTF8ToUTF16(name), UTF8ToUTF16(root.spec())); +#endif } void WebFileSystemCallbackDispatcher::DidFail( diff --git a/content/common/file_system/webfilesystem_impl.cc b/content/common/file_system/webfilesystem_impl.cc index 38f1d2a..977bec4 100644 --- a/content/common/file_system/webfilesystem_impl.cc +++ b/content/common/file_system/webfilesystem_impl.cc @@ -11,19 +11,21 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebFileInfo; using WebKit::WebFileSystemCallbacks; using WebKit::WebFileSystemEntry; using WebKit::WebString; +using WebKit::WebURL; using WebKit::WebVector; WebFileSystemImpl::WebFileSystemImpl() { } -void WebFileSystemImpl::move(const WebString& src_path, - const WebString& dest_path, +void WebFileSystemImpl::move(const WebURL& src_path, + const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -32,8 +34,8 @@ void WebFileSystemImpl::move(const WebString& src_path, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::copy(const WebString& src_path, - const WebString& dest_path, +void WebFileSystemImpl::copy(const WebURL& src_path, + const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -42,7 +44,7 @@ void WebFileSystemImpl::copy(const WebString& src_path, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::remove(const WebString& path, +void WebFileSystemImpl::remove(const WebURL& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -51,7 +53,7 @@ void WebFileSystemImpl::remove(const WebString& path, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::removeRecursively(const WebString& path, +void WebFileSystemImpl::removeRecursively(const WebURL& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -60,7 +62,7 @@ void WebFileSystemImpl::removeRecursively(const WebString& path, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::readMetadata(const WebString& path, +void WebFileSystemImpl::readMetadata(const WebURL& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -68,7 +70,7 @@ void WebFileSystemImpl::readMetadata(const WebString& path, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::createFile(const WebString& path, +void WebFileSystemImpl::createFile(const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = @@ -77,7 +79,7 @@ void WebFileSystemImpl::createFile(const WebString& path, false, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::createDirectory(const WebString& path, +void WebFileSystemImpl::createDirectory(const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = @@ -86,7 +88,7 @@ void WebFileSystemImpl::createDirectory(const WebString& path, false, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::fileExists(const WebString& path, +void WebFileSystemImpl::fileExists(const WebURL& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -94,7 +96,7 @@ void WebFileSystemImpl::fileExists(const WebString& path, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::directoryExists(const WebString& path, +void WebFileSystemImpl::directoryExists(const WebURL& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -102,7 +104,7 @@ void WebFileSystemImpl::directoryExists(const WebString& path, new WebFileSystemCallbackDispatcher(callbacks)); } -void WebFileSystemImpl::readDirectory(const WebString& path, +void WebFileSystemImpl::readDirectory(const WebURL& path, WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); @@ -111,6 +113,67 @@ void WebFileSystemImpl::readDirectory(const WebString& path, } WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter( - const WebString& path, WebKit::WebFileWriterClient* client) { + const WebURL& path, WebKit::WebFileWriterClient* client) { return new WebFileWriterImpl(GURL(path), client); } + +// These are temporary shims to link up the old calls to the new implementation. +// They'll go away as soon as the webkit side gets updated. +void WebFileSystemImpl::move(const WebString& src_path, + const WebString& dest_path, + WebFileSystemCallbacks* callbacks) { + move(GURL(src_path), GURL(dest_path), callbacks); +} + +void WebFileSystemImpl::copy(const WebString& src_path, + const WebString& dest_path, + WebFileSystemCallbacks* callbacks) { + copy(GURL(src_path), GURL(dest_path), callbacks); +} + +void WebFileSystemImpl::remove(const WebString& path, + WebFileSystemCallbacks* callbacks) { + remove(GURL(path), callbacks); +} + +void WebFileSystemImpl::removeRecursively(const WebString& path, + WebFileSystemCallbacks* callbacks) { + removeRecursively(GURL(path), callbacks); +} + +void WebFileSystemImpl::readMetadata(const WebString& path, + WebFileSystemCallbacks* callbacks) { + readMetadata(GURL(path), callbacks); +} + +void WebFileSystemImpl::createFile(const WebString& path, + bool exclusive, + WebFileSystemCallbacks* callbacks) { + createFile(GURL(path), exclusive, callbacks); +} + +void WebFileSystemImpl::createDirectory(const WebString& path, + bool exclusive, + WebFileSystemCallbacks* callbacks) { + createDirectory(GURL(path), exclusive, callbacks); +} + +void WebFileSystemImpl::fileExists(const WebString& path, + WebFileSystemCallbacks* callbacks) { + fileExists(GURL(path), callbacks); +} + +void WebFileSystemImpl::directoryExists(const WebString& path, + WebFileSystemCallbacks* callbacks) { + directoryExists(GURL(path), callbacks); +} + +void WebFileSystemImpl::readDirectory(const WebString& path, + WebFileSystemCallbacks* callbacks) { + readDirectory(GURL(path), callbacks); +} + +WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter( + const WebString& path, WebKit::WebFileWriterClient* client) { + return createFileWriter(GURL(path), client); +} diff --git a/content/common/file_system/webfilesystem_impl.h b/content/common/file_system/webfilesystem_impl.h index 1d8b002..b28cd1e 100644 --- a/content/common/file_system/webfilesystem_impl.h +++ b/content/common/file_system/webfilesystem_impl.h @@ -9,6 +9,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" namespace WebKit { +class WebURL; class WebFileWriter; class WebFileWriterClient; } @@ -18,6 +19,55 @@ class WebFileSystemImpl : public WebKit::WebFileSystem { WebFileSystemImpl(); virtual ~WebFileSystemImpl() { } + // New WebFileSystem overrides. + virtual void move( + const WebKit::WebURL& src_path, + const WebKit::WebURL& dest_path, + WebKit::WebFileSystemCallbacks*); + + virtual void copy( + const WebKit::WebURL& src_path, + const WebKit::WebURL& dest_path, + WebKit::WebFileSystemCallbacks*); + + virtual void remove( + const WebKit::WebURL& path, + WebKit::WebFileSystemCallbacks*); + + virtual void removeRecursively( + const WebKit::WebURL& path, + WebKit::WebFileSystemCallbacks*); + + virtual void readMetadata( + const WebKit::WebURL& path, + WebKit::WebFileSystemCallbacks*); + + virtual void createFile( + const WebKit::WebURL& path, + bool exclusive, + WebKit::WebFileSystemCallbacks*); + + virtual void createDirectory( + const WebKit::WebURL& path, + bool exclusive, + WebKit::WebFileSystemCallbacks*); + + virtual void fileExists( + const WebKit::WebURL& path, + WebKit::WebFileSystemCallbacks*); + + virtual void directoryExists( + const WebKit::WebURL& path, + WebKit::WebFileSystemCallbacks*); + + virtual void readDirectory( + const WebKit::WebURL& path, + WebKit::WebFileSystemCallbacks*); + + virtual WebKit::WebFileWriter* createFileWriter( + const WebKit::WebURL& path, WebKit::WebFileWriterClient*); + + // Old WebFileSystem overrides, soon to go away. virtual void move( const WebKit::WebString& src_path, const WebKit::WebString& dest_path, |