summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/file_system/file_system_dispatcher_host.cc5
-rw-r--r--chrome/browser/file_system/file_system_dispatcher_host.h3
-rw-r--r--chrome/common/file_system/file_system_dispatcher.cc4
-rw-r--r--chrome/common/file_system/file_system_dispatcher.h1
-rw-r--r--chrome/common/file_system/webfilesystem_impl.cc11
-rw-r--r--chrome/common/file_system/webfilesystem_impl.h4
-rw-r--r--chrome/common/render_messages_internal.h5
-rw-r--r--chrome/renderer/pepper_plugin_delegate_impl.cc2
8 files changed, 25 insertions, 10 deletions
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.cc b/chrome/browser/file_system/file_system_dispatcher_host.cc
index df87b11..177c98d 100644
--- a/chrome/browser/file_system/file_system_dispatcher_host.cc
+++ b/chrome/browser/file_system/file_system_dispatcher_host.cc
@@ -165,10 +165,11 @@ void FileSystemDispatcherHost::OnCopy(
GetNewOperation(request_id)->Copy(src_path, dest_path);
}
-void FileSystemDispatcherHost::OnRemove(int request_id, const FilePath& path) {
+void FileSystemDispatcherHost::OnRemove(
+ int request_id, const FilePath& path, bool recursive) {
if (!CheckValidFileSystemPath(path, request_id))
return;
- GetNewOperation(request_id)->Remove(path);
+ GetNewOperation(request_id)->Remove(path, recursive);
}
void FileSystemDispatcherHost::OnReadMetadata(
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.h b/chrome/browser/file_system/file_system_dispatcher_host.h
index 22a560a..68110be 100644
--- a/chrome/browser/file_system/file_system_dispatcher_host.h
+++ b/chrome/browser/file_system/file_system_dispatcher_host.h
@@ -21,7 +21,6 @@ namespace base {
class Time;
}
-class ChromeFileSystemOperation;
class FileSystemHostContext;
class GURL;
class HostContentSettingsMap;
@@ -50,7 +49,7 @@ class FileSystemDispatcherHost
void OnCopy(int request_id,
const FilePath& src_path,
const FilePath& dest_path);
- void OnRemove(int request_id, const FilePath& path);
+ void OnRemove(int request_id, const FilePath& path, bool recursive);
void OnReadMetadata(int request_id, const FilePath& path);
void OnCreate(int request_id,
const FilePath& path,
diff --git a/chrome/common/file_system/file_system_dispatcher.cc b/chrome/common/file_system/file_system_dispatcher.cc
index a8761a2..bc52f3a 100644
--- a/chrome/common/file_system/file_system_dispatcher.cc
+++ b/chrome/common/file_system/file_system_dispatcher.cc
@@ -67,10 +67,11 @@ bool FileSystemDispatcher::Copy(
bool FileSystemDispatcher::Remove(
const FilePath& path,
+ bool recursive,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
return ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_Remove(request_id, path));
+ new ViewHostMsg_FileSystem_Remove(request_id, path, recursive));
}
bool FileSystemDispatcher::ReadMetadata(
@@ -219,4 +220,3 @@ void FileSystemDispatcher::DidWrite(
if (complete)
dispatchers_.Remove(request_id);
}
-
diff --git a/chrome/common/file_system/file_system_dispatcher.h b/chrome/common/file_system/file_system_dispatcher.h
index 80443c4..8802c1e 100644
--- a/chrome/common/file_system/file_system_dispatcher.h
+++ b/chrome/common/file_system/file_system_dispatcher.h
@@ -43,6 +43,7 @@ class FileSystemDispatcher {
const FilePath& dest_path,
fileapi::FileSystemCallbackDispatcher* dispatcher);
bool Remove(const FilePath& path,
+ bool recursive,
fileapi::FileSystemCallbackDispatcher* dispatcher);
bool ReadMetadata(const FilePath& path,
fileapi::FileSystemCallbackDispatcher* dispatcher);
diff --git a/chrome/common/file_system/webfilesystem_impl.cc b/chrome/common/file_system/webfilesystem_impl.cc
index 9128cf1..5b180f6 100644
--- a/chrome/common/file_system/webfilesystem_impl.cc
+++ b/chrome/common/file_system/webfilesystem_impl.cc
@@ -47,6 +47,16 @@ void WebFileSystemImpl::remove(const WebString& path,
FileSystemDispatcher* dispatcher =
ChildThread::current()->file_system_dispatcher();
dispatcher->Remove(webkit_glue::WebStringToFilePath(path),
+ false /* recursive */,
+ new WebFileSystemCallbackDispatcher(callbacks));
+}
+
+void WebFileSystemImpl::removeRecursively(const WebString& path,
+ WebFileSystemCallbacks* callbacks) {
+ FileSystemDispatcher* dispatcher =
+ ChildThread::current()->file_system_dispatcher();
+ dispatcher->Remove(webkit_glue::WebStringToFilePath(path),
+ true /* recursive */,
new WebFileSystemCallbackDispatcher(callbacks));
}
@@ -104,4 +114,3 @@ WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter(
const WebString& path, WebKit::WebFileWriterClient* client) {
return new WebFileWriterImpl(path, client);
}
-
diff --git a/chrome/common/file_system/webfilesystem_impl.h b/chrome/common/file_system/webfilesystem_impl.h
index 6892eac..fc051e0 100644
--- a/chrome/common/file_system/webfilesystem_impl.h
+++ b/chrome/common/file_system/webfilesystem_impl.h
@@ -32,6 +32,10 @@ class WebFileSystemImpl : public WebKit::WebFileSystem {
const WebKit::WebString& path,
WebKit::WebFileSystemCallbacks*);
+ virtual void removeRecursively(
+ const WebKit::WebString& path,
+ WebKit::WebFileSystemCallbacks*);
+
virtual void readMetadata(
const WebKit::WebString& path,
WebKit::WebFileSystemCallbacks*);
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index c507af6..1008de2 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -2858,9 +2858,10 @@ IPC_BEGIN_MESSAGES(ViewHost)
FilePath /* dest path */)
// WebFileSystem::remove() message.
- IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_Remove,
+ IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Remove,
int /* request_id */,
- FilePath /* path */)
+ FilePath /* path */,
+ bool /* recursive */)
// WebFileSystem::readMetadata() message.
IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_ReadMetadata,
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc
index c3b9f9b..8960d29 100644
--- a/chrome/renderer/pepper_plugin_delegate_impl.cc
+++ b/chrome/renderer/pepper_plugin_delegate_impl.cc
@@ -711,7 +711,7 @@ bool PepperPluginDelegateImpl::Delete(
fileapi::FileSystemCallbackDispatcher* dispatcher) {
FileSystemDispatcher* file_system_dispatcher =
ChildThread::current()->file_system_dispatcher();
- return file_system_dispatcher->Remove(path, dispatcher);
+ return file_system_dispatcher->Remove(path, false /* recursive */, dispatcher);
}
bool PepperPluginDelegateImpl::Rename(