Upstream version 6.35.121.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     : validation_cache_enabled(false),
12       enable_exception_handling(false),
13       enable_debug_stub(false),
14       enable_ipc_proxy(false),
15       uses_irt(false),
16       enable_dyncode_syscalls(false),
17       uses_nonsfi_mode(false) {
18 }
19
20 NaClStartParams::~NaClStartParams() {
21 }
22
23 NaClLaunchParams::NaClLaunchParams()
24     : render_view_id(0),
25       permission_bits(0),
26       uses_irt(false),
27       enable_dyncode_syscalls(false),
28       enable_exception_handling(false),
29       enable_crash_throttling(false) {
30 }
31
32 NaClLaunchParams::NaClLaunchParams(const std::string& manifest_url,
33                                    int render_view_id,
34                                    uint32 permission_bits,
35                                    bool uses_irt,
36                                    bool uses_nonsfi_mode,
37                                    bool enable_dyncode_syscalls,
38                                    bool enable_exception_handling,
39                                    bool enable_crash_throttling)
40     : manifest_url(manifest_url),
41       render_view_id(render_view_id),
42       permission_bits(permission_bits),
43       uses_irt(uses_irt),
44       uses_nonsfi_mode(uses_nonsfi_mode),
45       enable_dyncode_syscalls(enable_dyncode_syscalls),
46       enable_exception_handling(enable_exception_handling),
47       enable_crash_throttling(enable_crash_throttling) {
48 }
49
50 NaClLaunchParams::NaClLaunchParams(const NaClLaunchParams& l) {
51   manifest_url = l.manifest_url;
52   render_view_id = l.render_view_id;
53   permission_bits = l.permission_bits;
54   uses_irt = l.uses_irt;
55   enable_dyncode_syscalls = l.enable_dyncode_syscalls;
56   enable_exception_handling = l.enable_exception_handling;
57   enable_crash_throttling = l.enable_crash_throttling;
58 }
59
60 NaClLaunchParams::~NaClLaunchParams() {
61 }
62
63 NaClLaunchResult::NaClLaunchResult()
64     : imc_channel_handle(IPC::InvalidPlatformFileForTransit()),
65       ppapi_ipc_channel_handle(),
66       trusted_ipc_channel_handle(),
67       plugin_pid(base::kNullProcessId),
68       plugin_child_id(0) {
69 }
70
71 NaClLaunchResult::NaClLaunchResult(
72     FileDescriptor imc_channel_handle,
73     const IPC::ChannelHandle& ppapi_ipc_channel_handle,
74     const IPC::ChannelHandle& trusted_ipc_channel_handle,
75     base::ProcessId plugin_pid,
76     int plugin_child_id)
77     : imc_channel_handle(imc_channel_handle),
78       ppapi_ipc_channel_handle(ppapi_ipc_channel_handle),
79       trusted_ipc_channel_handle(trusted_ipc_channel_handle),
80       plugin_pid(plugin_pid),
81       plugin_child_id(plugin_child_id) {
82 }
83
84 NaClLaunchResult::~NaClLaunchResult() {
85 }
86
87 }  // namespace nacl