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

Unified Diff: chrome/nacl/nacl_listener.cc

Issue 10039001: NaCl: Supply Windows handle-passing function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix + comment 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/browser/nacl_host/nacl_process_host.cc ('k') | chrome/renderer/chrome_ppapi_interfaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/nacl/nacl_listener.cc
diff --git a/chrome/nacl/nacl_listener.cc b/chrome/nacl/nacl_listener.cc
index d0e0a8a72ff45665fc4b70805fc74fbcbf2e0301..b82ca0f8df98ed91aa17b1568a33ca3c05246148 100644
--- a/chrome/nacl/nacl_listener.cc
+++ b/chrome/nacl/nacl_listener.cc
@@ -26,6 +26,8 @@
#if defined(OS_WIN)
#include <fcntl.h>
#include <io.h>
+
+#include "content/public/common/sandbox_init.h"
#endif
namespace {
@@ -67,6 +69,19 @@ int CreateMemoryObject(size_t size, int executable) {
return content::MakeSharedMemorySegmentViaIPC(size, executable);
}
+#elif defined(OS_WIN)
+
+// We wrap the function to convert the bool return value to an int.
+int BrokerDuplicateHandle(NaClHandle source_handle,
+ uint32_t process_id,
+ NaClHandle* target_handle,
+ uint32_t desired_access,
+ uint32_t options) {
+ return content::BrokerDuplicateHandle(source_handle, process_id,
+ target_handle, desired_access,
+ options);
+}
+
#endif
// Use an env var because command line args are eaten by nacl_helper.
@@ -203,6 +218,9 @@ void NaClListener::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles,
args->imc_bootstrap_handle = nacl::ToNativeHandle(handles[0]);
args->enable_exception_handling = enable_exception_handling;
args->enable_debug_stub = debug_enabled_;
+#if defined(OS_WIN)
+ args->broker_duplicate_handle_func = BrokerDuplicateHandle;
+#endif
NaClChromeMainStart(args);
NOTREACHED();
}
« no previous file with comments | « chrome/browser/nacl_host/nacl_process_host.cc ('k') | chrome/renderer/chrome_ppapi_interfaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698