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

Unified Diff: content/renderer/npapi/webplugin_delegate_proxy.cc

Issue 1154613006: Update pepper to not assume that SharedMemoryHandle is an int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another nits pass. 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
Index: content/renderer/npapi/webplugin_delegate_proxy.cc
diff --git a/content/renderer/npapi/webplugin_delegate_proxy.cc b/content/renderer/npapi/webplugin_delegate_proxy.cc
index e5566bce6e0495c1f939c5684fbb9c706e522894..800ce123f35d7312f0d4fefb211ef3a85155c0de 100644
--- a/content/renderer/npapi/webplugin_delegate_proxy.cc
+++ b/content/renderer/npapi/webplugin_delegate_proxy.cc
@@ -498,14 +498,7 @@ static void CopySharedMemoryHandleForMessage(
base::SharedMemoryHandle* handle_out,
base::ProcessId peer_pid) {
#if defined(OS_POSIX)
- // On POSIX, base::ShardMemoryHandle is typedef'ed to FileDescriptor, and
- // FileDescriptor message fields needs to remain valid until the message is
- // sent or else the sendmsg() call will fail.
- if ((handle_out->fd = HANDLE_EINTR(dup(handle_in.fd))) < 0) {
- PLOG(ERROR) << "dup()";
- return;
- }
- handle_out->auto_close = true;
+ *handle_out = base::SharedMemory::DeepCopyHandle(handle_in, true);
#elif defined(OS_WIN)
// On Windows we need to duplicate the handle for the plugin process.
*handle_out = NULL;

Powered by Google App Engine
This is Rietveld 408576698