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

Unified Diff: components/nacl/common/nacl_types.h

Issue 1094653003: Refactor NaClProcessHost. Reduce chances to leak the resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: components/nacl/common/nacl_types.h
diff --git a/components/nacl/common/nacl_types.h b/components/nacl/common/nacl_types.h
index f691edf9b2f7c6068efb3f686337ada1e994b7b6..dccce5820d486fdc5ae266fbc1526760ca2bd1fd 100644
--- a/components/nacl/common/nacl_types.h
+++ b/components/nacl/common/nacl_types.h
@@ -13,32 +13,13 @@
#include "base/memory/shared_memory.h"
#include "base/process/process_handle.h"
#include "build/build_config.h"
-#include "ipc/ipc_channel.h"
+#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_platform_file.h"
Mark Seaborn 2015/04/17 22:13:45 Nit: remove 1 empty line so that there's only 1 be
hidehiko 2015/04/30 16:33:02 Done.
-#if defined(OS_POSIX)
-#include "base/file_descriptor_posix.h"
-#endif
-
-#if defined(OS_WIN)
-#include <windows.h> // for HANDLE
-#endif
// TODO(gregoryd): add a Windows definition for base::FileDescriptor
namespace nacl {
-#if defined(OS_WIN)
-typedef HANDLE FileDescriptor;
-inline HANDLE ToNativeHandle(const FileDescriptor& desc) {
- return desc;
-}
-#elif defined(OS_POSIX)
-typedef base::FileDescriptor FileDescriptor;
-inline int ToNativeHandle(const FileDescriptor& desc) {
- return desc.fd;
-}
-#endif
-
// We allocate a page of shared memory for sharing crash information from
// trusted code in the NaCl process to the renderer.
static const int kNaClCrashInfoShmemSize = 4096;
@@ -82,8 +63,8 @@ struct NaClStartParams {
base::FilePath nexe_file_path_metadata;
std::vector<NaClResourceFileInfo> prefetched_resource_files;
- std::vector<FileDescriptor> handles;
- FileDescriptor debug_stub_server_bound_socket;
+ std::vector<IPC::PlatformFileForTransit> handles;
+ IPC::PlatformFileForTransit debug_stub_server_bound_socket;
bool validation_cache_enabled;
std::string validation_cache_key;
@@ -147,7 +128,7 @@ struct NaClLaunchParams {
struct NaClLaunchResult {
NaClLaunchResult();
NaClLaunchResult(
- FileDescriptor imc_channel_handle,
+ const IPC::PlatformFileForTransit& imc_channel_handle,
const IPC::ChannelHandle& ppapi_ipc_channel_handle,
const IPC::ChannelHandle& trusted_ipc_channel_handle,
const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
@@ -157,7 +138,7 @@ struct NaClLaunchResult {
~NaClLaunchResult();
// For plugin loader <-> renderer IMC communication.
- FileDescriptor imc_channel_handle;
+ IPC::PlatformFileForTransit imc_channel_handle;
// For plugin <-> renderer PPAPI communication.
IPC::ChannelHandle ppapi_ipc_channel_handle;

Powered by Google App Engine
This is Rietveld 408576698