| 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 typedef HANDLE FileDescriptor; |
| 27 typedef int FileDescriptor; | |
| 28 inline HANDLE ToNativeHandle(const FileDescriptor& desc) { | 29 inline HANDLE ToNativeHandle(const FileDescriptor& desc) { |
| 29 return reinterpret_cast<HANDLE>(desc); | 30 return desc; |
| 30 } | 31 } |
| 31 #elif defined(OS_POSIX) | 32 #elif defined(OS_POSIX) |
| 32 typedef base::FileDescriptor FileDescriptor; | 33 typedef base::FileDescriptor FileDescriptor; |
| 33 inline int ToNativeHandle(const FileDescriptor& desc) { | 34 inline int ToNativeHandle(const FileDescriptor& desc) { |
| 34 return desc.fd; | 35 return desc.fd; |
| 35 } | 36 } |
| 36 #endif | 37 #endif |
| 37 | 38 |
| 38 | 39 |
| 39 // Parameters sent to the NaCl process when we start it. | 40 // 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(); | 75 ~NaClLaunchParams(); |
| 75 | 76 |
| 76 std::string manifest_url; | 77 std::string manifest_url; |
| 77 int render_view_id; | 78 int render_view_id; |
| 78 uint32 permission_bits; | 79 uint32 permission_bits; |
| 79 bool uses_irt; | 80 bool uses_irt; |
| 80 bool enable_dyncode_syscalls; | 81 bool enable_dyncode_syscalls; |
| 81 bool enable_exception_handling; | 82 bool enable_exception_handling; |
| 82 }; | 83 }; |
| 83 | 84 |
| 85 struct NaClLaunchResult { |
| 86 NaClLaunchResult(); |
| 87 NaClLaunchResult(FileDescriptor imc_channel_handle, |
| 88 const IPC::ChannelHandle& ipc_channel_handle, |
| 89 base::ProcessId plugin_pid, |
| 90 int plugin_child_id); |
| 91 ~NaClLaunchResult(); |
| 92 |
| 93 FileDescriptor imc_channel_handle; |
| 94 IPC::ChannelHandle ipc_channel_handle; |
| 95 base::ProcessId plugin_pid; |
| 96 int plugin_child_id; |
| 97 }; |
| 98 |
| 84 } // namespace nacl | 99 } // namespace nacl |
| 85 | 100 |
| 86 #endif // CHROME_COMMON_NACL_TYPES_H_ | 101 #endif // CHROME_COMMON_NACL_TYPES_H_ |
| OLD | NEW |