OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_CHILD_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
6 #define CONTENT_CHILD_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 6 #define CONTENT_CHILD_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/basictypes.h" | |
12 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
13 #include "base/id_map.h" | 14 #include "base/id_map.h" |
| 15 #include "base/macros.h" |
14 #include "base/process/process.h" | 16 #include "base/process/process.h" |
15 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
16 #include "ipc/ipc_platform_file.h" | 18 #include "ipc/ipc_platform_file.h" |
17 #include "storage/common/fileapi/file_system_types.h" | 19 #include "storage/common/fileapi/file_system_types.h" |
18 #include "storage/common/quota/quota_types.h" | 20 #include "storage/common/quota/quota_types.h" |
19 | 21 |
20 namespace base { | 22 namespace base { |
21 class FilePath; | 23 class FilePath; |
22 } | 24 } |
23 | 25 |
(...skipping 20 matching lines...) Expand all Loading... |
44 int request_id)> CreateSnapshotFileCallback; | 46 int request_id)> CreateSnapshotFileCallback; |
45 typedef base::Callback< | 47 typedef base::Callback< |
46 void(const std::vector<storage::DirectoryEntry>& entries, bool has_more)> | 48 void(const std::vector<storage::DirectoryEntry>& entries, bool has_more)> |
47 ReadDirectoryCallback; | 49 ReadDirectoryCallback; |
48 typedef base::Callback<void( | 50 typedef base::Callback<void( |
49 const std::string& name, | 51 const std::string& name, |
50 const GURL& root)> OpenFileSystemCallback; | 52 const GURL& root)> OpenFileSystemCallback; |
51 typedef base::Callback<void(const storage::FileSystemInfo& info, | 53 typedef base::Callback<void(const storage::FileSystemInfo& info, |
52 const base::FilePath& file_path, | 54 const base::FilePath& file_path, |
53 bool is_directory)> ResolveURLCallback; | 55 bool is_directory)> ResolveURLCallback; |
54 typedef base::Callback<void( | 56 typedef base::Callback<void(int64_t bytes, bool complete)> WriteCallback; |
55 int64 bytes, | |
56 bool complete)> WriteCallback; | |
57 typedef base::Callback<void(base::PlatformFile file, | 57 typedef base::Callback<void(base::PlatformFile file, |
58 int file_open_id, | 58 int file_open_id, |
59 storage::QuotaLimitType quota_policy)> | 59 storage::QuotaLimitType quota_policy)> |
60 OpenFileCallback; | 60 OpenFileCallback; |
61 | 61 |
62 FileSystemDispatcher(); | 62 FileSystemDispatcher(); |
63 ~FileSystemDispatcher() override; | 63 ~FileSystemDispatcher() override; |
64 | 64 |
65 // IPC::Listener implementation. | 65 // IPC::Listener implementation. |
66 bool OnMessageReceived(const IPC::Message& msg) override; | 66 bool OnMessageReceived(const IPC::Message& msg) override; |
(...skipping 27 matching lines...) Expand all Loading... |
94 bool exclusive, | 94 bool exclusive, |
95 bool recursive, | 95 bool recursive, |
96 const StatusCallback& callback); | 96 const StatusCallback& callback); |
97 void Exists(const GURL& path, | 97 void Exists(const GURL& path, |
98 bool for_directory, | 98 bool for_directory, |
99 const StatusCallback& callback); | 99 const StatusCallback& callback); |
100 void ReadDirectory(const GURL& path, | 100 void ReadDirectory(const GURL& path, |
101 const ReadDirectoryCallback& success_callback, | 101 const ReadDirectoryCallback& success_callback, |
102 const StatusCallback& error_callback); | 102 const StatusCallback& error_callback); |
103 void Truncate(const GURL& path, | 103 void Truncate(const GURL& path, |
104 int64 offset, | 104 int64_t offset, |
105 int* request_id_out, | 105 int* request_id_out, |
106 const StatusCallback& callback); | 106 const StatusCallback& callback); |
107 void Write(const GURL& path, | 107 void Write(const GURL& path, |
108 const std::string& blob_id, | 108 const std::string& blob_id, |
109 int64 offset, | 109 int64_t offset, |
110 int* request_id_out, | 110 int* request_id_out, |
111 const WriteCallback& success_callback, | 111 const WriteCallback& success_callback, |
112 const StatusCallback& error_callback); | 112 const StatusCallback& error_callback); |
113 void Cancel(int request_id_to_cancel, | 113 void Cancel(int request_id_to_cancel, |
114 const StatusCallback& callback); | 114 const StatusCallback& callback); |
115 void TouchFile(const GURL& file_path, | 115 void TouchFile(const GURL& file_path, |
116 const base::Time& last_access_time, | 116 const base::Time& last_access_time, |
117 const base::Time& last_modified_time, | 117 const base::Time& last_modified_time, |
118 const StatusCallback& callback); | 118 const StatusCallback& callback); |
119 | 119 |
(...skipping 18 matching lines...) Expand all Loading... |
138 void OnDidSucceed(int request_id); | 138 void OnDidSucceed(int request_id); |
139 void OnDidReadMetadata(int request_id, | 139 void OnDidReadMetadata(int request_id, |
140 const base::File::Info& file_info); | 140 const base::File::Info& file_info); |
141 void OnDidCreateSnapshotFile(int request_id, | 141 void OnDidCreateSnapshotFile(int request_id, |
142 const base::File::Info& file_info, | 142 const base::File::Info& file_info, |
143 const base::FilePath& platform_path); | 143 const base::FilePath& platform_path); |
144 void OnDidReadDirectory(int request_id, | 144 void OnDidReadDirectory(int request_id, |
145 const std::vector<storage::DirectoryEntry>& entries, | 145 const std::vector<storage::DirectoryEntry>& entries, |
146 bool has_more); | 146 bool has_more); |
147 void OnDidFail(int request_id, base::File::Error error_code); | 147 void OnDidFail(int request_id, base::File::Error error_code); |
148 void OnDidWrite(int request_id, int64 bytes, bool complete); | 148 void OnDidWrite(int request_id, int64_t bytes, bool complete); |
149 | 149 |
150 IDMap<CallbackDispatcher, IDMapOwnPointer> dispatchers_; | 150 IDMap<CallbackDispatcher, IDMapOwnPointer> dispatchers_; |
151 | 151 |
152 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); | 152 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); |
153 }; | 153 }; |
154 | 154 |
155 } // namespace content | 155 } // namespace content |
156 | 156 |
157 #endif // CONTENT_CHILD_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 157 #endif // CONTENT_CHILD_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
OLD | NEW |