| 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 <utility> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 13 #include "base/process/process_handle.h" | 14 #include "base/process/process_handle.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
| 16 #include "ipc/ipc_platform_file.h" | 17 #include "ipc/ipc_platform_file.h" |
| 17 | 18 |
| 18 #if defined(OS_POSIX) | 19 #if defined(OS_POSIX) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 60 |
| 60 // Parameters sent to the NaCl process when we start it. | 61 // Parameters sent to the NaCl process when we start it. |
| 61 struct NaClStartParams { | 62 struct NaClStartParams { |
| 62 NaClStartParams(); | 63 NaClStartParams(); |
| 63 ~NaClStartParams(); | 64 ~NaClStartParams(); |
| 64 | 65 |
| 65 IPC::PlatformFileForTransit nexe_file; | 66 IPC::PlatformFileForTransit nexe_file; |
| 66 // Used only as a key for validation caching. | 67 // Used only as a key for validation caching. |
| 67 base::FilePath nexe_file_path_metadata; | 68 base::FilePath nexe_file_path_metadata; |
| 68 | 69 |
| 70 std::vector<IPC::PlatformFileForTransit> resource_files; |
| 71 std::vector<std::string> resource_keys; |
| 72 // TODO(yusukes): Add |resource_files_metadata| for SFI-NaCl. |
| 73 |
| 69 std::vector<FileDescriptor> handles; | 74 std::vector<FileDescriptor> handles; |
| 70 FileDescriptor debug_stub_server_bound_socket; | 75 FileDescriptor debug_stub_server_bound_socket; |
| 71 | 76 |
| 72 bool validation_cache_enabled; | 77 bool validation_cache_enabled; |
| 73 std::string validation_cache_key; | 78 std::string validation_cache_key; |
| 74 // Chrome version string. Sending the version string over IPC avoids linkage | 79 // Chrome version string. Sending the version string over IPC avoids linkage |
| 75 // issues in cases where NaCl is not compiled into the main Chromium | 80 // issues in cases where NaCl is not compiled into the main Chromium |
| 76 // executable or DLL. | 81 // executable or DLL. |
| 77 std::string version; | 82 std::string version; |
| 78 | 83 |
| 79 bool enable_debug_stub; | 84 bool enable_debug_stub; |
| 80 bool enable_ipc_proxy; | 85 bool enable_ipc_proxy; |
| 81 | 86 |
| 82 NaClAppProcessType process_type; | 87 NaClAppProcessType process_type; |
| 83 | 88 |
| 84 // For NaCl <-> renderer crash information reporting. | 89 // For NaCl <-> renderer crash information reporting. |
| 85 base::SharedMemoryHandle crash_info_shmem_handle; | 90 base::SharedMemoryHandle crash_info_shmem_handle; |
| 86 | 91 |
| 87 // NOTE: Any new fields added here must also be added to the IPC | 92 // NOTE: Any new fields added here must also be added to the IPC |
| 88 // serialization in nacl_messages.h and (for POD fields) the constructor | 93 // serialization in nacl_messages.h and (for POD fields) the constructor |
| 89 // in nacl_types.cc. | 94 // in nacl_types.cc. |
| 90 }; | 95 }; |
| 91 | 96 |
| 92 // Parameters sent to the browser process to have it launch a NaCl process. | 97 // Parameters sent to the browser process to have it launch a NaCl process. |
| 93 // | 98 // |
| 94 // If you change this, you will also need to update the IPC serialization in | 99 // If you change this, you will also need to update the IPC serialization in |
| 95 // nacl_host_messages.h. | 100 // nacl_host_messages.h. |
| 96 struct NaClLaunchParams { | 101 struct NaClLaunchParams { |
| 97 NaClLaunchParams(); | 102 NaClLaunchParams(); |
| 98 NaClLaunchParams(const std::string& manifest_url, | 103 NaClLaunchParams( |
| 99 const IPC::PlatformFileForTransit& nexe_file, | 104 const std::string& manifest_url, |
| 100 uint64_t nexe_token_lo, | 105 const IPC::PlatformFileForTransit& nexe_file, |
| 101 uint64_t nexe_token_hi, | 106 uint64_t nexe_token_lo, |
| 102 int render_view_id, | 107 uint64_t nexe_token_hi, |
| 103 uint32 permission_bits, | 108 const std::vector<IPC::PlatformFileForTransit>& resource_files, |
| 104 bool uses_nonsfi_mode, | 109 const std::vector<std::pair<uint64_t, uint64_t> >& resource_file_tokens, |
| 105 NaClAppProcessType process_type); | 110 const std::vector<std::string>& resource_keys, |
| 111 int render_view_id, |
| 112 uint32 permission_bits, |
| 113 bool uses_nonsfi_mode, |
| 114 NaClAppProcessType process_type); |
| 106 ~NaClLaunchParams(); | 115 ~NaClLaunchParams(); |
| 107 | 116 |
| 108 std::string manifest_url; | 117 std::string manifest_url; |
| 109 // On Windows, the HANDLE passed here is valid in the renderer's context. | 118 // On Windows, the HANDLE passed here is valid in the renderer's context. |
| 110 // It's the responsibility of the browser to duplicate this handle properly | 119 // It's the responsibility of the browser to duplicate this handle properly |
| 111 // for passing it to the plugin. | 120 // for passing it to the plugin. |
| 112 IPC::PlatformFileForTransit nexe_file; | 121 IPC::PlatformFileForTransit nexe_file; |
| 113 uint64_t nexe_token_lo; | 122 uint64_t nexe_token_lo; |
| 114 uint64_t nexe_token_hi; | 123 uint64_t nexe_token_hi; |
| 115 | 124 |
| 125 std::vector<IPC::PlatformFileForTransit> resource_files; |
| 126 std::vector<std::pair<uint64_t, uint64_t> > resource_file_tokens; |
| 127 std::vector<std::string> resource_keys; |
| 128 |
| 116 int render_view_id; | 129 int render_view_id; |
| 117 uint32 permission_bits; | 130 uint32 permission_bits; |
| 118 bool uses_nonsfi_mode; | 131 bool uses_nonsfi_mode; |
| 119 | 132 |
| 120 NaClAppProcessType process_type; | 133 NaClAppProcessType process_type; |
| 121 }; | 134 }; |
| 122 | 135 |
| 123 struct NaClLaunchResult { | 136 struct NaClLaunchResult { |
| 124 NaClLaunchResult(); | 137 NaClLaunchResult(); |
| 125 NaClLaunchResult( | 138 NaClLaunchResult( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 145 // For plugin <-> renderer ManifestService communication. | 158 // For plugin <-> renderer ManifestService communication. |
| 146 IPC::ChannelHandle manifest_service_ipc_channel_handle; | 159 IPC::ChannelHandle manifest_service_ipc_channel_handle; |
| 147 | 160 |
| 148 base::ProcessId plugin_pid; | 161 base::ProcessId plugin_pid; |
| 149 int plugin_child_id; | 162 int plugin_child_id; |
| 150 | 163 |
| 151 // For NaCl <-> renderer crash information reporting. | 164 // For NaCl <-> renderer crash information reporting. |
| 152 base::SharedMemoryHandle crash_info_shmem_handle; | 165 base::SharedMemoryHandle crash_info_shmem_handle; |
| 153 }; | 166 }; |
| 154 | 167 |
| 168 struct NaClOpenExecutableResult { |
| 169 NaClOpenExecutableResult(); |
| 170 NaClOpenExecutableResult( |
| 171 IPC::PlatformFileForTransit file, |
| 172 uint64_t file_token_lo, |
| 173 uint64_t file_token_hi, |
| 174 const std::vector<IPC::PlatformFileForTransit>& resource_files, |
| 175 const std::vector<std::pair<uint64_t, uint64_t> >& resource_file_tokens); |
| 176 ~NaClOpenExecutableResult(); |
| 177 |
| 178 IPC::PlatformFileForTransit file; |
| 179 uint64_t file_token_lo; |
| 180 uint64_t file_token_hi; |
| 181 std::vector<IPC::PlatformFileForTransit> resource_files; |
| 182 std::vector<std::pair<uint64_t, uint64_t> > resource_file_tokens; |
| 183 }; |
| 184 |
| 155 } // namespace nacl | 185 } // namespace nacl |
| 156 | 186 |
| 157 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ | 187 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ |
| OLD | NEW |