summaryrefslogtreecommitdiffstats
path: root/content/common/fileapi/file_system_messages.h
blob: eb9d1c0acc72067d8f2851195e804e972aa04ca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// IPC messages for the file system.
// Multiply-included message file, hence no include guard.

#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
#include "url/gurl.h"
#include "webkit/common/fileapi/directory_entry.h"
#include "webkit/common/fileapi/file_system_info.h"
#include "webkit/common/fileapi/file_system_types.h"
#include "webkit/common/quota/quota_types.h"

#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
#define IPC_MESSAGE_START FileSystemMsgStart

IPC_STRUCT_TRAITS_BEGIN(fileapi::DirectoryEntry)
  IPC_STRUCT_TRAITS_MEMBER(name)
  IPC_STRUCT_TRAITS_MEMBER(is_directory)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(fileapi::FileSystemInfo)
  IPC_STRUCT_TRAITS_MEMBER(name)
  IPC_STRUCT_TRAITS_MEMBER(root_url)
  IPC_STRUCT_TRAITS_MEMBER(mount_type)
IPC_STRUCT_TRAITS_END()

IPC_ENUM_TRAITS(fileapi::FileSystemType)
IPC_ENUM_TRAITS(quota::QuotaLimitType)

// File system messages sent from the browser to the child process.

// WebFrameClient::openFileSystem response messages.
IPC_MESSAGE_CONTROL3(FileSystemMsg_DidOpenFileSystem,
                     int /* request_id */,
                     std::string /* name */,
                     GURL /* root_url */)

// WebFileSystem response messages.
IPC_MESSAGE_CONTROL4(FileSystemMsg_DidResolveURL,
                     int /* request_id */,
                     fileapi::FileSystemInfo /* filesystem_info */,
                     base::FilePath /* file_path */,
                     bool /* is_directory */)
IPC_MESSAGE_CONTROL1(FileSystemMsg_DidSucceed,
                     int /* request_id */)
IPC_MESSAGE_CONTROL2(FileSystemMsg_DidReadMetadata,
                     int /* request_id */,
                     base::PlatformFileInfo)
IPC_MESSAGE_CONTROL3(FileSystemMsg_DidCreateSnapshotFile,
                     int /* request_id */,
                     base::PlatformFileInfo,
                     base::FilePath /* true platform path */)
IPC_MESSAGE_CONTROL3(FileSystemMsg_DidReadDirectory,
                     int /* request_id */,
                     std::vector<fileapi::DirectoryEntry> /* entries */,
                     bool /* has_more */)
IPC_MESSAGE_CONTROL3(FileSystemMsg_DidWrite,
                     int /* request_id */,
                     int64 /* byte count */,
                     bool /* complete */)
IPC_MESSAGE_CONTROL4(FileSystemMsg_DidOpenFile,
                     int /* request_id */,
                     IPC::PlatformFileForTransit,
                     int /* file_open_id */,
                     quota::QuotaLimitType /* quota_policy */)
IPC_MESSAGE_CONTROL2(FileSystemMsg_DidFail,
                     int /* request_id */,
                     base::PlatformFileError /* error_code */)

// File system messages sent from the child process to the browser.

// WebFrameClient::openFileSystem() message.
IPC_MESSAGE_CONTROL3(FileSystemHostMsg_OpenFileSystem,
                     int /* request_id */,
                     GURL /* origin_url */,
                     fileapi::FileSystemType /* type */)

// WevFrameClient::resolveURL() message.
IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ResolveURL,
                     int /* request_id */,
                     GURL /* filesystem_url */)

// WebFrameClient::deleteFileSystem() message.
IPC_MESSAGE_CONTROL3(FileSystemHostMsg_DeleteFileSystem,
                     int /* request_id */,
                     GURL /* origin_url */,
                     fileapi::FileSystemType /* type */)

// WebFileSystem::move() message.
IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Move,
                     int /* request_id */,
                     GURL /* src path */,
                     GURL /* dest path */)

// WebFileSystem::copy() message.
IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Copy,
                     int /* request_id */,
                     GURL /* src path */,
                     GURL /* dest path */)

// WebFileSystem::remove() message.
IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Remove,
                     int /* request_id */,
                     GURL /* path */,
                     bool /* recursive */)

// WebFileSystem::readMetadata() message.
IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadMetadata,
                     int /* request_id */,
                     GURL /* path */)

// WebFileSystem::create() message.
IPC_MESSAGE_CONTROL5(FileSystemHostMsg_Create,
                     int /* request_id */,
                     GURL /* path */,
                     bool /* exclusive */,
                     bool /* is_directory */,
                     bool /* recursive */)

// WebFileSystem::exists() messages.
IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Exists,
                     int /* request_id */,
                     GURL /* path */,
                     bool /* is_directory */)

// WebFileSystem::readDirectory() message.
IPC_MESSAGE_CONTROL2(FileSystemHostMsg_ReadDirectory,
                     int /* request_id */,
                     GURL /* path */)

// WebFileWriter::write() message.
IPC_MESSAGE_CONTROL4(FileSystemHostMsg_Write,
                     int /* request id */,
                     GURL /* file path */,
                     std::string /* blob uuid */,
                     int64 /* position */)

// WebFileWriter::truncate() message.
IPC_MESSAGE_CONTROL3(FileSystemHostMsg_Truncate,
                     int /* request id */,
                     GURL /* file path */,
                     int64 /* length */)

// Pepper's Touch() message.
IPC_MESSAGE_CONTROL4(FileSystemHostMsg_TouchFile,
                     int /* request_id */,
                     GURL /* path */,
                     base::Time /* last_access_time */,
                     base::Time /* last_modified_time */)

// WebFileWriter::cancel() message.
IPC_MESSAGE_CONTROL2(FileSystemHostMsg_CancelWrite,
                     int /* request id */,
                     int /* id of request to cancel */)

// WebFileSystem::createSnapshotFileAndReadMetadata() message.
IPC_MESSAGE_CONTROL2(FileSystemHostMsg_CreateSnapshotFile,
                     int /* request_id */,
                     GURL /* file_path */)

// Renderers are expected to send this message after having processed
// the FileSystemMsg_DidCreateSnapshotFile message. In particular,
// after having created a BlobDataHandle backed by the snapshot file.
IPC_MESSAGE_CONTROL1(FileSystemHostMsg_DidReceiveSnapshotFile,
                     int /* request_id */)

// For Pepper's URL loader.
IPC_SYNC_MESSAGE_CONTROL1_1(FileSystemHostMsg_SyncGetPlatformPath,
                            GURL /* file path */,
                            base::FilePath /* platform_path */)