| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" | 5 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/gamepad/gamepad_service.h" | 8 #include "content/browser/gamepad/gamepad_service.h" |
| 9 #include "content/public/browser/browser_ppapi_host.h" | 9 #include "content/public/browser/browser_ppapi_host.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 base::Bind(&PepperGamepadHost::GotUserGesture, | 65 base::Bind(&PepperGamepadHost::GotUserGesture, |
| 66 weak_factory_.GetWeakPtr(), | 66 weak_factory_.GetWeakPtr(), |
| 67 context->MakeReplyMessageContext())); | 67 context->MakeReplyMessageContext())); |
| 68 return PP_OK_COMPLETIONPENDING; | 68 return PP_OK_COMPLETIONPENDING; |
| 69 } | 69 } |
| 70 | 70 |
| 71 void PepperGamepadHost::GotUserGesture( | 71 void PepperGamepadHost::GotUserGesture( |
| 72 const ppapi::host::ReplyMessageContext& context) { | 72 const ppapi::host::ReplyMessageContext& context) { |
| 73 base::SharedMemoryHandle handle = | 73 base::SharedMemoryHandle handle = |
| 74 gamepad_service_->GetSharedMemoryHandleForProcess( | 74 gamepad_service_->GetSharedMemoryHandleForProcess( |
| 75 browser_ppapi_host_->GetPluginProcessHandle()); | 75 browser_ppapi_host_->GetPluginProcess().Handle()); |
| 76 | 76 |
| 77 context.params.AppendHandle(ppapi::proxy::SerializedHandle( | 77 context.params.AppendHandle(ppapi::proxy::SerializedHandle( |
| 78 handle, sizeof(ppapi::ContentGamepadHardwareBuffer))); | 78 handle, sizeof(ppapi::ContentGamepadHardwareBuffer))); |
| 79 host()->SendReply(context, PpapiPluginMsg_Gamepad_SendMemory()); | 79 host()->SendReply(context, PpapiPluginMsg_Gamepad_SendMemory()); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace content | 82 } // namespace content |
| OLD | NEW |