Upstream version 11.40.277.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_debug_stub(false),
16       enable_ipc_proxy(false),
17       process_type(kUnknownNaClProcessType),
18       crash_info_shmem_handle(base::SharedMemory::NULLHandle()) {
19 }
20
21 NaClStartParams::~NaClStartParams() {
22 }
23
24 NaClLaunchParams::NaClLaunchParams()
25     : nexe_file(IPC::InvalidPlatformFileForTransit()),
26       nexe_token_lo(0),
27       nexe_token_hi(0),
28       render_view_id(0),
29       permission_bits(0),
30       process_type(kUnknownNaClProcessType) {
31 }
32
33 NaClLaunchParams::NaClLaunchParams(
34     const std::string& manifest_url,
35     const IPC::PlatformFileForTransit& nexe_file,
36     uint64_t nexe_token_lo,
37     uint64_t nexe_token_hi,
38     int render_view_id,
39     uint32 permission_bits,
40     bool uses_nonsfi_mode,
41     NaClAppProcessType process_type)
42     : manifest_url(manifest_url),
43       nexe_file(nexe_file),
44       nexe_token_lo(nexe_token_lo),
45       nexe_token_hi(nexe_token_hi),
46       render_view_id(render_view_id),
47       permission_bits(permission_bits),
48       uses_nonsfi_mode(uses_nonsfi_mode),
49       process_type(process_type) {
50 }
51
52 NaClLaunchParams::~NaClLaunchParams() {
53 }
54
55 NaClLaunchResult::NaClLaunchResult()
56     : imc_channel_handle(IPC::InvalidPlatformFileForTransit()),
57       ppapi_ipc_channel_handle(),
58       trusted_ipc_channel_handle(),
59       plugin_pid(base::kNullProcessId),
60       plugin_child_id(0),
61       crash_info_shmem_handle(base::SharedMemory::NULLHandle()) {
62 }
63
64 NaClLaunchResult::NaClLaunchResult(
65     FileDescriptor imc_channel_handle,
66     const IPC::ChannelHandle& ppapi_ipc_channel_handle,
67     const IPC::ChannelHandle& trusted_ipc_channel_handle,
68     const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
69     base::ProcessId plugin_pid,
70     int plugin_child_id,
71     base::SharedMemoryHandle crash_info_shmem_handle)
72     : imc_channel_handle(imc_channel_handle),
73       ppapi_ipc_channel_handle(ppapi_ipc_channel_handle),
74       trusted_ipc_channel_handle(trusted_ipc_channel_handle),
75       manifest_service_ipc_channel_handle(manifest_service_ipc_channel_handle),
76       plugin_pid(plugin_pid),
77       plugin_child_id(plugin_child_id),
78       crash_info_shmem_handle(crash_info_shmem_handle) {
79 }
80
81 NaClLaunchResult::~NaClLaunchResult() {
82 }
83
84 }  // namespace nacl