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
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_NACL_TYPES_H_
6 #define CHROME_COMMON_NACL_TYPES_H_
11 #include "build/build_config.h"
14 #include "base/file_descriptor_posix.h"
18 #include <windows.h> // for HANDLE
21 // TODO(gregoryd): add a Windows definition for base::FileDescriptor
25 // We assume that HANDLE always uses less than 32 bits
26 typedef int FileDescriptor
;
27 inline HANDLE
ToNativeHandle(const FileDescriptor
& desc
) {
28 return reinterpret_cast<HANDLE
>(desc
);
30 #elif defined(OS_POSIX)
31 typedef base::FileDescriptor FileDescriptor
;
32 inline int ToNativeHandle(const FileDescriptor
& desc
) {
38 // Parameters sent to the NaCl process when we start it.
40 // If you change this, you will also need to update the IPC serialization in
42 struct NaClStartParams
{
46 std::vector
<FileDescriptor
> handles
;
47 FileDescriptor debug_stub_server_bound_socket
;
49 bool validation_cache_enabled
;
50 std::string validation_cache_key
;
51 // Chrome version string. Sending the version string over IPC avoids linkage
52 // issues in cases where NaCl is not compiled into the main Chromium
56 bool enable_exception_handling
;
57 bool enable_debug_stub
;
58 bool enable_ipc_proxy
;
63 #endif // CHROME_COMMON_NACL_TYPES_H_