Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / components / nacl / common / nacl_types.cc
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
8 namespace nacl {
9
10 NaClStartParams::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 }
21
22 NaClStartParams::~NaClStartParams() {
23 }
24
25 NaClLaunchParams::NaClLaunchParams()
26     : nexe_file(IPC::InvalidPlatformFileForTransit()),
27       nexe_token_lo(0),
28       nexe_token_hi(0),
29       render_view_id(0),
30       permission_bits(0),
31       uses_irt(false),
32       enable_dyncode_syscalls(false),
33       enable_exception_handling(false),
34       enable_crash_throttling(false) {
35 }
36
37 NaClLaunchParams::NaClLaunchParams(
38     const std::string& manifest_url,
39     const IPC::PlatformFileForTransit& nexe_file,
40     uint64_t nexe_token_lo,
41     uint64_t nexe_token_hi,
42     int render_view_id,
43     uint32 permission_bits,
44     bool uses_irt,
45     bool uses_nonsfi_mode,
46     bool enable_dyncode_syscalls,
47     bool enable_exception_handling,
48     bool enable_crash_throttling)
49     : manifest_url(manifest_url),
50       nexe_file(nexe_file),
51       nexe_token_lo(nexe_token_lo),
52       nexe_token_hi(nexe_token_hi),
53       render_view_id(render_view_id),
54       permission_bits(permission_bits),
55       uses_irt(uses_irt),
56       uses_nonsfi_mode(uses_nonsfi_mode),
57       enable_dyncode_syscalls(enable_dyncode_syscalls),
58       enable_exception_handling(enable_exception_handling),
59       enable_crash_throttling(enable_crash_throttling) {
60 }
61
62 NaClLaunchParams::~NaClLaunchParams() {
63 }
64
65 NaClLaunchResult::NaClLaunchResult()
66     : imc_channel_handle(IPC::InvalidPlatformFileForTransit()),
67       ppapi_ipc_channel_handle(),
68       trusted_ipc_channel_handle(),
69       plugin_pid(base::kNullProcessId),
70       plugin_child_id(0) {
71 }
72
73 NaClLaunchResult::NaClLaunchResult(
74     FileDescriptor imc_channel_handle,
75     const IPC::ChannelHandle& ppapi_ipc_channel_handle,
76     const IPC::ChannelHandle& trusted_ipc_channel_handle,
77     const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
78     base::ProcessId plugin_pid,
79     int plugin_child_id)
80     : imc_channel_handle(imc_channel_handle),
81       ppapi_ipc_channel_handle(ppapi_ipc_channel_handle),
82       trusted_ipc_channel_handle(trusted_ipc_channel_handle),
83       manifest_service_ipc_channel_handle(manifest_service_ipc_channel_handle),
84       plugin_pid(plugin_pid),
85       plugin_child_id(plugin_child_id) {
86 }
87
88 NaClLaunchResult::~NaClLaunchResult() {
89 }
90
91 }  // namespace nacl