OLD | NEW |
| (Empty) |
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 "base/file_util_proxy.h" | |
9 #include "googleurl/src/gurl.h" | |
10 #include "ipc/ipc_message_macros.h" | |
11 #include "ipc/ipc_platform_file.h" | |
12 #include "webkit/fileapi/file_system_types.h" | |
13 | |
14 #define IPC_MESSAGE_START FileSystemMsgStart | |
15 | |
16 IPC_STRUCT_TRAITS_BEGIN(base::FileUtilProxy::Entry) | |
17 IPC_STRUCT_TRAITS_MEMBER(name) | |
18 IPC_STRUCT_TRAITS_MEMBER(is_directory) | |
19 IPC_STRUCT_TRAITS_END() | |
20 | |
21 IPC_ENUM_TRAITS(fileapi::FileSystemType) | |
22 | |
23 // File system messages sent from the browser to the child process. | |
24 | |
25 // WebFrameClient::openFileSystem response messages. | |
26 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidOpenFileSystem, | |
27 int /* request_id */, | |
28 std::string /* name */, | |
29 GURL /* root_url */) | |
30 | |
31 // WebFileSystem response messages. | |
32 IPC_MESSAGE_CONTROL1(FileSystemMsg_DidSucceed, | |
33 int /* request_id */) | |
34 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidReadMetadata, | |
35 int /* request_id */, | |
36 base::PlatformFileInfo, | |
37 FilePath /* true platform path, where possible */) | |
38 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidReadDirectory, | |
39 int /* request_id */, | |
40 std::vector<base::FileUtilProxy::Entry> /* entries */, | |
41 bool /* has_more */) | |
42 IPC_MESSAGE_CONTROL3(FileSystemMsg_DidWrite, | |
43 int /* request_id */, | |
44 int64 /* byte count */, | |
45 bool /* complete */) | |
46 IPC_MESSAGE_CONTROL2(FileSystemMsg_DidOpenFile, | |
47 int /* request_id */, | |
48 IPC::PlatformFileForTransit) | |
49 IPC_MESSAGE_CONTROL2(FileSystemMsg_DidFail, | |
50 int /* request_id */, | |
51 base::PlatformFileError /* error_code */) | |
52 | |
53 // File system messages sent from the child process to the browser. | |
54 | |
55 // WebFrameClient::openFileSystem() message. | |
56 IPC_MESSAGE_CONTROL5(FileSystemHostMsg_Open, | |
57 int /* request_id */, | |
58 GURL /* origin_url */, | |
59 fileapi::FileSystemType /* type */, | |
60 int64 /* requested_size */, | |
61 bool /* create */) | |
62 | |
63 // WebFileSystem::move() message. | |
64 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Move, | |
65 int /* request_id */, | |
66 GURL /* src path */, | |
67 GURL /* dest path */) | |
68 | |
69 // WebFileSystem::copy() message. | |
70 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Copy, | |
71 int /* request_id */, | |
72 GURL /* src path */, | |
73 GURL /* dest path */) | |
74 | |
75 // WebFileSystem::remove() message. | |
76 IPC_MESSAGE_CONTROL3(FileSystemMsg_Remove, | |
77 int /* request_id */, | |
78 GURL /* path */, | |
79 bool /* recursive */) | |
80 | |
81 // WebFileSystem::readMetadata() message. | |
82 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadMetadata, | |
83 int /* request_id */, | |
84 GURL /* path */) | |
85 | |
86 // WebFileSystem::create() message. | |
87 IPC_MESSAGE_CONTROL5(FileSystemHostMsg_Create, | |
88 int /* request_id */, | |
89 GURL /* path */, | |
90 bool /* exclusive */, | |
91 bool /* is_directory */, | |
92 bool /* recursive */) | |
93 | |
94 // WebFileSystem::exists() messages. | |
95 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Exists, | |
96 int /* request_id */, | |
97 GURL /* path */, | |
98 bool /* is_directory */) | |
99 | |
100 // WebFileSystem::readDirectory() message. | |
101 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadDirectory, | |
102 int /* request_id */, | |
103 GURL /* path */) | |
104 | |
105 // WebFileWriter::write() message. | |
106 IPC_MESSAGE_CONTROL4(FileSystemHostMsg_Write, | |
107 int /* request id */, | |
108 GURL /* file path */, | |
109 GURL /* blob URL */, | |
110 int64 /* position */) | |
111 | |
112 // WebFileWriter::truncate() message. | |
113 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Truncate, | |
114 int /* request id */, | |
115 GURL /* file path */, | |
116 int64 /* length */) | |
117 | |
118 // Pepper's Touch() message. | |
119 IPC_MESSAGE_CONTROL4(FileSystemHostMsg_TouchFile, | |
120 int /* request_id */, | |
121 GURL /* path */, | |
122 base::Time /* last_access_time */, | |
123 base::Time /* last_modified_time */) | |
124 | |
125 // WebFileWriter::cancel() message. | |
126 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_CancelWrite, | |
127 int /* request id */, | |
128 int /* id of request to cancel */) | |
129 | |
130 // Pepper's OpenFile message. | |
131 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_OpenFile, | |
132 int /* request id */, | |
133 GURL /* file path */, | |
134 int /* file flags */) | |
135 | |
136 // WebFileSystem::createSnapshotFileAndReadMetadata() message. | |
137 IPC_MESSAGE_CONTROL3(FileSystemHostMsg_CreateSnapshotFile, | |
138 int /* request_id */, | |
139 GURL /* blob_url */, | |
140 GURL /* file_path */) | |
141 | |
142 // For Pepper's URL loader. | |
143 IPC_SYNC_MESSAGE_CONTROL1_1(FileSystemHostMsg_SyncGetPlatformPath, | |
144 GURL /* file path */, | |
145 FilePath /* platform_path */) | |
146 | |
147 // Pre- and post-update notifications for ppapi implementation. | |
148 IPC_MESSAGE_CONTROL1(FileSystemHostMsg_WillUpdate, | |
149 GURL /* file_path */) | |
150 | |
151 IPC_MESSAGE_CONTROL2(FileSystemHostMsg_DidUpdate, | |
152 GURL /* file_path */, | |
153 int64 /* delta */) | |
OLD | NEW |