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

Unified Diff: chrome/renderer/pepper/pepper_shared_memory_message_filter.cc

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. Created 3 years, 8 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: chrome/renderer/pepper/pepper_shared_memory_message_filter.cc
diff --git a/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc b/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc
index 9919fb47b03ff0f36d660633f5d5da01e63681f4..8b708238b981dfd5cbfea55299e6ac65e19a8077 100644
--- a/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc
+++ b/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc
@@ -49,8 +49,9 @@ void PepperSharedMemoryMessageFilter::OnHostMsgCreateSharedMemory(
if (!shm.get())
return;
- base::SharedMemoryHandle host_shm_handle;
- shm->ShareToProcess(base::GetCurrentProcessHandle(), &host_shm_handle);
+ // TODO(erikchen): This appears to sometimes leak the SharedMemoryHandle.
+ // https://crbug.com/640840.
+ base::SharedMemoryHandle host_shm_handle = shm->handle().Duplicate();
*host_handle_id =
content::PepperPluginInstance::Get(instance)
->GetVarTracker()

Powered by Google App Engine
This is Rietveld 408576698