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 // Multiply-included file, no traditional include guard.
9 #include "base/basictypes.h"
10 #include "base/process/process.h"
11 #include "build/build_config.h"
12 #include "components/nacl/common/nacl_types.h"
13 #include "components/nacl/common/pnacl_types.h"
14 #include "content/public/common/common_param_traits.h"
15 #include "ipc/ipc_channel_handle.h"
16 #include "ipc/ipc_message_macros.h"
17 #include "ipc/ipc_platform_file.h"
20 #define IPC_MESSAGE_START NaClHostMsgStart
22 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClLaunchParams
)
23 IPC_STRUCT_TRAITS_MEMBER(manifest_url
)
24 IPC_STRUCT_TRAITS_MEMBER(nexe_file
)
25 IPC_STRUCT_TRAITS_MEMBER(render_view_id
)
26 IPC_STRUCT_TRAITS_MEMBER(permission_bits
)
27 IPC_STRUCT_TRAITS_MEMBER(uses_irt
)
28 IPC_STRUCT_TRAITS_MEMBER(uses_nonsfi_mode
)
29 IPC_STRUCT_TRAITS_MEMBER(enable_dyncode_syscalls
)
30 IPC_STRUCT_TRAITS_MEMBER(enable_exception_handling
)
31 IPC_STRUCT_TRAITS_MEMBER(enable_crash_throttling
)
32 IPC_STRUCT_TRAITS_END()
34 IPC_STRUCT_TRAITS_BEGIN(nacl::NaClLaunchResult
)
35 IPC_STRUCT_TRAITS_MEMBER(imc_channel_handle
)
36 IPC_STRUCT_TRAITS_MEMBER(ppapi_ipc_channel_handle
)
37 IPC_STRUCT_TRAITS_MEMBER(trusted_ipc_channel_handle
)
38 IPC_STRUCT_TRAITS_MEMBER(manifest_service_ipc_channel_handle
)
39 IPC_STRUCT_TRAITS_MEMBER(plugin_pid
)
40 IPC_STRUCT_TRAITS_MEMBER(plugin_child_id
)
41 IPC_STRUCT_TRAITS_END()
43 IPC_STRUCT_TRAITS_BEGIN(nacl::PnaclCacheInfo
)
44 IPC_STRUCT_TRAITS_MEMBER(pexe_url
)
45 IPC_STRUCT_TRAITS_MEMBER(abi_version
)
46 IPC_STRUCT_TRAITS_MEMBER(opt_level
)
47 IPC_STRUCT_TRAITS_MEMBER(last_modified
)
48 IPC_STRUCT_TRAITS_MEMBER(etag
)
49 IPC_STRUCT_TRAITS_MEMBER(has_no_store_header
)
50 IPC_STRUCT_TRAITS_MEMBER(sandbox_isa
)
51 IPC_STRUCT_TRAITS_MEMBER(extra_flags
)
52 IPC_STRUCT_TRAITS_END()
54 // A renderer sends this to the browser process when it wants to start
55 // a new instance of the Native Client process. The browser will launch
56 // the process and return an IPC channel handle. This handle will only
57 // be valid if the NaCl IPC proxy is enabled.
58 IPC_SYNC_MESSAGE_CONTROL1_2(NaClHostMsg_LaunchNaCl
,
59 nacl::NaClLaunchParams
/* launch_params */,
60 nacl::NaClLaunchResult
/* launch_result */,
61 std::string
/* error_message */)
63 // A renderer sends this to the browser process when it wants to
64 // open a file for from the Pnacl component directory.
65 IPC_SYNC_MESSAGE_CONTROL1_1(NaClHostMsg_GetReadonlyPnaclFD
,
66 std::string
/* name of requested PNaCl file */,
67 IPC::PlatformFileForTransit
/* output file */)
69 // A renderer sends this to the browser process when it wants to
70 // create a temporary file.
71 IPC_SYNC_MESSAGE_CONTROL0_1(NaClHostMsg_NaClCreateTemporaryFile
,
72 IPC::PlatformFileForTransit
/* out file */)
74 // A renderer sends this to the browser to request a file descriptor for
76 IPC_MESSAGE_CONTROL3(NaClHostMsg_NexeTempFileRequest
,
77 int /* render_view_id */,
79 nacl::PnaclCacheInfo
/* cache info */)
81 // The browser replies to a renderer's temp file request with output_file,
82 // which is either a writeable temp file to use for translation, or a
83 // read-only file containing the translated nexe from the cache.
84 IPC_MESSAGE_CONTROL3(NaClViewMsg_NexeTempFileReply
,
86 bool /* is_cache_hit */,
87 IPC::PlatformFileForTransit
/* output file */)
89 // A renderer sends this to the browser to report that its translation has
90 // finished and its temp file contains the translated nexe.
91 IPC_MESSAGE_CONTROL2(NaClHostMsg_ReportTranslationFinished
,
95 // A renderer sends this to the browser process to report when the client
96 // architecture is not listed in the manifest.
97 IPC_MESSAGE_CONTROL1(NaClHostMsg_MissingArchError
,
98 int /* render_view_id */)
100 // A renderer sends this to the browser process when it wants to
101 // open a NaCl executable file from an installed application directory.
102 IPC_SYNC_MESSAGE_CONTROL2_3(NaClHostMsg_OpenNaClExecutable
,
103 int /* render_view_id */,
104 GURL
/* URL of NaCl executable file */,
105 IPC::PlatformFileForTransit
/* output file */,
106 uint64
/* file_token_lo */,
107 uint64
/* file_token_hi */)
109 // A renderer sends this to the browser process to determine how many
110 // processors are online.
111 IPC_SYNC_MESSAGE_CONTROL0_1(NaClHostMsg_NaClGetNumProcessors
,
112 int /* Number of processors */)
114 // A renderer sends this to the browser process to determine if the
115 // NaCl application started from the given NMF URL will be debugged.
116 // If not (filtered out by commandline flags), it sets should_debug to false.
117 IPC_SYNC_MESSAGE_CONTROL1_1(NaClHostMsg_NaClDebugEnabledForURL
,
118 GURL
/* alleged URL of NMF file */,
119 bool /* should debug */)