Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / common / fileapi / file_system_messages.h
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.
4
5 // IPC messages for the file system.
6 // Multiply-included message file, hence no include guard.
7
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"
14 #include "url/gurl.h"
15
16 #undef IPC_MESSAGE_EXPORT
17 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
18 #define IPC_MESSAGE_START FileSystemMsgStart
19
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()
24
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()
30
31 IPC_ENUM_TRAITS(storage::FileSystemType)
32 IPC_ENUM_TRAITS_MAX_VALUE(storage::QuotaLimitType, storage::kQuotaLimitTypeLast)
33
34 // File system messages sent from the browser to the child process.
35
36 // WebFrameClient::openFileSystem response messages.
37 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidOpenFileSystem,
38                      int /* request_id */,
39                      std::string /* name */,
40                      GURL /* root_url */)
41
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 */)
68
69 // File system messages sent from the child process to the browser.
70
71 // WebFrameClient::openFileSystem() message.
72 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_OpenFileSystem,
73                      int /* request_id */,
74                      GURL /* origin_url */,
75                      storage::FileSystemType /* type */)
76
77 // WevFrameClient::resolveURL() message.
78 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ResolveURL,
79                      int /* request_id */,
80                      GURL /* filesystem_url */)
81
82 // WebFrameClient::deleteFileSystem() message.
83 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_DeleteFileSystem,
84                      int /* request_id */,
85                      GURL /* origin_url */,
86                      storage::FileSystemType /* type */)
87
88 // WebFileSystem::move() message.
89 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Move,
90                      int /* request_id */,
91                      GURL /* src path */,
92                      GURL /* dest path */)
93
94 // WebFileSystem::copy() message.
95 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Copy,
96                      int /* request_id */,
97                      GURL /* src path */,
98                      GURL /* dest path */)
99
100 // WebFileSystem::remove() message.
101 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Remove,
102                      int /* request_id */,
103                      GURL /* path */,
104                      bool /* recursive */)
105
106 // WebFileSystem::readMetadata() message.
107 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadMetadata,
108                      int /* request_id */,
109                      GURL /* path */)
110
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 */)
118
119 // WebFileSystem::exists() messages.
120 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Exists,
121                      int /* request_id */,
122                      GURL /* path */,
123                      bool /* is_directory */)
124
125 // WebFileSystem::readDirectory() message.
126 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadDirectory,
127                      int /* request_id */,
128                      GURL /* path */)
129
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 */)
136
137 // WebFileWriter::truncate() message.
138 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Truncate,
139                      int /* request id */,
140                      GURL /* file path */,
141                      int64 /* length */)
142
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 */)
149
150 // WebFileWriter::cancel() message.
151 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_CancelWrite,
152                      int /* request id */,
153                      int /* id of request to cancel */)
154
155 // WebFileSystem::createSnapshotFileAndReadMetadata() message.
156 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_CreateSnapshotFile,
157                      int /* request_id */,
158                      GURL /* file_path */)
159
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 */)
165
166 // For Pepper's URL loader.
167 IPC_SYNC_MESSAGE_CONTROL1_1(FileSystemHostMsg_SyncGetPlatformPath,
168                             GURL /* file path */,
169                             base::FilePath /* platform_path */)