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
3 // found in the LICENSE file.
5 // IPC messages for the file system.
6 // Multiply-included message file, hence no include guard.
8 #include "ipc/ipc_message_macros.h"
9 #include "ipc/ipc_platform_file.h"
10 #include "storage/common/fileapi/directory_entry.h"
11 #include "storage/common/fileapi/file_system_info.h"
12 #include "storage/common/fileapi/file_system_types.h"
13 #include "storage/common/quota/quota_types.h"
16 #undef IPC_MESSAGE_EXPORT
17 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
18 #define IPC_MESSAGE_START FileSystemMsgStart
20 IPC_STRUCT_TRAITS_BEGIN(storage::DirectoryEntry
)
21 IPC_STRUCT_TRAITS_MEMBER(name
)
22 IPC_STRUCT_TRAITS_MEMBER(is_directory
)
23 IPC_STRUCT_TRAITS_END()
25 IPC_STRUCT_TRAITS_BEGIN(storage::FileSystemInfo
)
26 IPC_STRUCT_TRAITS_MEMBER(name
)
27 IPC_STRUCT_TRAITS_MEMBER(root_url
)
28 IPC_STRUCT_TRAITS_MEMBER(mount_type
)
29 IPC_STRUCT_TRAITS_END()
31 IPC_ENUM_TRAITS(storage::FileSystemType
)
32 IPC_ENUM_TRAITS_MAX_VALUE(storage::QuotaLimitType
, storage::kQuotaLimitTypeLast
)
34 // File system messages sent from the browser to the child process.
36 // WebFrameClient::openFileSystem response messages.
37 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidOpenFileSystem
,
39 std::string
/* name */,
42 // WebFileSystem response messages.
43 IPC_MESSAGE_CONTROL4(FileSystemMsg_DidResolveURL
,
45 storage::FileSystemInfo
/* filesystem_info */,
46 base::FilePath
/* file_path */,
47 bool /* is_directory */)
48 IPC_MESSAGE_CONTROL1(FileSystemMsg_DidSucceed
,
50 IPC_MESSAGE_CONTROL2(FileSystemMsg_DidReadMetadata
,
53 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidCreateSnapshotFile
,
56 base::FilePath
/* true platform path */)
57 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidReadDirectory
,
59 std::vector
<storage::DirectoryEntry
> /* entries */,
61 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidWrite
,
63 int64
/* byte count */,
65 IPC_MESSAGE_CONTROL2(FileSystemMsg_DidFail
,
67 base::File::Error
/* error_code */)
69 // File system messages sent from the child process to the browser.
71 // WebFrameClient::openFileSystem() message.
72 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_OpenFileSystem
,
74 GURL
/* origin_url */,
75 storage::FileSystemType
/* type */)
77 // WevFrameClient::resolveURL() message.
78 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ResolveURL
,
80 GURL
/* filesystem_url */)
82 // WebFrameClient::deleteFileSystem() message.
83 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_DeleteFileSystem
,
85 GURL
/* origin_url */,
86 storage::FileSystemType
/* type */)
88 // WebFileSystem::move() message.
89 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Move
,
94 // WebFileSystem::copy() message.
95 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Copy
,
100 // WebFileSystem::remove() message.
101 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Remove
,
102 int /* request_id */,
104 bool /* recursive */)
106 // WebFileSystem::readMetadata() message.
107 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadMetadata
,
108 int /* request_id */,
111 // WebFileSystem::create() message.
112 IPC_MESSAGE_CONTROL5(FileSystemHostMsg_Create
,
113 int /* request_id */,
115 bool /* exclusive */,
116 bool /* is_directory */,
117 bool /* recursive */)
119 // WebFileSystem::exists() messages.
120 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Exists
,
121 int /* request_id */,
123 bool /* is_directory */)
125 // WebFileSystem::readDirectory() message.
126 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadDirectory
,
127 int /* request_id */,
130 // WebFileWriter::write() message.
131 IPC_MESSAGE_CONTROL4(FileSystemHostMsg_Write
,
132 int /* request id */,
133 GURL
/* file path */,
134 std::string
/* blob uuid */,
135 int64
/* position */)
137 // WebFileWriter::truncate() message.
138 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Truncate
,
139 int /* request id */,
140 GURL
/* file path */,
143 // Pepper's Touch() message.
144 IPC_MESSAGE_CONTROL4(FileSystemHostMsg_TouchFile
,
145 int /* request_id */,
147 base::Time
/* last_access_time */,
148 base::Time
/* last_modified_time */)
150 // WebFileWriter::cancel() message.
151 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_CancelWrite
,
152 int /* request id */,
153 int /* id of request to cancel */)
155 // WebFileSystem::createSnapshotFileAndReadMetadata() message.
156 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_CreateSnapshotFile
,
157 int /* request_id */,
158 GURL
/* file_path */)
160 // Renderers are expected to send this message after having processed
161 // the FileSystemMsg_DidCreateSnapshotFile message. In particular,
162 // after having created a BlobDataHandle backed by the snapshot file.
163 IPC_MESSAGE_CONTROL1(FileSystemHostMsg_DidReceiveSnapshotFile
,
164 int /* request_id */)
166 // For Pepper's URL loader.
167 IPC_SYNC_MESSAGE_CONTROL1_1(FileSystemHostMsg_SyncGetPlatformPath
,
168 GURL
/* file path */,
169 base::FilePath
/* platform_path */)