Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: content/browser/fileapi/fileapi_message_filter.cc

Issue 10828043: Wire up the deleteFileSystem operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/fileapi/fileapi_message_filter.cc
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
index 285a6ff4bd6203c696990ba9d6f0a8465761bcdb..74130a657014a14ba510d61a3065b9e9f5638466 100644
--- a/content/browser/fileapi/fileapi_message_filter.cc
+++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -150,6 +150,7 @@ bool FileAPIMessageFilter::OnMessageReceived(
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(FileAPIMessageFilter, message, *message_was_ok)
IPC_MESSAGE_HANDLER(FileSystemHostMsg_Open, OnOpen)
+ IPC_MESSAGE_HANDLER(FileSystemHostMsg_DeleteFileSystem, OnDeleteFileSystem)
IPC_MESSAGE_HANDLER(FileSystemHostMsg_Move, OnMove)
IPC_MESSAGE_HANDLER(FileSystemHostMsg_Copy, OnCopy)
IPC_MESSAGE_HANDLER(FileSystemMsg_Remove, OnRemove)
@@ -207,6 +208,15 @@ void FileAPIMessageFilter::OnOpen(
&FileAPIMessageFilter::DidOpenFileSystem, this, request_id));
}
+void FileAPIMessageFilter::OnDeleteFileSystem(
+ int request_id,
+ const GURL& origin_url,
+ fileapi::FileSystemType type) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ context_->DeleteFileSystem(origin_url, type, base::Bind(
+ &FileAPIMessageFilter::DidDeleteFileSystem, this, request_id));
+}
+
void FileAPIMessageFilter::OnMove(
int request_id, const GURL& src_path, const GURL& dest_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -649,6 +659,18 @@ void FileAPIMessageFilter::DidOpenFileSystem(int request_id,
// For OpenFileSystem we do not create a new operation, so no unregister here.
}
+void FileAPIMessageFilter::DidDeleteFileSystem(
+ int request_id,
+ base::PlatformFileError result) {
+ if (result == base::PLATFORM_FILE_OK) {
tzik 2012/07/27 17:53:47 nit: our style allows removing '{' and '}' here.
nhiroki (google) 2012/07/27 18:36:19 Done.
+ Send(new FileSystemMsg_DidSucceed(request_id));
+ } else {
+ Send(new FileSystemMsg_DidFail(request_id, result));
+ }
+ // For DeleteFileSystem we do not create a new operation,
+ // so no unregister here.
+}
+
void FileAPIMessageFilter::DidCreateSnapshot(
int request_id,
const GURL& blob_url,

Powered by Google App Engine
This is Rietveld 408576698