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

Unified Diff: ppapi/proxy/gamepad_resource.cc

Issue 11312017: Avoid leaking SerializedHandles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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: ppapi/proxy/gamepad_resource.cc
diff --git a/ppapi/proxy/gamepad_resource.cc b/ppapi/proxy/gamepad_resource.cc
index 3055513c5c052405193087854d61e7dc47980d85..8a4943767cc30b9fff1c26141050a8a868dc0cad 100644
--- a/ppapi/proxy/gamepad_resource.cc
+++ b/ppapi/proxy/gamepad_resource.cc
@@ -98,8 +98,8 @@ void GamepadResource::Sample(PP_GamepadsSampleData* data) {
void GamepadResource::OnPluginMsgSendMemory(
const ResourceMessageReplyParams& params) {
// On failure, the handle will be null and the CHECK below will be tripped.
- base::SharedMemoryHandle handle;
- params.GetSharedMemoryHandleAtIndex(0, &handle);
+ base::SharedMemoryHandle handle = base::SharedMemory::NULLHandle();
+ params.TakeSharedMemoryHandleAtIndex(0, &handle);
shared_memory_.reset(new base::SharedMemory(handle, true));
CHECK(shared_memory_->Map(sizeof(ContentGamepadHardwareBuffer)));

Powered by Google App Engine
This is Rietveld 408576698