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
5 #include "build/build_config.h"
6 #include "components/nacl/common/nacl_types.h"
7 #include "ipc/ipc_platform_file.h"
8
9 namespace nacl {
10
NaClStartParams()11 NaClStartParams::NaClStartParams()
12 : nexe_file(IPC::InvalidPlatformFileForTransit()),
13 irt_handle(IPC::InvalidPlatformFileForTransit()),
14 #if defined(OS_POSIX)
15 debug_stub_server_bound_socket(IPC::InvalidPlatformFileForTransit()),
16 #endif
17 validation_cache_enabled(false),
18 enable_debug_stub(false),
19 process_type(kUnknownNaClProcessType) {
20 }
21
22 NaClStartParams::NaClStartParams(NaClStartParams&& other) = default;
23
~NaClStartParams()24 NaClStartParams::~NaClStartParams() {
25 }
26
NaClResourcePrefetchResult()27 NaClResourcePrefetchResult::NaClResourcePrefetchResult()
28 : file(IPC::InvalidPlatformFileForTransit()) {
29 }
30
NaClResourcePrefetchResult(const IPC::PlatformFileForTransit & file,const base::FilePath & file_path_metadata,const std::string & file_key)31 NaClResourcePrefetchResult::NaClResourcePrefetchResult(
32 const IPC::PlatformFileForTransit& file,
33 const base::FilePath& file_path_metadata,
34 const std::string& file_key)
35 : file(file), file_path_metadata(file_path_metadata), file_key(file_key) {
36 }
37
~NaClResourcePrefetchResult()38 NaClResourcePrefetchResult::~NaClResourcePrefetchResult() {
39 }
40
NaClResourcePrefetchRequest()41 NaClResourcePrefetchRequest::NaClResourcePrefetchRequest() {
42 }
43
NaClResourcePrefetchRequest(const std::string & file_key,const std::string & resource_url)44 NaClResourcePrefetchRequest::NaClResourcePrefetchRequest(
45 const std::string& file_key,
46 const std::string& resource_url)
47 : file_key(file_key),
48 resource_url(resource_url) {
49 }
50
~NaClResourcePrefetchRequest()51 NaClResourcePrefetchRequest::~NaClResourcePrefetchRequest() {
52 }
53
NaClLaunchParams()54 NaClLaunchParams::NaClLaunchParams()
55 : nexe_file(IPC::InvalidPlatformFileForTransit()),
56 nexe_token_lo(0),
57 nexe_token_hi(0),
58 render_view_id(0),
59 permission_bits(0),
60 process_type(kUnknownNaClProcessType) {
61 }
62
NaClLaunchParams(const std::string & manifest_url,const IPC::PlatformFileForTransit & nexe_file,uint64_t nexe_token_lo,uint64_t nexe_token_hi,const std::vector<NaClResourcePrefetchRequest> & resource_prefetch_request_list,int render_view_id,uint32_t permission_bits,bool uses_nonsfi_mode,NaClAppProcessType process_type)63 NaClLaunchParams::NaClLaunchParams(
64 const std::string& manifest_url,
65 const IPC::PlatformFileForTransit& nexe_file,
66 uint64_t nexe_token_lo,
67 uint64_t nexe_token_hi,
68 const std::vector<NaClResourcePrefetchRequest>&
69 resource_prefetch_request_list,
70 int render_view_id,
71 uint32_t permission_bits,
72 bool uses_nonsfi_mode,
73 NaClAppProcessType process_type)
74 : manifest_url(manifest_url),
75 nexe_file(nexe_file),
76 nexe_token_lo(nexe_token_lo),
77 nexe_token_hi(nexe_token_hi),
78 resource_prefetch_request_list(resource_prefetch_request_list),
79 render_view_id(render_view_id),
80 permission_bits(permission_bits),
81 uses_nonsfi_mode(uses_nonsfi_mode),
82 process_type(process_type) {}
83
84 NaClLaunchParams::NaClLaunchParams(const NaClLaunchParams& other) = default;
85
~NaClLaunchParams()86 NaClLaunchParams::~NaClLaunchParams() {
87 }
88
NaClLaunchResult()89 NaClLaunchResult::NaClLaunchResult()
90 : ppapi_ipc_channel_handle(),
91 trusted_ipc_channel_handle(),
92 plugin_pid(base::kNullProcessId),
93 plugin_child_id(0) {}
94
NaClLaunchResult(const IPC::ChannelHandle & ppapi_ipc_channel_handle,const IPC::ChannelHandle & trusted_ipc_channel_handle,const IPC::ChannelHandle & manifest_service_ipc_channel_handle,base::ProcessId plugin_pid,int plugin_child_id,base::ReadOnlySharedMemoryRegion crash_info_shmem_region)95 NaClLaunchResult::NaClLaunchResult(
96 const IPC::ChannelHandle& ppapi_ipc_channel_handle,
97 const IPC::ChannelHandle& trusted_ipc_channel_handle,
98 const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
99 base::ProcessId plugin_pid,
100 int plugin_child_id,
101 base::ReadOnlySharedMemoryRegion crash_info_shmem_region)
102 : ppapi_ipc_channel_handle(ppapi_ipc_channel_handle),
103 trusted_ipc_channel_handle(trusted_ipc_channel_handle),
104 manifest_service_ipc_channel_handle(manifest_service_ipc_channel_handle),
105 plugin_pid(plugin_pid),
106 plugin_child_id(plugin_child_id),
107 crash_info_shmem_region(std::move(crash_info_shmem_region)) {}
108
~NaClLaunchResult()109 NaClLaunchResult::~NaClLaunchResult() {
110 }
111
112 } // namespace nacl
113