nacl_host_messages.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.
  4. // Multiply-included file, no traditional include guard.
  5. // no-include-guard-because-multiply-included
  6. #include <stdint.h>
  7. #include <string>
  8. #include "base/process/process.h"
  9. #include "build/build_config.h"
  10. #include "components/nacl/common/nacl_types.h"
  11. #include "components/nacl/common/nacl_types_param_traits.h"
  12. #include "components/nacl/common/pnacl_types.h"
  13. #include "ipc/ipc_channel_handle.h"
  14. #include "ipc/ipc_message_macros.h"
  15. #include "ipc/ipc_message_start.h"
  16. #include "ipc/ipc_platform_file.h"
  17. #include "url/gurl.h"
  18. #include "url/ipc/url_param_traits.h"
  19. #define IPC_MESSAGE_START NaClHostMsgStart
  20. IPC_STRUCT_TRAITS_BEGIN(nacl::NaClResourcePrefetchRequest)
  21. IPC_STRUCT_TRAITS_MEMBER(file_key)
  22. IPC_STRUCT_TRAITS_MEMBER(resource_url)
  23. IPC_STRUCT_TRAITS_END()
  24. IPC_STRUCT_TRAITS_BEGIN(nacl::NaClLaunchParams)
  25. IPC_STRUCT_TRAITS_MEMBER(manifest_url)
  26. IPC_STRUCT_TRAITS_MEMBER(nexe_file)
  27. IPC_STRUCT_TRAITS_MEMBER(nexe_token_lo)
  28. IPC_STRUCT_TRAITS_MEMBER(nexe_token_hi)
  29. IPC_STRUCT_TRAITS_MEMBER(resource_prefetch_request_list)
  30. IPC_STRUCT_TRAITS_MEMBER(render_frame_id)
  31. IPC_STRUCT_TRAITS_MEMBER(permission_bits)
  32. IPC_STRUCT_TRAITS_MEMBER(process_type)
  33. IPC_STRUCT_TRAITS_END()
  34. IPC_STRUCT_TRAITS_BEGIN(nacl::NaClLaunchResult)
  35. IPC_STRUCT_TRAITS_MEMBER(ppapi_ipc_channel_handle)
  36. IPC_STRUCT_TRAITS_MEMBER(trusted_ipc_channel_handle)
  37. IPC_STRUCT_TRAITS_MEMBER(manifest_service_ipc_channel_handle)
  38. IPC_STRUCT_TRAITS_MEMBER(plugin_pid)
  39. IPC_STRUCT_TRAITS_MEMBER(plugin_child_id)
  40. IPC_STRUCT_TRAITS_MEMBER(crash_info_shmem_region)
  41. IPC_STRUCT_TRAITS_END()
  42. IPC_STRUCT_TRAITS_BEGIN(nacl::PnaclCacheInfo)
  43. IPC_STRUCT_TRAITS_MEMBER(pexe_url)
  44. IPC_STRUCT_TRAITS_MEMBER(abi_version)
  45. IPC_STRUCT_TRAITS_MEMBER(opt_level)
  46. IPC_STRUCT_TRAITS_MEMBER(last_modified)
  47. IPC_STRUCT_TRAITS_MEMBER(etag)
  48. IPC_STRUCT_TRAITS_MEMBER(has_no_store_header)
  49. IPC_STRUCT_TRAITS_MEMBER(use_subzero)
  50. IPC_STRUCT_TRAITS_MEMBER(sandbox_isa)
  51. IPC_STRUCT_TRAITS_MEMBER(extra_flags)
  52. IPC_STRUCT_TRAITS_END()
  53. // A renderer sends this to the browser process when it wants to start
  54. // a new instance of the Native Client process. The browser will launch
  55. // the process and return an IPC channel handle. This handle will only
  56. // be valid if the NaCl IPC proxy is enabled.
  57. IPC_SYNC_MESSAGE_CONTROL1_2(NaClHostMsg_LaunchNaCl,
  58. nacl::NaClLaunchParams /* launch_params */,
  59. nacl::NaClLaunchResult /* launch_result */,
  60. std::string /* error_message */)
  61. // A renderer sends this to the browser process when it wants to
  62. // open a file for from the Pnacl component directory.
  63. IPC_SYNC_MESSAGE_CONTROL2_3(NaClHostMsg_GetReadonlyPnaclFD,
  64. std::string /* name of requested PNaCl file */,
  65. bool /* is_executable */,
  66. IPC::PlatformFileForTransit /* output file */,
  67. uint64_t /* file_token_lo */,
  68. uint64_t /* file_token_hi */)
  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 */)
  73. // A renderer sends this to the browser to request a file descriptor for
  74. // a translated nexe.
  75. IPC_MESSAGE_CONTROL2(NaClHostMsg_NexeTempFileRequest,
  76. int /* instance */,
  77. nacl::PnaclCacheInfo /* cache info */)
  78. // The browser replies to a renderer's temp file request with output_file,
  79. // which is either a writeable temp file to use for translation, or a
  80. // read-only file containing the translated nexe from the cache.
  81. IPC_MESSAGE_CONTROL3(NaClViewMsg_NexeTempFileReply,
  82. int /* instance */,
  83. bool /* is_cache_hit */,
  84. IPC::PlatformFileForTransit /* output file */)
  85. // A renderer sends this to the browser to report that its translation has
  86. // finished and its temp file contains the translated nexe.
  87. IPC_MESSAGE_CONTROL2(NaClHostMsg_ReportTranslationFinished,
  88. int /* instance */,
  89. bool /* success */)
  90. // A renderer sends this to the browser process to report when the client
  91. // architecture is not listed in the manifest.
  92. IPC_MESSAGE_CONTROL1(NaClHostMsg_MissingArchError, int /* render_frame_id */)
  93. // A renderer sends this to the browser process when it wants to
  94. // open a NaCl executable file from an installed application directory.
  95. IPC_SYNC_MESSAGE_CONTROL2_3(NaClHostMsg_OpenNaClExecutable,
  96. int /* render_frame_id */,
  97. GURL /* URL of NaCl executable file */,
  98. IPC::PlatformFileForTransit /* output file */,
  99. uint64_t /* file_token_lo */,
  100. uint64_t /* file_token_hi */)
  101. // A renderer sends this to the browser process to determine how many
  102. // processors are online.
  103. IPC_SYNC_MESSAGE_CONTROL0_1(NaClHostMsg_NaClGetNumProcessors,
  104. int /* Number of processors */)
  105. // A renderer sends this to the browser process to determine if the
  106. // NaCl application started from the given NMF URL will be debugged.
  107. // If not (filtered out by commandline flags), it sets should_debug to false.
  108. IPC_SYNC_MESSAGE_CONTROL1_1(NaClHostMsg_NaClDebugEnabledForURL,
  109. GURL /* alleged URL of NMF file */,
  110. bool /* should debug */)