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 // Multiply-included message file, no traditional include guard. |
| 6 #include "ipc/ipc_message_macros.h" |
| 7 #include "ipc/ipc_param_traits.h" |
| 8 #include "ipc/ipc_platform_file.h" |
| 9 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 10 #include "ppapi/shared_impl/dir_contents.h" |
| 11 #include "ppapi/shared_impl/file_path.h" |
| 12 |
| 13 // Singly-included section since need custom serialization. |
| 14 #ifndef PPAPI_SHARED_IMPL_PEPPER_FILE_MESSAGES_H_ |
| 15 #define PPAPI_SHARED_IMPL_PEPPER_FILE_MESSAGES_H_ |
| 16 |
| 17 namespace IPC { |
| 18 |
| 19 template <> |
| 20 struct ParamTraits<ppapi::PepperFilePath> { |
| 21 typedef ppapi::PepperFilePath param_type; |
| 22 static void Write(Message* m, const 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); |
| 25 }; |
| 26 |
| 27 } // namespace IPC |
| 28 |
| 29 #endif // PPAPI_SHARED_IMPL_PEPPER_FILE_MESSAGES_H_ |
| 30 |
| 31 #undef IPC_MESSAGE_EXPORT |
| 32 #define IPC_MESSAGE_EXPORT PPAPI_PROXY_EXPORT |
| 33 |
| 34 #define IPC_MESSAGE_START PepperFileMsgStart |
| 35 |
| 36 IPC_STRUCT_TRAITS_BEGIN(ppapi::DirEntry) |
| 37 IPC_STRUCT_TRAITS_MEMBER(name) |
| 38 IPC_STRUCT_TRAITS_MEMBER(is_dir) |
| 39 IPC_STRUCT_TRAITS_END() |
| 40 |
| 41 // Trusted Pepper Filesystem messages from the renderer to the browser. |
| 42 |
| 43 // Open the file. |
| 44 IPC_SYNC_MESSAGE_CONTROL2_2(PepperFileMsg_OpenFile, |
| 45 ppapi::PepperFilePath /* path */, |
| 46 int /* flags */, |
| 47 base::PlatformFileError /* error_code */, |
| 48 IPC::PlatformFileForTransit /* result */) |
| 49 |
| 50 // Rename the file. |
| 51 IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_RenameFile, |
| 52 ppapi::PepperFilePath /* from_path */, |
| 53 ppapi::PepperFilePath /* to_path */, |
| 54 base::PlatformFileError /* error_code */) |
| 55 |
| 56 // Delete the file. |
| 57 IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_DeleteFileOrDir, |
| 58 ppapi::PepperFilePath /* path */, |
| 59 bool /* recursive */, |
| 60 base::PlatformFileError /* error_code */) |
| 61 |
| 62 // Create the directory. |
| 63 IPC_SYNC_MESSAGE_CONTROL1_1(PepperFileMsg_CreateDir, |
| 64 ppapi::PepperFilePath /* path */, |
| 65 base::PlatformFileError /* error_code */) |
| 66 |
| 67 // Query the file's info. |
| 68 IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_QueryFile, |
| 69 ppapi::PepperFilePath /* path */, |
| 70 base::PlatformFileInfo, /* info */ |
| 71 base::PlatformFileError /* error_code */) |
| 72 |
| 73 // Get the directory's contents. |
| 74 IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_GetDirContents, |
| 75 ppapi::PepperFilePath /* path */, |
| 76 ppapi::DirContents, /* contents */ |
| 77 base::PlatformFileError /* error_code */) |
| 78 |
| 79 // Create a temporary file. |
| 80 IPC_SYNC_MESSAGE_CONTROL0_2(PepperFileMsg_CreateTemporaryFile, |
| 81 base::PlatformFileError /* error_code */, |
| 82 IPC::PlatformFileForTransit /* file */) |
OLD | NEW |