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
3 // found in the LICENSE file.
5 // Defines messages between the browser and NaCl process.
7 // Multiply-included message file, no traditional include guard.
8 #include "base/process/process.h"
9 #include "components/nacl/common/nacl_types.h"
10 #include "ipc/ipc_channel_handle.h"
11 #include "ipc/ipc_message_macros.h"
12 #include "ipc/ipc_platform_file.h"
14 #define IPC_MESSAGE_START NaClMsgStart
16 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClStartParams
)
17 IPC_STRUCT_TRAITS_MEMBER(nexe_file
)
18 IPC_STRUCT_TRAITS_MEMBER(handles
)
19 IPC_STRUCT_TRAITS_MEMBER(debug_stub_server_bound_socket
)
20 IPC_STRUCT_TRAITS_MEMBER(validation_cache_enabled
)
21 IPC_STRUCT_TRAITS_MEMBER(validation_cache_key
)
22 IPC_STRUCT_TRAITS_MEMBER(version
)
23 IPC_STRUCT_TRAITS_MEMBER(enable_exception_handling
)
24 IPC_STRUCT_TRAITS_MEMBER(enable_debug_stub
)
25 IPC_STRUCT_TRAITS_MEMBER(enable_ipc_proxy
)
26 IPC_STRUCT_TRAITS_MEMBER(uses_irt
)
27 IPC_STRUCT_TRAITS_MEMBER(enable_dyncode_syscalls
)
28 IPC_STRUCT_TRAITS_END()
30 //-----------------------------------------------------------------------------
31 // NaClProcess messages
32 // These are messages sent between the browser and the NaCl process.
33 // Tells the NaCl process to start.
34 IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start
,
35 nacl::NaClStartParams
/* params */)
38 // Tells the NaCl broker to launch a NaCl loader process.
39 IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker
,
40 std::string
/* channel ID for the loader */)
42 // Notify the browser process that the loader was launched successfully.
43 IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched
,
44 std::string
, /* channel ID for the loader */
45 base::ProcessHandle
/* loader process handle */)
47 // Tells the NaCl broker to attach a debug exception handler to the
48 // given NaCl loader process.
49 IPC_MESSAGE_CONTROL3(NaClProcessMsg_LaunchDebugExceptionHandler
,
50 int32
/* pid of the NaCl process */,
51 base::ProcessHandle
/* handle of the NaCl process */,
52 std::string
/* NaCl internal process layout info */)
54 // Notify the browser process that the broker process finished
55 // attaching a debug exception handler to the given NaCl loader
57 IPC_MESSAGE_CONTROL2(NaClProcessMsg_DebugExceptionHandlerLaunched
,
61 // Notify the broker that all loader processes have been terminated and it
63 IPC_MESSAGE_CONTROL0(NaClProcessMsg_StopBroker
)
65 // Used by the NaCl process to request that a Windows debug exception
66 // handler be attached to it.
67 IPC_SYNC_MESSAGE_CONTROL1_1(NaClProcessMsg_AttachDebugExceptionHandler
,
68 std::string
, /* Internal process info */
71 // Notify the browser process that the NaCl process has bound the given
72 // TCP port number to use for the GDB debug stub.
73 IPC_MESSAGE_CONTROL1(NaClProcessHostMsg_DebugStubPortSelected
,
74 uint16_t /* debug_stub_port */)
77 // Used by the NaCl process to query a database in the browser. The database
78 // contains the signatures of previously validated code chunks.
79 IPC_SYNC_MESSAGE_CONTROL1_1(NaClProcessMsg_QueryKnownToValidate
,
80 std::string
, /* A validation signature */
81 bool /* Can validation be skipped? */)
83 // Used by the NaCl process to add a validation signature to the validation
84 // database in the browser.
85 IPC_MESSAGE_CONTROL1(NaClProcessMsg_SetKnownToValidate
,
86 std::string
/* A validation signature */)
88 // Used by the NaCl process to acquire trusted information about a file directly
89 // from the browser, including the file's path as well as a fresh version of the
91 IPC_SYNC_MESSAGE_CONTROL2_2(NaClProcessMsg_ResolveFileToken
,
92 uint64
, /* file_token_lo */
93 uint64
, /* file_token_hi */
94 IPC::PlatformFileForTransit
, /* fd */
95 base::FilePath
/* Path opened to get fd */)
97 // Notify the browser process that the server side of the PPAPI channel was
98 // created successfully.
99 IPC_MESSAGE_CONTROL4(NaClProcessHostMsg_PpapiChannelsCreated
,
100 IPC::ChannelHandle
, /* browser_channel_handle */
101 IPC::ChannelHandle
, /* ppapi_renderer_channel_handle */
102 IPC::ChannelHandle
, /* trusted_renderer_channel_handle */
103 IPC::ChannelHandle
/* manifest_service_channel_handle */)