Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / child / fileapi / file_system_dispatcher.h
index 9cdeb75..9f5ab4d 100644 (file)
 #include "base/process/process.h"
 #include "ipc/ipc_listener.h"
 #include "ipc/ipc_platform_file.h"
-#include "webkit/common/fileapi/file_system_types.h"
-#include "webkit/common/quota/quota_types.h"
+#include "storage/common/fileapi/file_system_types.h"
+#include "storage/common/quota/quota_types.h"
 
 namespace base {
 class FilePath;
-struct PlatformFileInfo;
 }
 
-namespace fileapi {
+namespace storage {
 struct DirectoryEntry;
 struct FileSystemInfo;
 }
@@ -36,30 +35,29 @@ namespace content {
 // per child process.  Messages are dispatched on the main child thread.
 class FileSystemDispatcher : public IPC::Listener {
  public:
-  typedef base::Callback<void(base::PlatformFileError error)> StatusCallback;
+  typedef base::Callback<void(base::File::Error error)> StatusCallback;
   typedef base::Callback<void(
-      const base::PlatformFileInfo& file_info)> MetadataCallback;
+      const base::File::Info& file_info)> MetadataCallback;
   typedef base::Callback<void(
-      const base::PlatformFileInfo& file_info,
+      const base::File::Info& file_info,
       const base::FilePath& platform_path,
       int request_id)> CreateSnapshotFileCallback;
-  typedef base::Callback<void(
-      const std::vector<fileapi::DirectoryEntry>& entries,
-      bool has_more)> ReadDirectoryCallback;
+  typedef base::Callback<
+      void(const std::vector<storage::DirectoryEntry>& entries, bool has_more)>
+      ReadDirectoryCallback;
   typedef base::Callback<void(
       const std::string& name,
       const GURL& root)> OpenFileSystemCallback;
-  typedef base::Callback<void(
-      const fileapi::FileSystemInfo& info,
-      const base::FilePath& file_path,
-      bool is_directory)> ResolveURLCallback;
+  typedef base::Callback<void(const storage::FileSystemInfo& info,
+                              const base::FilePath& file_path,
+                              bool is_directory)> ResolveURLCallback;
   typedef base::Callback<void(
       int64 bytes,
       bool complete)> WriteCallback;
-  typedef base::Callback<void(
-      base::PlatformFile file,
-      int file_open_id,
-      quota::QuotaLimitType quota_policy)> OpenFileCallback;
+  typedef base::Callback<void(base::PlatformFile file,
+                              int file_open_id,
+                              storage::QuotaLimitType quota_policy)>
+      OpenFileCallback;
 
   FileSystemDispatcher();
   virtual ~FileSystemDispatcher();
@@ -68,14 +66,14 @@ class FileSystemDispatcher : public IPC::Listener {
   virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
 
   void OpenFileSystem(const GURL& origin_url,
-                      fileapi::FileSystemType type,
+                      storage::FileSystemType type,
                       const OpenFileSystemCallback& success_callback,
                       const StatusCallback& error_callback);
   void ResolveURL(const GURL& filesystem_url,
                   const ResolveURLCallback& success_callback,
                   const StatusCallback& error_callback);
   void DeleteFileSystem(const GURL& origin_url,
-                        fileapi::FileSystemType type,
+                        storage::FileSystemType type,
                         const StatusCallback& callback);
   void Move(const GURL& src_path,
             const GURL& dest_path,
@@ -106,13 +104,6 @@ class FileSystemDispatcher : public IPC::Listener {
                 int64 offset,
                 int* request_id_out,
                 const StatusCallback& callback);
-  void WriteDeprecated(
-      const GURL& path,
-      const GURL& blob_url,
-      int64 offset,
-      int* request_id_out,
-      const WriteCallback& success_callback,
-      const StatusCallback& error_callback);
   void Write(const GURL& path,
              const std::string& blob_id,
              int64 offset,
@@ -126,16 +117,6 @@ class FileSystemDispatcher : public IPC::Listener {
                  const base::Time& last_modified_time,
                  const StatusCallback& callback);
 
-  // This returns a raw open PlatformFile, unlike the above, which are
-  // self-contained operations.
-  void OpenPepperFile(const GURL& file_path,
-                      int pp_open_flags,
-                      const OpenFileCallback& success_callback,
-                      const StatusCallback& error_callback);
-  // This must be paired with OpenFile, and called after finished using the
-  // raw PlatformFile returned from OpenFile.
-  void NotifyCloseFile(int file_open_id);
-
   // The caller must send FileSystemHostMsg_DidReceiveSnapshot message
   // with |request_id| passed to |success_callback| after the snapshot file
   // is successfully received.
@@ -151,25 +132,20 @@ class FileSystemDispatcher : public IPC::Listener {
                            const std::string& name,
                            const GURL& root);
   void OnDidResolveURL(int request_id,
-                       const fileapi::FileSystemInfo& info,
+                       const storage::FileSystemInfo& info,
                        const base::FilePath& file_path,
                        bool is_directory);
   void OnDidSucceed(int request_id);
   void OnDidReadMetadata(int request_id,
-                         const base::PlatformFileInfo& file_info);
+                         const base::File::Info& file_info);
   void OnDidCreateSnapshotFile(int request_id,
-                               const base::PlatformFileInfo& file_info,
+                               const base::File::Info& file_info,
                                const base::FilePath& platform_path);
   void OnDidReadDirectory(int request_id,
-                          const std::vector<fileapi::DirectoryEntry>& entries,
+                          const std::vector<storage::DirectoryEntry>& entries,
                           bool has_more);
-  void OnDidFail(int request_id, base::PlatformFileError error_code);
+  void OnDidFail(int request_id, base::File::Error error_code);
   void OnDidWrite(int request_id, int64 bytes, bool complete);
-  void OnDidOpenFile(
-      int request_id,
-      IPC::PlatformFileForTransit file,
-      int file_open_id,
-      quota::QuotaLimitType quota_policy);
 
   IDMap<CallbackDispatcher, IDMapOwnPointer> dispatchers_;