| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Defines messages between the browser and NaCl process. | 5 // Defines messages between the browser and NaCl process. |
| 6 | 6 |
| 7 // Multiply-included message file, no traditional include guard. | 7 // Multiply-included message file, no traditional include guard. |
| 8 #include "base/process/process.h" | 8 #include "base/process/process.h" |
| 9 #include "components/nacl/common/nacl_types.h" | 9 #include "components/nacl/common/nacl_types.h" |
| 10 #include "components/nacl/common/nacl_types_param_traits.h" | 10 #include "components/nacl/common/nacl_types_param_traits.h" |
| 11 #include "ipc/ipc_channel_handle.h" | 11 #include "ipc/ipc_channel_handle.h" |
| 12 #include "ipc/ipc_message_macros.h" | 12 #include "ipc/ipc_message_macros.h" |
| 13 #include "ipc/ipc_platform_file.h" | 13 #include "ipc/ipc_platform_file.h" |
| 14 | 14 |
| 15 #define IPC_MESSAGE_START NaClMsgStart | 15 #define IPC_MESSAGE_START NaClMsgStart |
| 16 | 16 |
| 17 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClStartParams) | 17 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClStartParams) |
| 18 IPC_STRUCT_TRAITS_MEMBER(nexe_file) | 18 IPC_STRUCT_TRAITS_MEMBER(nexe_file) |
| 19 IPC_STRUCT_TRAITS_MEMBER(nexe_file_path_metadata) | 19 IPC_STRUCT_TRAITS_MEMBER(nexe_file_path_metadata) |
| 20 IPC_STRUCT_TRAITS_MEMBER(prefetched_resource_files) | |
| 21 IPC_STRUCT_TRAITS_MEMBER(imc_bootstrap_handle) | 20 IPC_STRUCT_TRAITS_MEMBER(imc_bootstrap_handle) |
| 22 IPC_STRUCT_TRAITS_MEMBER(irt_handle) | 21 IPC_STRUCT_TRAITS_MEMBER(irt_handle) |
| 23 #if defined(OS_MACOSX) | 22 #if defined(OS_MACOSX) |
| 24 IPC_STRUCT_TRAITS_MEMBER(mac_shm_fd) | 23 IPC_STRUCT_TRAITS_MEMBER(mac_shm_fd) |
| 25 #endif | 24 #endif |
| 26 #if defined(OS_POSIX) | 25 #if defined(OS_POSIX) |
| 27 IPC_STRUCT_TRAITS_MEMBER(debug_stub_server_bound_socket) | 26 IPC_STRUCT_TRAITS_MEMBER(debug_stub_server_bound_socket) |
| 28 #endif | 27 #endif |
| 29 IPC_STRUCT_TRAITS_MEMBER(validation_cache_enabled) | 28 IPC_STRUCT_TRAITS_MEMBER(validation_cache_enabled) |
| 30 IPC_STRUCT_TRAITS_MEMBER(validation_cache_key) | 29 IPC_STRUCT_TRAITS_MEMBER(validation_cache_key) |
| 31 IPC_STRUCT_TRAITS_MEMBER(version) | 30 IPC_STRUCT_TRAITS_MEMBER(version) |
| 32 IPC_STRUCT_TRAITS_MEMBER(enable_debug_stub) | 31 IPC_STRUCT_TRAITS_MEMBER(enable_debug_stub) |
| 33 IPC_STRUCT_TRAITS_MEMBER(enable_ipc_proxy) | 32 IPC_STRUCT_TRAITS_MEMBER(enable_ipc_proxy) |
| 34 IPC_STRUCT_TRAITS_MEMBER(process_type) | 33 IPC_STRUCT_TRAITS_MEMBER(process_type) |
| 35 IPC_STRUCT_TRAITS_MEMBER(crash_info_shmem_handle) | 34 IPC_STRUCT_TRAITS_MEMBER(crash_info_shmem_handle) |
| 36 IPC_STRUCT_TRAITS_END() | 35 IPC_STRUCT_TRAITS_END() |
| 37 | 36 |
| 38 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClResourcePrefetchResult) | 37 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClResourcePrefetchResult) |
| 39 IPC_STRUCT_TRAITS_MEMBER(file) | 38 IPC_STRUCT_TRAITS_MEMBER(file) |
| 40 IPC_STRUCT_TRAITS_MEMBER(file_path_metadata) | 39 IPC_STRUCT_TRAITS_MEMBER(file_path_metadata) |
| 41 IPC_STRUCT_TRAITS_MEMBER(file_key) | 40 IPC_STRUCT_TRAITS_MEMBER(file_key) |
| 42 IPC_STRUCT_TRAITS_END() | 41 IPC_STRUCT_TRAITS_END() |
| 43 | 42 |
| 44 //----------------------------------------------------------------------------- | 43 //----------------------------------------------------------------------------- |
| 45 // NaClProcess messages | 44 // NaClProcess messages |
| 46 // These are messages sent between the browser and the NaCl process. | 45 // These are messages sent between the browser and the NaCl process. |
| 47 // Tells the NaCl process to start. | 46 |
| 47 // Sends a prefetched resource file to a NaCl loader process. This message |
| 48 // can be sent multiple times, but all of them must be done before sending |
| 49 // NaClProcessMsg_Start. |
| 50 IPC_MESSAGE_CONTROL1(NaClProcessMsg_AddPrefetchedResource, |
| 51 nacl::NaClResourcePrefetchResult) |
| 52 |
| 53 // Tells the NaCl process to start. This message can be sent only once. |
| 48 IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start, | 54 IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start, |
| 49 nacl::NaClStartParams /* params */) | 55 nacl::NaClStartParams /* params */) |
| 50 | 56 |
| 51 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
| 52 // Tells the NaCl broker to launch a NaCl loader process. | 58 // Tells the NaCl broker to launch a NaCl loader process. |
| 53 IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker, | 59 IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker, |
| 54 std::string /* channel ID for the loader */) | 60 std::string /* channel ID for the loader */) |
| 55 | 61 |
| 56 // Notify the browser process that the loader was launched successfully. | 62 // Notify the browser process that the loader was launched successfully. |
| 57 IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched, | 63 IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 IPC::PlatformFileForTransit, /* fd */ | 117 IPC::PlatformFileForTransit, /* fd */ |
| 112 base::FilePath /* Path opened to get fd */) | 118 base::FilePath /* Path opened to get fd */) |
| 113 | 119 |
| 114 // Notify the browser process that the server side of the PPAPI channel was | 120 // Notify the browser process that the server side of the PPAPI channel was |
| 115 // created successfully. | 121 // created successfully. |
| 116 IPC_MESSAGE_CONTROL4(NaClProcessHostMsg_PpapiChannelsCreated, | 122 IPC_MESSAGE_CONTROL4(NaClProcessHostMsg_PpapiChannelsCreated, |
| 117 IPC::ChannelHandle, /* browser_channel_handle */ | 123 IPC::ChannelHandle, /* browser_channel_handle */ |
| 118 IPC::ChannelHandle, /* ppapi_renderer_channel_handle */ | 124 IPC::ChannelHandle, /* ppapi_renderer_channel_handle */ |
| 119 IPC::ChannelHandle, /* trusted_renderer_channel_handle */ | 125 IPC::ChannelHandle, /* trusted_renderer_channel_handle */ |
| 120 IPC::ChannelHandle /* manifest_service_channel_handle */) | 126 IPC::ChannelHandle /* manifest_service_channel_handle */) |
| OLD | NEW |