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.
5 // Defines messages between the browser and NaCl process.
7 // Multiply-included message file, no traditional include guard.
8 #include "base/process.h"
9 #include "chrome/common/nacl_types.h"
10 #include "ipc/ipc_channel_handle.h"
11 #include "ipc/ipc_message_macros.h"
13 #define IPC_MESSAGE_START NaClMsgStart
15 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClStartParams
)
16 IPC_STRUCT_TRAITS_MEMBER(handles
)
17 IPC_STRUCT_TRAITS_MEMBER(debug_stub_server_bound_socket
)
18 IPC_STRUCT_TRAITS_MEMBER(validation_cache_enabled
)
19 IPC_STRUCT_TRAITS_MEMBER(validation_cache_key
)
20 IPC_STRUCT_TRAITS_MEMBER(version
)
21 IPC_STRUCT_TRAITS_MEMBER(enable_exception_handling
)
22 IPC_STRUCT_TRAITS_MEMBER(enable_debug_stub
)
23 IPC_STRUCT_TRAITS_MEMBER(enable_ipc_proxy
)
24 IPC_STRUCT_TRAITS_MEMBER(uses_irt
)
25 IPC_STRUCT_TRAITS_END()
27 //-----------------------------------------------------------------------------
28 // NaClProcess messages
29 // These are messages sent between the browser and the NaCl process.
30 // Tells the NaCl process to start.
31 IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start
,
32 nacl::NaClStartParams
/* params */)
35 // Tells the NaCl broker to launch a NaCl loader process.
36 IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker
,
37 std::string
/* channel ID for the loader */)
39 // Notify the browser process that the loader was launched successfully.
40 IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched
,
41 std::string
, /* channel ID for the loader */
42 base::ProcessHandle
/* loader process handle */)
44 // Tells the NaCl broker to attach a debug exception handler to the
45 // given NaCl loader process.
46 IPC_MESSAGE_CONTROL3(NaClProcessMsg_LaunchDebugExceptionHandler
,
47 int32
/* pid of the NaCl process */,
48 base::ProcessHandle
/* handle of the NaCl process */,
49 std::string
/* NaCl internal process layout info */)
51 // Notify the browser process that the broker process finished
52 // attaching a debug exception handler to the given NaCl loader
54 IPC_MESSAGE_CONTROL2(NaClProcessMsg_DebugExceptionHandlerLaunched
,
58 // Notify the broker that all loader processes have been terminated and it
60 IPC_MESSAGE_CONTROL0(NaClProcessMsg_StopBroker
)
62 // Used by the NaCl process to request that a Windows debug exception
63 // handler be attached to it.
64 IPC_SYNC_MESSAGE_CONTROL1_1(NaClProcessMsg_AttachDebugExceptionHandler
,
65 std::string
, /* Internal process info */
69 // Used by the NaCl process to query a database in the browser. The database
70 // contains the signatures of previously validated code chunks.
71 IPC_SYNC_MESSAGE_CONTROL1_1(NaClProcessMsg_QueryKnownToValidate
,
72 std::string
, /* A validation signature */
73 bool /* Can validation be skipped? */)
75 // Used by the NaCl process to add a validation signature to the validation
76 // database in the browser.
77 IPC_MESSAGE_CONTROL1(NaClProcessMsg_SetKnownToValidate
,
78 std::string
/* A validation signature */)
80 // Notify the browser process that the server side of the PPAPI channel was
81 // created successfully.
82 IPC_MESSAGE_CONTROL1(NaClProcessHostMsg_PpapiChannelCreated
,
83 IPC::ChannelHandle
/* channel_handle */)