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

Unified Diff: base/memory/shared_memory_win.cc

Issue 15001027: [Aura] Added Support for rendering software compositor frames as cc::TextureLayers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 6 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: base/memory/shared_memory_win.cc
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc
index 8f92c357196148026cb37a5e192c9327f17444df..7f2ae233c5c2013904b5c792323c7fd65bd66196 100644
--- a/base/memory/shared_memory_win.cc
+++ b/base/memory/shared_memory_win.cc
@@ -87,6 +87,18 @@ void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
::CloseHandle(handle);
}
+//static
+SharedMemoryHandle SharedMemory::DuplicateHandle(
+ const SharedMemoryHandle& handle) {
+ HANDLE result;
+ BOOL success = ::DuplicateHandle(::GetCurrentProcess(), handle,
+ ::GetCurrentProcess(), &result,
+ 0, TRUE, DUPLICATE_SAME_ACCESS);
+ if (!success)
+ return NULLHandle();
+ return result;
+}
+
// static
size_t SharedMemory::GetHandleLimit() {
// Rounded down from value reported here:
@@ -208,8 +220,8 @@ bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
return true;
}
- if (!DuplicateHandle(GetCurrentProcess(), mapped_file, process,
- &result, access, FALSE, options))
+ if (!::DuplicateHandle(GetCurrentProcess(), mapped_file, process,
+ &result, access, FALSE, options))
return false;
*new_handle = result;
return true;

Powered by Google App Engine
This is Rietveld 408576698