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_END()
26 //-----------------------------------------------------------------------------
27 // NaClProcess messages
28 // These are messages sent between the browser and the NaCl process.
29 // Tells the NaCl process to start.
30 IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start
,
31 nacl::NaClStartParams
/* params */)
34 // Tells the NaCl broker to launch a NaCl loader process.
35 IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker
,
36 std::string
/* channel ID for the loader */)
38 // Notify the browser process that the loader was launched successfully.
39 IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched
,
40 std::string
, /* channel ID for the loader */
41 base::ProcessHandle
/* loader process handle */)
43 // Tells the NaCl broker to attach a debug exception handler to the
44 // given NaCl loader process.
45 IPC_MESSAGE_CONTROL3(NaClProcessMsg_LaunchDebugExceptionHandler
,
46 int32
/* pid of the NaCl process */,
47 base::ProcessHandle
/* handle of the NaCl process */,
48 std::string
/* NaCl internal process layout info */)
50 // Notify the browser process that the broker process finished
51 // attaching a debug exception handler to the given NaCl loader
53 IPC_MESSAGE_CONTROL2(NaClProcessMsg_DebugExceptionHandlerLaunched
,
57 // Notify the broker that all loader processes have been terminated and it
59 IPC_MESSAGE_CONTROL0(NaClProcessMsg_StopBroker
)
61 // Used by the NaCl process to request that a Windows debug exception
62 // handler be attached to it.
63 IPC_SYNC_MESSAGE_CONTROL1_1(NaClProcessMsg_AttachDebugExceptionHandler
,
64 std::string
, /* Internal process info */
68 // Used by the NaCl process to query a database in the browser. The database
69 // contains the signatures of previously validated code chunks.
70 IPC_SYNC_MESSAGE_CONTROL1_1(NaClProcessMsg_QueryKnownToValidate
,
71 std::string
, /* A validation signature */
72 bool /* Can validation be skipped? */)
74 // Used by the NaCl process to add a validation signature to the validation
75 // database in the browser.
76 IPC_MESSAGE_CONTROL1(NaClProcessMsg_SetKnownToValidate
,
77 std::string
/* A validation signature */)
79 // Notify the browser process that the server side of the PPAPI channel was
80 // created successfully.
81 IPC_MESSAGE_CONTROL1(NaClProcessHostMsg_PpapiChannelCreated
,
82 IPC::ChannelHandle
/* channel_handle */)