diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 23:55:06 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 23:55:06 +0000 |
commit | 1e5f2f31b90115fc4affc00115d5503f65031f4d (patch) | |
tree | bd5d3768a9fc9d5946a4289ba619a56930817f3f /chrome/renderer | |
parent | 60745416082f8f0eebca05ad50da4bc0786f5a20 (diff) | |
download | chromium_src-1e5f2f31b90115fc4affc00115d5503f65031f4d.zip chromium_src-1e5f2f31b90115fc4affc00115d5503f65031f4d.tar.gz chromium_src-1e5f2f31b90115fc4affc00115d5503f65031f4d.tar.bz2 |
Pepper's FileSystem implementation.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3394017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60729 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/pepper_plugin_delegate_impl.cc | 50 | ||||
-rw-r--r-- | chrome/renderer/pepper_plugin_delegate_impl.h | 14 |
2 files changed, 64 insertions, 0 deletions
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc index 31b89ff..0577cfd0 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.cc +++ b/chrome/renderer/pepper_plugin_delegate_impl.cc @@ -10,6 +10,9 @@ #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/task.h" +#include "base/time.h" +#include "chrome/common/child_thread.h" +#include "chrome/common/file_system/file_system_dispatcher.h" #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/renderer/audio_message_filter.h" @@ -22,6 +25,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserCompletion.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserParams.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" +#include "webkit/fileapi/file_system_callback_dispatcher.h" #include "webkit/glue/plugins/pepper_file_io.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/webplugin.h" @@ -669,6 +673,52 @@ void PepperPluginDelegateImpl::OnSetFocus(bool has_focus) { (*i)->SetContentAreaFocus(has_focus); } +bool PepperPluginDelegateImpl::MakeDirectory( + const FilePath& path, + bool recursive, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + FileSystemDispatcher* file_system_dispatcher = + ChildThread::current()->file_system_dispatcher(); + return file_system_dispatcher->Create( + path, false, true, recursive, dispatcher); +} + +bool PepperPluginDelegateImpl::Query( + const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + FileSystemDispatcher* file_system_dispatcher = + ChildThread::current()->file_system_dispatcher(); + return file_system_dispatcher->ReadMetadata(path, dispatcher); +} + +bool PepperPluginDelegateImpl::Touch( + const FilePath& path, + const base::Time& last_access_time, + const base::Time& last_modified_time, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + FileSystemDispatcher* file_system_dispatcher = + ChildThread::current()->file_system_dispatcher(); + return file_system_dispatcher->TouchFile(path, last_access_time, + last_modified_time, dispatcher); +} + +bool PepperPluginDelegateImpl::Delete( + const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + FileSystemDispatcher* file_system_dispatcher = + ChildThread::current()->file_system_dispatcher(); + return file_system_dispatcher->Remove(path, dispatcher); +} + +bool PepperPluginDelegateImpl::Rename( + const FilePath& file_path, + const FilePath& new_file_path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + FileSystemDispatcher* file_system_dispatcher = + ChildThread::current()->file_system_dispatcher(); + return file_system_dispatcher->Move(file_path, new_file_path, dispatcher); +} + scoped_refptr<base::MessageLoopProxy> PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { return RenderThread::current()->GetFileThreadMessageLoopProxy(); diff --git a/chrome/renderer/pepper_plugin_delegate_impl.h b/chrome/renderer/pepper_plugin_delegate_impl.h index 8bacb44..b3b5b76 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.h +++ b/chrome/renderer/pepper_plugin_delegate_impl.h @@ -85,6 +85,20 @@ class PepperPluginDelegateImpl virtual bool AsyncOpenFile(const FilePath& path, int flags, AsyncOpenFileCallback* callback); + virtual bool MakeDirectory(const FilePath& path, + bool recursive, + fileapi::FileSystemCallbackDispatcher* dispatcher); + virtual bool Query(const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher); + virtual bool Touch(const FilePath& path, + const base::Time& last_access_time, + const base::Time& last_modified_time, + fileapi::FileSystemCallbackDispatcher* dispatcher); + virtual bool Delete(const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher); + virtual bool Rename(const FilePath& file_path, + const FilePath& new_file_path, + fileapi::FileSystemCallbackDispatcher* dispatcher); virtual scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy(); virtual pepper::FullscreenContainer* CreateFullscreenContainer( pepper::PluginInstance* instance); |