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 "components/nacl/common/nacl_types.h"
6#include "ipc/ipc_platform_file.h"
7
8namespace nacl {
9
10NaClStartParams::NaClStartParams()
11    : nexe_file(IPC::InvalidPlatformFileForTransit()),
12      nexe_token_lo(0),
13      nexe_token_hi(0),
14      validation_cache_enabled(false),
15      enable_exception_handling(false),
16      enable_debug_stub(false),
17      enable_ipc_proxy(false),
18      uses_irt(false),
19      enable_dyncode_syscalls(false),
20      crash_info_shmem_handle(base::SharedMemory::NULLHandle()) {
21}
22
23NaClStartParams::~NaClStartParams() {
24}
25
26NaClLaunchParams::NaClLaunchParams()
27    : nexe_file(IPC::InvalidPlatformFileForTransit()),
28      nexe_token_lo(0),
29      nexe_token_hi(0),
30      render_view_id(0),
31      permission_bits(0),
32      uses_irt(false),
33      enable_dyncode_syscalls(false),
34      enable_exception_handling(false),
35      enable_crash_throttling(false) {
36}
37
38NaClLaunchParams::NaClLaunchParams(
39    const std::string& manifest_url,
40    const IPC::PlatformFileForTransit& nexe_file,
41    uint64_t nexe_token_lo,
42    uint64_t nexe_token_hi,
43    int render_view_id,
44    uint32 permission_bits,
45    bool uses_irt,
46    bool uses_nonsfi_mode,
47    bool enable_dyncode_syscalls,
48    bool enable_exception_handling,
49    bool enable_crash_throttling)
50    : manifest_url(manifest_url),
51      nexe_file(nexe_file),
52      nexe_token_lo(nexe_token_lo),
53      nexe_token_hi(nexe_token_hi),
54      render_view_id(render_view_id),
55      permission_bits(permission_bits),
56      uses_irt(uses_irt),
57      uses_nonsfi_mode(uses_nonsfi_mode),
58      enable_dyncode_syscalls(enable_dyncode_syscalls),
59      enable_exception_handling(enable_exception_handling),
60      enable_crash_throttling(enable_crash_throttling) {
61}
62
63NaClLaunchParams::~NaClLaunchParams() {
64}
65
66NaClLaunchResult::NaClLaunchResult()
67    : imc_channel_handle(IPC::InvalidPlatformFileForTransit()),
68      ppapi_ipc_channel_handle(),
69      trusted_ipc_channel_handle(),
70      plugin_pid(base::kNullProcessId),
71      plugin_child_id(0),
72      crash_info_shmem_handle(base::SharedMemory::NULLHandle()) {
73}
74
75NaClLaunchResult::NaClLaunchResult(
76    FileDescriptor imc_channel_handle,
77    const IPC::ChannelHandle& ppapi_ipc_channel_handle,
78    const IPC::ChannelHandle& trusted_ipc_channel_handle,
79    const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
80    base::ProcessId plugin_pid,
81    int plugin_child_id,
82    base::SharedMemoryHandle crash_info_shmem_handle)
83    : imc_channel_handle(imc_channel_handle),
84      ppapi_ipc_channel_handle(ppapi_ipc_channel_handle),
85      trusted_ipc_channel_handle(trusted_ipc_channel_handle),
86      manifest_service_ipc_channel_handle(manifest_service_ipc_channel_handle),
87      plugin_pid(plugin_pid),
88      plugin_child_id(plugin_child_id),
89      crash_info_shmem_handle(crash_info_shmem_handle) {
90}
91
92NaClLaunchResult::~NaClLaunchResult() {
93}
94
95}  // namespace nacl
96