OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Multiply-included message file, no traditional include guard. | 5 // Multiply-included message file, no traditional include guard. |
6 #include "content/public/common/common_param_traits.h" | |
7 #include "ipc/ipc_message_macros.h" | 6 #include "ipc/ipc_message_macros.h" |
8 #include "ipc/ipc_param_traits.h" | 7 #include "ipc/ipc_param_traits.h" |
9 #include "ipc/ipc_platform_file.h" | 8 #include "ipc/ipc_platform_file.h" |
10 #include "webkit/plugins/ppapi/dir_contents.h" | 9 #include "ppapi/proxy/ppapi_proxy_export.h" |
11 #include "webkit/plugins/ppapi/file_path.h" | 10 #include "ppapi/shared_impl/dir_contents.h" |
| 11 #include "ppapi/shared_impl/file_path.h" |
12 | 12 |
13 // Singly-included section since need custom serialization. | 13 // Singly-included section since need custom serialization. |
14 #ifndef CONTENT_COMMON_PEPPER_FILE_MESSAGES_H_ | 14 #ifndef PPAPI_SHARED_IMPL_PEPPER_FILE_MESSAGES_H_ |
15 #define CONTENT_COMMON_PEPPER_FILE_MESSAGES_H_ | 15 #define PPAPI_SHARED_IMPL_PEPPER_FILE_MESSAGES_H_ |
16 | 16 |
17 namespace IPC { | 17 namespace IPC { |
18 | 18 |
19 template <> | 19 template <> |
20 struct ParamTraits<webkit::ppapi::PepperFilePath> { | 20 struct ParamTraits<ppapi::PepperFilePath> { |
21 typedef webkit::ppapi::PepperFilePath param_type; | 21 typedef ppapi::PepperFilePath param_type; |
22 static void Write(Message* m, const param_type& p); | 22 static void Write(Message* m, const param_type& p); |
23 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | 23 static bool Read(const Message* m, PickleIterator* iter, param_type* p); |
24 static void Log(const param_type& p, std::string* l); | 24 static void Log(const param_type& p, std::string* l); |
25 }; | 25 }; |
26 | 26 |
27 } // namespace IPC | 27 } // namespace IPC |
28 | 28 |
29 #endif // CONTENT_COMMON_PEPPER_FILE_MESSAGES_H_ | 29 #endif // PPAPI_SHARED_IMPL_PEPPER_FILE_MESSAGES_H_ |
| 30 |
| 31 #undef IPC_MESSAGE_EXPORT |
| 32 #define IPC_MESSAGE_EXPORT PPAPI_PROXY_EXPORT |
30 | 33 |
31 #define IPC_MESSAGE_START PepperFileMsgStart | 34 #define IPC_MESSAGE_START PepperFileMsgStart |
32 | 35 |
33 IPC_STRUCT_TRAITS_BEGIN(webkit::ppapi::DirEntry) | 36 IPC_STRUCT_TRAITS_BEGIN(ppapi::DirEntry) |
34 IPC_STRUCT_TRAITS_MEMBER(name) | 37 IPC_STRUCT_TRAITS_MEMBER(name) |
35 IPC_STRUCT_TRAITS_MEMBER(is_dir) | 38 IPC_STRUCT_TRAITS_MEMBER(is_dir) |
36 IPC_STRUCT_TRAITS_END() | 39 IPC_STRUCT_TRAITS_END() |
37 | 40 |
38 // Trusted Pepper Filesystem messages from the renderer to the browser. | 41 // Trusted Pepper Filesystem messages from the renderer to the browser. |
39 | 42 |
40 // Open the file. | 43 // Open the file. |
41 IPC_SYNC_MESSAGE_CONTROL2_2(PepperFileMsg_OpenFile, | 44 IPC_SYNC_MESSAGE_CONTROL2_2(PepperFileMsg_OpenFile, |
42 webkit::ppapi::PepperFilePath /* path */, | 45 ppapi::PepperFilePath /* path */, |
43 int /* flags */, | 46 int /* flags */, |
44 base::PlatformFileError /* error_code */, | 47 base::PlatformFileError /* error_code */, |
45 IPC::PlatformFileForTransit /* result */) | 48 IPC::PlatformFileForTransit /* result */) |
46 | 49 |
47 // Rename the file. | 50 // Rename the file. |
48 IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_RenameFile, | 51 IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_RenameFile, |
49 webkit::ppapi::PepperFilePath /* from_path */, | 52 ppapi::PepperFilePath /* from_path */, |
50 webkit::ppapi::PepperFilePath /* to_path */, | 53 ppapi::PepperFilePath /* to_path */, |
51 base::PlatformFileError /* error_code */) | 54 base::PlatformFileError /* error_code */) |
52 | 55 |
53 // Delete the file. | 56 // Delete the file. |
54 IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_DeleteFileOrDir, | 57 IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_DeleteFileOrDir, |
55 webkit::ppapi::PepperFilePath /* path */, | 58 ppapi::PepperFilePath /* path */, |
56 bool /* recursive */, | 59 bool /* recursive */, |
57 base::PlatformFileError /* error_code */) | 60 base::PlatformFileError /* error_code */) |
58 | 61 |
59 // Create the directory. | 62 // Create the directory. |
60 IPC_SYNC_MESSAGE_CONTROL1_1(PepperFileMsg_CreateDir, | 63 IPC_SYNC_MESSAGE_CONTROL1_1(PepperFileMsg_CreateDir, |
61 webkit::ppapi::PepperFilePath /* path */, | 64 ppapi::PepperFilePath /* path */, |
62 base::PlatformFileError /* error_code */) | 65 base::PlatformFileError /* error_code */) |
63 | 66 |
64 // Query the file's info. | 67 // Query the file's info. |
65 IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_QueryFile, | 68 IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_QueryFile, |
66 webkit::ppapi::PepperFilePath /* path */, | 69 ppapi::PepperFilePath /* path */, |
67 base::PlatformFileInfo, /* info */ | 70 base::PlatformFileInfo, /* info */ |
68 base::PlatformFileError /* error_code */) | 71 base::PlatformFileError /* error_code */) |
69 | 72 |
70 // Get the directory's contents. | 73 // Get the directory's contents. |
71 IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_GetDirContents, | 74 IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_GetDirContents, |
72 webkit::ppapi::PepperFilePath /* path */, | 75 ppapi::PepperFilePath /* path */, |
73 webkit::ppapi::DirContents, /* contents */ | 76 ppapi::DirContents, /* contents */ |
74 base::PlatformFileError /* error_code */) | 77 base::PlatformFileError /* error_code */) |
75 | 78 |
OLD | NEW |