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

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

Issue 14796018: Cleanup: Deprecate FileSystemCallbackDispatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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.h
diff --git a/content/common/fileapi/file_system_dispatcher.h b/content/common/fileapi/file_system_dispatcher.h
index f38cd0d3db55fefb22d07c142a01f366eb36e7df..8451576bc7fe1079f519bc23c3735787f0d7872c 100644
--- a/content/common/fileapi/file_system_dispatcher.h
+++ b/content/common/fileapi/file_system_dispatcher.h
@@ -9,12 +9,12 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/callback_forward.h"
#include "base/files/file_util_proxy.h"
#include "base/id_map.h"
#include "base/process.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_platform_file.h"
-#include "webkit/fileapi/file_system_callback_dispatcher.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/quota/quota_types.h"
@@ -32,6 +32,31 @@ 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::PlatformFileError error,
+ const base::PlatformFileInfo& file_info,
+ const base::FilePath& platform_path)> MetadataCallback;
+ typedef MetadataCallback CreateSnapshotFileCallback;
+ typedef base::Callback<void(
+ base::PlatformFileError error,
+ const std::vector<base::FileUtilProxy::Entry>& entries,
+ bool has_more)> ReadDirectoryCallback;
+ typedef base::Callback<void(
+ base::PlatformFileError error,
+ const std::string& name,
+ const GURL& root)> OpenFileSystemCallback;
+ typedef base::Callback<void(
+ base::PlatformFileError error,
+ int64 bytes,
+ bool complete)> WriteCallback;
+ typedef base::Callback<void(
+ base::PlatformFileError error,
+ base::PlatformFile file,
+ int file_open_id,
+ quota::QuotaLimitType quota_policy)> OpenFileCallback;
+
FileSystemDispatcher();
virtual ~FileSystemDispatcher();
@@ -42,60 +67,62 @@ class FileSystemDispatcher : public IPC::Listener {
fileapi::FileSystemType type,
long long size,
bool create,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const OpenFileSystemCallback& callback);
bool DeleteFileSystem(const GURL& origin_url,
fileapi::FileSystemType type,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool Move(const GURL& src_path,
const GURL& dest_path,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool Copy(const GURL& src_path,
const GURL& dest_path,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool Remove(const GURL& path,
bool recursive,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool ReadMetadata(const GURL& path,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const MetadataCallback& callback);
bool Create(const GURL& path,
bool exclusive,
bool is_directory,
bool recursive,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool Exists(const GURL& path,
bool for_directory,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool ReadDirectory(const GURL& path,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const ReadDirectoryCallback& callback);
bool Truncate(const GURL& path,
int64 offset,
int* request_id_out,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool Write(const GURL& path,
const GURL& blob_url,
int64 offset,
int* request_id_out,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const WriteCallback& callback);
bool Cancel(int request_id_to_cancel,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
bool TouchFile(const GURL& file_path,
const base::Time& last_access_time,
const base::Time& last_modified_time,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const StatusCallback& callback);
// This returns a raw open PlatformFile, unlike the above, which are
// self-contained operations.
bool OpenFile(const GURL& file_path,
int file_flags, // passed to FileUtilProxy::CreateOrOpen
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const OpenFileCallback& callback);
// This must be paired with OpenFile, and called after finished using the
// raw PlatformFile returned from OpenFile.
bool NotifyCloseFile(int file_open_id);
bool CreateSnapshotFile(const GURL& file_path,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
+ const CreateSnapshotFileCallback& callback);
private:
+ class CallbackDispatcher;
+
// Message handlers.
void OnDidOpenFileSystem(int request_id,
const std::string& name,
@@ -119,7 +146,7 @@ class FileSystemDispatcher : public IPC::Listener {
int file_open_id,
quota::QuotaLimitType quota_policy);
- IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_;
+ IDMap<CallbackDispatcher, IDMapOwnPointer> dispatchers_;
DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698