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

Unified Diff: content/renderer/pepper/pepper_compositor_host.cc

Issue 1145893009: Change transport dib API to not make copies of SharedMemoryHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_pepper_rename
Patch Set: Comments from jbauman. 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 | content/renderer/pepper/pepper_video_source_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 68378939c431a82008abd1720a4e5eec67a574cb..80b2ef6225aeef44c5fee20484fd08d28d34772f 100644
--- a/content/renderer/pepper/pepper_compositor_host.cc
+++ b/content/renderer/pepper/pepper_compositor_host.cc
@@ -116,20 +116,21 @@ int32_t VerifyCommittedLayer(
return PP_ERROR_BADARGUMENT;
}
- base::SharedMemoryHandle handle;
+ base::SharedMemory* shm;
uint32_t byte_count;
- if (enter.object()->GetSharedMemory(&handle, &byte_count) != PP_OK)
+ if (enter.object()->GetSharedMemory(&shm, &byte_count) != PP_OK)
return PP_ERROR_FAILED;
#if defined(OS_WIN)
base::SharedMemoryHandle shm_handle;
- if (!::DuplicateHandle(::GetCurrentProcess(), handle, ::GetCurrentProcess(),
- &shm_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
+ if (!::DuplicateHandle(::GetCurrentProcess(), shm->handle(),
+ ::GetCurrentProcess(), &shm_handle, 0, FALSE,
+ DUPLICATE_SAME_ACCESS)) {
return PP_ERROR_FAILED;
}
#else
base::SharedMemoryHandle shm_handle =
- base::SharedMemory::DeepCopyHandle(handle, false);
+ base::SharedMemory::DeepCopyHandle(shm->handle(), false);
#endif
image_shm->reset(new base::SharedMemory(shm_handle, true));
if (!(*image_shm)->Map(desc.stride * desc.size.height)) {
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_video_source_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698