Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: chrome/common/nacl_types.h

Issue 10020002: Pass the nacl start parameters as a struct. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/nacl_messages.h ('k') | chrome/common/nacl_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/nacl_types.h
diff --git a/chrome/common/nacl_types.h b/chrome/common/nacl_types.h
index af2eace9a99bc3882184f4168173fa12b810889d..02b1fda1f6d558cc79db29dcbfb24a617eaa7d9c 100644
--- a/chrome/common/nacl_types.h
+++ b/chrome/common/nacl_types.h
@@ -2,12 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Handle passing definitions for NaCl
#ifndef CHROME_COMMON_NACL_TYPES_H_
#define CHROME_COMMON_NACL_TYPES_H_
#pragma once
+#include <string>
+#include <vector>
+
#include "build/build_config.h"
+
#if defined(OS_POSIX)
#include "base/file_descriptor_posix.h"
#endif
@@ -18,18 +21,40 @@
// TODO(gregoryd): add a Windows definition for base::FileDescriptor
namespace nacl {
+
#if defined(OS_WIN)
- // We assume that HANDLE always uses less than 32 bits
- typedef int FileDescriptor;
- inline HANDLE ToNativeHandle(const FileDescriptor& desc) {
- return reinterpret_cast<HANDLE>(desc);
- }
+// We assume that HANDLE always uses less than 32 bits
+typedef int FileDescriptor;
+inline HANDLE ToNativeHandle(const FileDescriptor& desc) {
+ return reinterpret_cast<HANDLE>(desc);
+}
#elif defined(OS_POSIX)
- typedef base::FileDescriptor FileDescriptor;
- inline int ToNativeHandle(const FileDescriptor& desc) {
- return desc.fd;
- }
-#endif
+typedef base::FileDescriptor FileDescriptor;
+inline int ToNativeHandle(const FileDescriptor& desc) {
+ return desc.fd;
}
+#endif
+
+
+// Parameters sent to the NaCl process when we start it.
+//
+// If you change this, you will also need to update the IPC serialization in
+// nacl_messages.h.
+struct NaClStartParams {
+ NaClStartParams();
+ ~NaClStartParams();
+
+ std::vector<FileDescriptor> handles;
+ std::string validation_cache_key;
+
+ // Chrome version string. Sending the version string over IPC avoids linkage
+ // issues in cases where NaCl is not compiled into the main Chromium
+ // executable or DLL.
+ std::string version;
+
+ bool enable_exception_handling;
+};
+
+} // namespace nacl
#endif // CHROME_COMMON_NACL_TYPES_H_
« no previous file with comments | « chrome/common/nacl_messages.h ('k') | chrome/common/nacl_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698