Index: base/memory/shared_memory_posix.cc |
diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc |
index 2dc08a14ca24ec2c441173b639dd2b5030264389..33295813ef17dfa14fa139e1ee2fa12cc0c1b10d 100644 |
--- a/base/memory/shared_memory_posix.cc |
+++ b/base/memory/shared_memory_posix.cc |
@@ -108,6 +108,26 @@ size_t SharedMemory::GetHandleLimit() { |
return base::GetMaxFds(); |
} |
+#if defined(OS_WIN) || defined(OS_POSIX) |
Nico
2015/05/29 06:50:23
this is just "everywhere", right?
erikchen
2015/05/29 18:30:24
I guess so. Removed preprocessor conditionals.
|
+// static |
+SharedMemoryHandle SharedMemory::ShallowCopyOfHandle( |
+ const SharedMemoryHandle& handle) { |
+ return handle; |
Nico
2015/05/29 06:50:24
The CL you link to doesn't modify this function. I
erikchen
2015/05/29 18:30:24
I think it's semantically important to not use ass
|
+} |
+#endif |
+ |
+#if defined(OS_POSIX) |
+// static |
+SharedMemoryHandle SharedMemory::DeepCopyOfHandle( |
Nico
2015/05/29 06:50:24
CloneHandle() maybe?
erikchen
2015/05/29 18:30:24
If you really want me to change the verb, the cano
|
+ const SharedMemoryHandle& handle, |
+ bool clean_up_resources_on_destruction) { |
+ int duped_handle = HANDLE_EINTR(dup(handle.fd)); |
+ if (duped_handle < 0) |
+ return base::SharedMemory::NULLHandle(); |
+ return base::FileDescriptor(duped_handle, clean_up_resources_on_destruction); |
+} |
+#endif |
+ |
bool SharedMemory::CreateAndMapAnonymous(size_t size) { |
return CreateAnonymous(size) && Map(size); |
} |