Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / common / fileapi / file_system_messages.h
blob9720732da61ad6583da0f76c56b58a26d0675f44
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 "url/gurl.h"
11 #include "webkit/common/fileapi/directory_entry.h"
12 #include "webkit/common/fileapi/file_system_info.h"
13 #include "webkit/common/fileapi/file_system_types.h"
14 #include "webkit/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(storage::QuotaLimitType)
34 // File system messages sent from the browser to the child process.
36 // WebFrameClient::openFileSystem response messages.
37 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidOpenFileSystem,
38 int /* request_id */,
39 std::string /* name */,
40 GURL /* root_url */)
42 // WebFileSystem response messages.
43 IPC_MESSAGE_CONTROL4(FileSystemMsg_DidResolveURL,
44 int /* request_id */,
45 storage::FileSystemInfo /* filesystem_info */,
46 base::FilePath /* file_path */,
47 bool /* is_directory */)
48 IPC_MESSAGE_CONTROL1(FileSystemMsg_DidSucceed,
49 int /* request_id */)
50 IPC_MESSAGE_CONTROL2(FileSystemMsg_DidReadMetadata,
51 int /* request_id */,
52 base::File::Info)
53 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidCreateSnapshotFile,
54 int /* request_id */,
55 base::File::Info,
56 base::FilePath /* true platform path */)
57 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidReadDirectory,
58 int /* request_id */,
59 std::vector<storage::DirectoryEntry> /* entries */,
60 bool /* has_more */)
61 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidWrite,
62 int /* request_id */,
63 int64 /* byte count */,
64 bool /* complete */)
65 IPC_MESSAGE_CONTROL2(FileSystemMsg_DidFail,
66 int /* request_id */,
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,
73 int /* request_id */,
74 GURL /* origin_url */,
75 storage::FileSystemType /* type */)
77 // WevFrameClient::resolveURL() message.
78 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ResolveURL,
79 int /* request_id */,
80 GURL /* filesystem_url */)
82 // WebFrameClient::deleteFileSystem() message.
83 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_DeleteFileSystem,
84 int /* request_id */,
85 GURL /* origin_url */,
86 storage::FileSystemType /* type */)
88 // WebFileSystem::move() message.
89 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Move,
90 int /* request_id */,
91 GURL /* src path */,
92 GURL /* dest path */)
94 // WebFileSystem::copy() message.
95 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Copy,
96 int /* request_id */,
97 GURL /* src path */,
98 GURL /* dest path */)
100 // WebFileSystem::remove() message.
101 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Remove,
102 int /* request_id */,
103 GURL /* path */,
104 bool /* recursive */)
106 // WebFileSystem::readMetadata() message.
107 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadMetadata,
108 int /* request_id */,
109 GURL /* path */)
111 // WebFileSystem::create() message.
112 IPC_MESSAGE_CONTROL5(FileSystemHostMsg_Create,
113 int /* request_id */,
114 GURL /* path */,
115 bool /* exclusive */,
116 bool /* is_directory */,
117 bool /* recursive */)
119 // WebFileSystem::exists() messages.
120 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Exists,
121 int /* request_id */,
122 GURL /* path */,
123 bool /* is_directory */)
125 // WebFileSystem::readDirectory() message.
126 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadDirectory,
127 int /* request_id */,
128 GURL /* path */)
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 */,
141 int64 /* length */)
143 // Pepper's Touch() message.
144 IPC_MESSAGE_CONTROL4(FileSystemHostMsg_TouchFile,
145 int /* request_id */,
146 GURL /* path */,
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 */)