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

Unified Diff: content/renderer/pepper/pepper_compositor_host.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/pepper/pepper_compositor_host.cc
diff --git a/content/renderer/pepper/pepper_compositor_host.cc b/content/renderer/pepper/pepper_compositor_host.cc
index e0045d97c3c30d5ee3630ae9a943c8f9aa2127c1..68378939c431a82008abd1720a4e5eec67a574cb 100644
--- a/content/renderer/pepper/pepper_compositor_host.cc
+++ b/content/renderer/pepper/pepper_compositor_host.cc
@@ -116,24 +116,20 @@ int32_t VerifyCommittedLayer(
return PP_ERROR_BADARGUMENT;
}
- int handle;
+ base::SharedMemoryHandle handle;
uint32_t byte_count;
if (enter.object()->GetSharedMemory(&handle, &byte_count) != PP_OK)
return PP_ERROR_FAILED;
#if defined(OS_WIN)
base::SharedMemoryHandle shm_handle;
- if (!::DuplicateHandle(::GetCurrentProcess(),
- reinterpret_cast<base::SharedMemoryHandle>(handle),
- ::GetCurrentProcess(),
- &shm_handle,
- 0,
- FALSE,
- DUPLICATE_SAME_ACCESS)) {
+ if (!::DuplicateHandle(::GetCurrentProcess(), handle, ::GetCurrentProcess(),
+ &shm_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
return PP_ERROR_FAILED;
}
#else
- base::SharedMemoryHandle shm_handle(dup(handle), false);
+ base::SharedMemoryHandle shm_handle =
+ base::SharedMemory::DeepCopyHandle(handle, false);
#endif
image_shm->reset(new base::SharedMemory(shm_handle, true));
if (!(*image_shm)->Map(desc.stride * desc.size.height)) {

Powered by Google App Engine
This is Rietveld 408576698