| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_NACL_COMMON_NACL_TYPES_H_ | 5 #ifndef COMPONENTS_NACL_COMMON_NACL_TYPES_H_ |
| 6 #define COMPONENTS_NACL_COMMON_NACL_TYPES_H_ | 6 #define COMPONENTS_NACL_COMMON_NACL_TYPES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/process/process_handle.h" | 12 #include "base/process/process_handle.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "ipc/ipc_channel.h" | 14 #include "ipc/ipc_channel.h" |
| 15 #include "ipc/ipc_platform_file.h" |
| 15 | 16 |
| 16 #if defined(OS_POSIX) | 17 #if defined(OS_POSIX) |
| 17 #include "base/file_descriptor_posix.h" | 18 #include "base/file_descriptor_posix.h" |
| 18 #endif | 19 #endif |
| 19 | 20 |
| 20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 21 #include <windows.h> // for HANDLE | 22 #include <windows.h> // for HANDLE |
| 22 #endif | 23 #endif |
| 23 | 24 |
| 24 // TODO(gregoryd): add a Windows definition for base::FileDescriptor | 25 // TODO(gregoryd): add a Windows definition for base::FileDescriptor |
| (...skipping 10 matching lines...) Expand all Loading... |
| 35 return desc.fd; | 36 return desc.fd; |
| 36 } | 37 } |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 | 40 |
| 40 // Parameters sent to the NaCl process when we start it. | 41 // Parameters sent to the NaCl process when we start it. |
| 41 struct NaClStartParams { | 42 struct NaClStartParams { |
| 42 NaClStartParams(); | 43 NaClStartParams(); |
| 43 ~NaClStartParams(); | 44 ~NaClStartParams(); |
| 44 | 45 |
| 46 IPC::PlatformFileForTransit nexe_file; |
| 47 uint64_t nexe_token_lo; |
| 48 uint64_t nexe_token_hi; |
| 49 |
| 45 std::vector<FileDescriptor> handles; | 50 std::vector<FileDescriptor> handles; |
| 46 FileDescriptor debug_stub_server_bound_socket; | 51 FileDescriptor debug_stub_server_bound_socket; |
| 47 | 52 |
| 48 bool validation_cache_enabled; | 53 bool validation_cache_enabled; |
| 49 std::string validation_cache_key; | 54 std::string validation_cache_key; |
| 50 // Chrome version string. Sending the version string over IPC avoids linkage | 55 // Chrome version string. Sending the version string over IPC avoids linkage |
| 51 // issues in cases where NaCl is not compiled into the main Chromium | 56 // issues in cases where NaCl is not compiled into the main Chromium |
| 52 // executable or DLL. | 57 // executable or DLL. |
| 53 std::string version; | 58 std::string version; |
| 54 | 59 |
| 55 bool enable_exception_handling; | 60 bool enable_exception_handling; |
| 56 bool enable_debug_stub; | 61 bool enable_debug_stub; |
| 57 bool enable_ipc_proxy; | 62 bool enable_ipc_proxy; |
| 58 bool uses_irt; | 63 bool uses_irt; |
| 59 bool enable_dyncode_syscalls; | 64 bool enable_dyncode_syscalls; |
| 60 // NOTE: Any new fields added here must also be added to the IPC | 65 // NOTE: Any new fields added here must also be added to the IPC |
| 61 // serialization in nacl_messages.h and (for POD fields) the constructor | 66 // serialization in nacl_messages.h and (for POD fields) the constructor |
| 62 // in nacl_types.cc. | 67 // in nacl_types.cc. |
| 63 }; | 68 }; |
| 64 | 69 |
| 65 // Parameters sent to the browser process to have it launch a NaCl process. | 70 // Parameters sent to the browser process to have it launch a NaCl process. |
| 66 // | 71 // |
| 67 // If you change this, you will also need to update the IPC serialization in | 72 // If you change this, you will also need to update the IPC serialization in |
| 68 // nacl_host_messages.h. | 73 // nacl_host_messages.h. |
| 69 struct NaClLaunchParams { | 74 struct NaClLaunchParams { |
| 70 NaClLaunchParams(); | 75 NaClLaunchParams(); |
| 71 NaClLaunchParams(const std::string& u, int r, uint32 p, | 76 NaClLaunchParams(const std::string& manifest_url, |
| 77 const IPC::PlatformFileForTransit& nexe_file, |
| 78 uint64_t nexe_token_lo, |
| 79 uint64_t nexe_token_hi, |
| 80 int render_view_id, |
| 81 uint32 permission_bits, |
| 72 bool uses_irt, | 82 bool uses_irt, |
| 73 bool uses_nonsfi_mode, | 83 bool uses_nonsfi_mode, |
| 74 bool enable_dyncode_syscalls, | 84 bool enable_dyncode_syscalls, |
| 75 bool enable_exception_handling, | 85 bool enable_exception_handling, |
| 76 bool enable_crash_throttling); | 86 bool enable_crash_throttling); |
| 77 NaClLaunchParams(const NaClLaunchParams& l); | 87 NaClLaunchParams(const NaClLaunchParams& l); |
| 78 ~NaClLaunchParams(); | 88 ~NaClLaunchParams(); |
| 79 | 89 |
| 80 std::string manifest_url; | 90 std::string manifest_url; |
| 91 IPC::PlatformFileForTransit nexe_file; |
| 92 uint64_t nexe_token_lo; |
| 93 uint64_t nexe_token_hi; |
| 81 int render_view_id; | 94 int render_view_id; |
| 82 uint32 permission_bits; | 95 uint32 permission_bits; |
| 83 bool uses_irt; | 96 bool uses_irt; |
| 84 bool uses_nonsfi_mode; | 97 bool uses_nonsfi_mode; |
| 85 bool enable_dyncode_syscalls; | 98 bool enable_dyncode_syscalls; |
| 86 bool enable_exception_handling; | 99 bool enable_exception_handling; |
| 87 bool enable_crash_throttling; | 100 bool enable_crash_throttling; |
| 88 }; | 101 }; |
| 89 | 102 |
| 90 struct NaClLaunchResult { | 103 struct NaClLaunchResult { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 111 // For plugin <-> renderer ManifestService communication. | 124 // For plugin <-> renderer ManifestService communication. |
| 112 IPC::ChannelHandle manifest_service_ipc_channel_handle; | 125 IPC::ChannelHandle manifest_service_ipc_channel_handle; |
| 113 | 126 |
| 114 base::ProcessId plugin_pid; | 127 base::ProcessId plugin_pid; |
| 115 int plugin_child_id; | 128 int plugin_child_id; |
| 116 }; | 129 }; |
| 117 | 130 |
| 118 } // namespace nacl | 131 } // namespace nacl |
| 119 | 132 |
| 120 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ | 133 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ |
| OLD | NEW |