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

Unified Diff: chrome/browser/nacl_host/nacl_process_host.cc

Issue 8513018: NaCl: preallocate shared-memory object on Linux as on MacOSX (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: restore MakeSharedMemorySegmentViaIPC Created 9 years, 1 month 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 | « no previous file | chrome/nacl/nacl_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/nacl_host/nacl_process_host.cc
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index d254d4438ca1a7ff216074c577e4d7fb46eaf686..a119ec37bf24276cf5497883d5f1c251526a9c25 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -498,11 +498,11 @@ void NaClProcessHost::SendStart(base::PlatformFile irt_file) {
return;
}
-#if defined(OS_MACOSX)
- // For dynamic loading support, NaCl requires a file descriptor that
- // was created in /tmp, since those created with shm_open() are not
- // mappable with PROT_EXEC. Rather than requiring an extra IPC
- // round trip out of the sandbox, we create an FD here.
+#if defined(OS_POSIX)
+ // For dynamic loading support, NaCl requires a file descriptor on an
+ // anonymous file that can have PROT_EXEC applied to its mappings.
+ // Rather than requiring an extra IPC round trip out of the sandbox,
+ // we create an FD here.
base::SharedMemory memory_buffer;
if (!memory_buffer.CreateAnonymous(/* size= */ 1)) {
LOG(ERROR) << "Failed to allocate memory buffer";
« no previous file with comments | « no previous file | chrome/nacl/nacl_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698