OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_NACL_TYPES_H_ | 5 #ifndef CHROME_COMMON_NACL_TYPES_H_ |
6 #define CHROME_COMMON_NACL_TYPES_H_ | 6 #define CHROME_COMMON_NACL_TYPES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/process.h" | |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "ipc/ipc_channel.h" | |
13 | 15 |
14 #if defined(OS_POSIX) | 16 #if defined(OS_POSIX) |
15 #include "base/file_descriptor_posix.h" | 17 #include "base/file_descriptor_posix.h" |
16 #endif | 18 #endif |
17 | 19 |
18 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
19 #include <windows.h> // for HANDLE | 21 #include <windows.h> // for HANDLE |
20 #endif | 22 #endif |
21 | 23 |
22 // TODO(gregoryd): add a Windows definition for base::FileDescriptor | 24 // TODO(gregoryd): add a Windows definition for base::FileDescriptor |
23 namespace nacl { | 25 namespace nacl { |
24 | 26 |
25 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
26 // We assume that HANDLE always uses less than 32 bits | 28 // We assume that HANDLE always uses less than 32 bits |
Mark Seaborn
2013/07/18 22:15:49
This comment no longer matches the following line.
halyavin
2013/07/19 09:06:20
Done.
| |
27 typedef int FileDescriptor; | 29 typedef HANDLE FileDescriptor; |
Mark Seaborn
2013/07/18 22:15:49
This change requires an explanation in the commit
halyavin
2013/07/19 09:06:20
Done.
| |
28 inline HANDLE ToNativeHandle(const FileDescriptor& desc) { | 30 inline HANDLE ToNativeHandle(const FileDescriptor& desc) { |
29 return reinterpret_cast<HANDLE>(desc); | 31 return reinterpret_cast<HANDLE>(desc); |
Mark Seaborn
2013/07/18 22:15:49
This can be just "return desc" now.
halyavin
2013/07/19 09:06:20
Done.
| |
30 } | 32 } |
31 #elif defined(OS_POSIX) | 33 #elif defined(OS_POSIX) |
32 typedef base::FileDescriptor FileDescriptor; | 34 typedef base::FileDescriptor FileDescriptor; |
33 inline int ToNativeHandle(const FileDescriptor& desc) { | 35 inline int ToNativeHandle(const FileDescriptor& desc) { |
34 return desc.fd; | 36 return desc.fd; |
35 } | 37 } |
36 #endif | 38 #endif |
37 | 39 |
38 | 40 |
39 // Parameters sent to the NaCl process when we start it. | 41 // Parameters sent to the NaCl process when we start it. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 ~NaClLaunchParams(); | 76 ~NaClLaunchParams(); |
75 | 77 |
76 std::string manifest_url; | 78 std::string manifest_url; |
77 int render_view_id; | 79 int render_view_id; |
78 uint32 permission_bits; | 80 uint32 permission_bits; |
79 bool uses_irt; | 81 bool uses_irt; |
80 bool enable_dyncode_syscalls; | 82 bool enable_dyncode_syscalls; |
81 bool enable_exception_handling; | 83 bool enable_exception_handling; |
82 }; | 84 }; |
83 | 85 |
86 struct NaClLaunchResult { | |
87 NaClLaunchResult(); | |
88 NaClLaunchResult(FileDescriptor imc_channel_handle, | |
89 const IPC::ChannelHandle& ipc_channel_handle, | |
90 base::ProcessId plugin_pid, | |
91 int plugin_child_id); | |
92 ~NaClLaunchResult(); | |
93 | |
94 FileDescriptor imc_channel_handle; | |
95 IPC::ChannelHandle ipc_channel_handle; | |
96 base::ProcessId plugin_pid; | |
97 int plugin_child_id; | |
98 }; | |
99 | |
84 } // namespace nacl | 100 } // namespace nacl |
85 | 101 |
86 #endif // CHROME_COMMON_NACL_TYPES_H_ | 102 #endif // CHROME_COMMON_NACL_TYPES_H_ |
OLD | NEW |