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

Unified Diff: content/common/fileapi/file_system_dispatcher.cc

Issue 10541113: Notify CloseFile from Pepper to FileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/common/fileapi/file_system_dispatcher.cc
diff --git a/content/common/fileapi/file_system_dispatcher.cc b/content/common/fileapi/file_system_dispatcher.cc
index dc3309e61b7b8ba10b9870231ad79b6892ac3843..7fed779eca2fbd11e3788d78df3784d01cd3cd09 100644
--- a/content/common/fileapi/file_system_dispatcher.cc
+++ b/content/common/fileapi/file_system_dispatcher.cc
@@ -9,6 +9,37 @@
#include "content/common/child_thread.h"
#include "content/common/fileapi/file_system_messages.h"
+namespace {
+
+// Dummy dispatcher used only for issuing a request_id.
+class CloseFileDispatcher : public fileapi::FileSystemCallbackDispatcher {
kinuko 2012/06/13 06:38:29 We usually put these dispatchers on the caller's s
kinaba 2012/06/25 11:14:02 Sounds good. I made it into a send-only message.
+ public:
+ virtual void DidSucceed() {}
+ virtual void DidFail(base::PlatformFileError error_code) {}
+
+ virtual void DidReadMetadata(const base::PlatformFileInfo& file_info,
+ const FilePath& platform_path) {
+ NOTREACHED();
+ }
+ virtual void DidReadDirectory(
+ const std::vector<base::FileUtilProxy::Entry>& entries,
+ bool has_more) {
+ NOTREACHED();
+ }
+ virtual void DidOpenFileSystem(const std::string& name,
+ const GURL& root) {
+ NOTREACHED();
+ }
+ virtual void DidWrite(int64 bytes, bool complete) {
+ NOTREACHED();
+ }
+ virtual void DidOpenFile(base::PlatformFile file) {
+ NOTREACHED();
+ }
+};
+
+} // namespace
+
FileSystemDispatcher::FileSystemDispatcher() {
}
@@ -230,6 +261,17 @@ bool FileSystemDispatcher::OpenFile(
return true;
}
+bool FileSystemDispatcher::NotifyCloseFile(const GURL& file_path) {
+ fileapi::FileSystemCallbackDispatcher* dispatcher = new CloseFileDispatcher;
+ int request_id = dispatchers_.Add(dispatcher);
+ if (!ChildThread::current()->Send(
+ new FileSystemHostMsg_NotifyCloseFile(request_id, file_path))) {
+ dispatchers_.Remove(request_id); // destroys |dispatcher|
+ return false;
+ }
+ return true;
+}
+
bool FileSystemDispatcher::CreateSnapshotFile(
const GURL& blob_url,
const GURL& file_path,

Powered by Google App Engine
This is Rietveld 408576698