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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 1143323010: Refactor Nacl to remove assumptions about SharedMemoryHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_make_class3_base
Patch Set: Created 5 years, 7 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 | « no previous file | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 4c719fd5ded2ac1a181bbdfb66d82448b8852b53..742e773d7ac9275bca66d7aec626c41465256b0d 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -946,7 +946,10 @@ bool NaClProcessHost::StartNaClExecution() {
DLOG(ERROR) << "Failed to allocate memory buffer";
return false;
}
- base::ScopedFD memory_fd(dup(memory_buffer.handle().fd));
+ base::SharedMemoryHandle duped_handle =
+ base::SharedMemory::DuplicateHandle(memory_buffer.handle());
+ base::ScopedFD memory_fd(
+ base::SharedMemory::GetFdFromSharedMemoryHandle(duped_handle));
Mark Seaborn 2015/06/04 20:17:55 How will this help you switch to having SharedMemo
erikchen 2015/06/04 20:25:42 I have a CL that changes SharedMemoryHandle to be
Mark Seaborn 2015/06/04 20:45:01 Which cases will require you to support storing an
if (!memory_fd.is_valid()) {
DLOG(ERROR) << "Failed to dup() a file descriptor";
return false;
« no previous file with comments | « no previous file | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698