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 #include "components/nacl/common/nacl_types.h" | 5 #include "components/nacl/common/nacl_types.h" |
6 #include "ipc/ipc_platform_file.h" | 6 #include "ipc/ipc_platform_file.h" |
7 | 7 |
8 namespace nacl { | 8 namespace nacl { |
9 | 9 |
10 NaClStartParams::NaClStartParams() | 10 NaClStartParams::NaClStartParams() |
11 : nexe_file(IPC::InvalidPlatformFileForTransit()), | 11 : nexe_file(IPC::InvalidPlatformFileForTransit()), |
12 nexe_token_lo(0), | 12 nexe_token_lo(0), |
13 nexe_token_hi(0), | 13 nexe_token_hi(0), |
14 validation_cache_enabled(false), | 14 validation_cache_enabled(false), |
15 enable_debug_stub(false), | 15 enable_debug_stub(false), |
16 enable_ipc_proxy(false), | 16 enable_ipc_proxy(false), |
17 process_type(kUnknownNaClProcessType), | 17 process_type(kUnknownNaClProcessType), |
18 crash_info_shmem_handle(base::SharedMemory::NULLHandle()) { | 18 crash_info_shmem_handle(base::SharedMemory::NULLHandle()) { |
19 } | 19 } |
20 | 20 |
21 NaClStartParams::~NaClStartParams() { | 21 NaClStartParams::~NaClStartParams() { |
22 } | 22 } |
23 | 23 |
| 24 NaClStartParams::ResourceFileInfo::ResourceFileInfo() |
| 25 : file(IPC::InvalidPlatformFileForTransit()) { |
| 26 } |
| 27 |
| 28 NaClStartParams::ResourceFileInfo::ResourceFileInfo( |
| 29 IPC::PlatformFileForTransit file, |
| 30 const base::FilePath& file_path_metadata, |
| 31 const std::string& file_key) |
| 32 : file(file), file_path_metadata(file_path_metadata), file_key(file_key) { |
| 33 } |
| 34 |
| 35 NaClStartParams::ResourceFileInfo::~ResourceFileInfo() { |
| 36 } |
| 37 |
24 NaClLaunchParams::NaClLaunchParams() | 38 NaClLaunchParams::NaClLaunchParams() |
25 : nexe_file(IPC::InvalidPlatformFileForTransit()), | 39 : nexe_file(IPC::InvalidPlatformFileForTransit()), |
26 nexe_token_lo(0), | 40 nexe_token_lo(0), |
27 nexe_token_hi(0), | 41 nexe_token_hi(0), |
28 render_view_id(0), | 42 render_view_id(0), |
29 permission_bits(0), | 43 permission_bits(0), |
30 process_type(kUnknownNaClProcessType) { | 44 process_type(kUnknownNaClProcessType) { |
31 } | 45 } |
32 | 46 |
33 NaClLaunchParams::NaClLaunchParams( | 47 NaClLaunchParams::NaClLaunchParams( |
34 const std::string& manifest_url, | 48 const std::string& manifest_url, |
35 const IPC::PlatformFileForTransit& nexe_file, | 49 const IPC::PlatformFileForTransit& nexe_file, |
36 uint64_t nexe_token_lo, | 50 uint64_t nexe_token_lo, |
37 uint64_t nexe_token_hi, | 51 uint64_t nexe_token_hi, |
| 52 const std::vector<ResourceFileInfo>& resource_files_info, |
38 int render_view_id, | 53 int render_view_id, |
39 uint32 permission_bits, | 54 uint32 permission_bits, |
40 bool uses_nonsfi_mode, | 55 bool uses_nonsfi_mode, |
41 NaClAppProcessType process_type) | 56 NaClAppProcessType process_type) |
42 : manifest_url(manifest_url), | 57 : manifest_url(manifest_url), |
43 nexe_file(nexe_file), | 58 nexe_file(nexe_file), |
44 nexe_token_lo(nexe_token_lo), | 59 nexe_token_lo(nexe_token_lo), |
45 nexe_token_hi(nexe_token_hi), | 60 nexe_token_hi(nexe_token_hi), |
| 61 resource_files_info(resource_files_info), |
46 render_view_id(render_view_id), | 62 render_view_id(render_view_id), |
47 permission_bits(permission_bits), | 63 permission_bits(permission_bits), |
48 uses_nonsfi_mode(uses_nonsfi_mode), | 64 uses_nonsfi_mode(uses_nonsfi_mode), |
49 process_type(process_type) { | 65 process_type(process_type) { |
50 } | 66 } |
51 | 67 |
52 NaClLaunchParams::~NaClLaunchParams() { | 68 NaClLaunchParams::~NaClLaunchParams() { |
53 } | 69 } |
54 | 70 |
| 71 NaClLaunchParams::ResourceFileInfo::ResourceFileInfo() |
| 72 : file(IPC::InvalidPlatformFileForTransit()), |
| 73 file_token_lo(0), |
| 74 file_token_hi(0) { |
| 75 } |
| 76 |
| 77 NaClLaunchParams::ResourceFileInfo::ResourceFileInfo( |
| 78 IPC::PlatformFileForTransit file, |
| 79 uint64_t file_token_lo, |
| 80 uint64_t file_token_hi, |
| 81 const std::string& file_key) |
| 82 : file(file), |
| 83 file_token_lo(file_token_lo), |
| 84 file_token_hi(file_token_hi), |
| 85 file_key(file_key) { |
| 86 } |
| 87 |
| 88 NaClLaunchParams::ResourceFileInfo::~ResourceFileInfo() { |
| 89 } |
| 90 |
55 NaClLaunchResult::NaClLaunchResult() | 91 NaClLaunchResult::NaClLaunchResult() |
56 : imc_channel_handle(IPC::InvalidPlatformFileForTransit()), | 92 : imc_channel_handle(IPC::InvalidPlatformFileForTransit()), |
57 ppapi_ipc_channel_handle(), | 93 ppapi_ipc_channel_handle(), |
58 trusted_ipc_channel_handle(), | 94 trusted_ipc_channel_handle(), |
59 plugin_pid(base::kNullProcessId), | 95 plugin_pid(base::kNullProcessId), |
60 plugin_child_id(0), | 96 plugin_child_id(0), |
61 crash_info_shmem_handle(base::SharedMemory::NULLHandle()) { | 97 crash_info_shmem_handle(base::SharedMemory::NULLHandle()) { |
62 } | 98 } |
63 | 99 |
64 NaClLaunchResult::NaClLaunchResult( | 100 NaClLaunchResult::NaClLaunchResult( |
65 FileDescriptor imc_channel_handle, | 101 FileDescriptor imc_channel_handle, |
66 const IPC::ChannelHandle& ppapi_ipc_channel_handle, | 102 const IPC::ChannelHandle& ppapi_ipc_channel_handle, |
67 const IPC::ChannelHandle& trusted_ipc_channel_handle, | 103 const IPC::ChannelHandle& trusted_ipc_channel_handle, |
68 const IPC::ChannelHandle& manifest_service_ipc_channel_handle, | 104 const IPC::ChannelHandle& manifest_service_ipc_channel_handle, |
69 base::ProcessId plugin_pid, | 105 base::ProcessId plugin_pid, |
70 int plugin_child_id, | 106 int plugin_child_id, |
71 base::SharedMemoryHandle crash_info_shmem_handle) | 107 base::SharedMemoryHandle crash_info_shmem_handle) |
72 : imc_channel_handle(imc_channel_handle), | 108 : imc_channel_handle(imc_channel_handle), |
73 ppapi_ipc_channel_handle(ppapi_ipc_channel_handle), | 109 ppapi_ipc_channel_handle(ppapi_ipc_channel_handle), |
74 trusted_ipc_channel_handle(trusted_ipc_channel_handle), | 110 trusted_ipc_channel_handle(trusted_ipc_channel_handle), |
75 manifest_service_ipc_channel_handle(manifest_service_ipc_channel_handle), | 111 manifest_service_ipc_channel_handle(manifest_service_ipc_channel_handle), |
76 plugin_pid(plugin_pid), | 112 plugin_pid(plugin_pid), |
77 plugin_child_id(plugin_child_id), | 113 plugin_child_id(plugin_child_id), |
78 crash_info_shmem_handle(crash_info_shmem_handle) { | 114 crash_info_shmem_handle(crash_info_shmem_handle) { |
79 } | 115 } |
80 | 116 |
81 NaClLaunchResult::~NaClLaunchResult() { | 117 NaClLaunchResult::~NaClLaunchResult() { |
82 } | 118 } |
83 | 119 |
| 120 NaClOpenExecutableResult::NaClOpenExecutableResult() { |
| 121 } |
| 122 |
| 123 NaClOpenExecutableResult::NaClOpenExecutableResult( |
| 124 const NaClOpenExecutableResult::FileInfo& file_info, |
| 125 const std::vector<NaClOpenExecutableResult::FileInfo>& resource_files_info) |
| 126 : file_info(file_info), |
| 127 resource_files_info(resource_files_info) { |
| 128 } |
| 129 |
| 130 NaClOpenExecutableResult::~NaClOpenExecutableResult() { |
| 131 } |
| 132 |
| 133 NaClOpenExecutableResult::FileInfo::FileInfo() |
| 134 : file(IPC::InvalidPlatformFileForTransit()), |
| 135 file_token_lo(0), |
| 136 file_token_hi(0) { |
| 137 } |
| 138 |
| 139 NaClOpenExecutableResult::FileInfo::FileInfo(IPC::PlatformFileForTransit file, |
| 140 uint64_t file_token_lo, |
| 141 uint64_t file_token_hi) |
| 142 : file(file), |
| 143 file_token_lo(file_token_lo), |
| 144 file_token_hi(file_token_hi) { |
| 145 } |
| 146 |
| 147 NaClOpenExecutableResult::FileInfo::~FileInfo() { |
| 148 } |
| 149 |
84 } // namespace nacl | 150 } // namespace nacl |
OLD | NEW |