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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_gamepad_host.cc

Issue 281803003: Add PPAPI_BEGIN_MESSAGE_MAP and PPAPI_END_MESSAGE_MAP to be used when dispatching IPCs using PPAPI_… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 25 matching lines...) Expand all
36 weak_factory_(this) {} 36 weak_factory_(this) {}
37 37
38 PepperGamepadHost::~PepperGamepadHost() { 38 PepperGamepadHost::~PepperGamepadHost() {
39 if (is_started_) 39 if (is_started_)
40 gamepad_service_->RemoveConsumer(this); 40 gamepad_service_->RemoveConsumer(this);
41 } 41 }
42 42
43 int32_t PepperGamepadHost::OnResourceMessageReceived( 43 int32_t PepperGamepadHost::OnResourceMessageReceived(
44 const IPC::Message& msg, 44 const IPC::Message& msg,
45 ppapi::host::HostMessageContext* context) { 45 ppapi::host::HostMessageContext* context) {
46 IPC_BEGIN_MESSAGE_MAP(PepperGamepadHost, msg) 46 PPAPI_BEGIN_MESSAGE_MAP(PepperGamepadHost, msg)
47 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Gamepad_RequestMemory, 47 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Gamepad_RequestMemory,
48 OnRequestMemory) 48 OnRequestMemory)
49 IPC_END_MESSAGE_MAP() 49 PPAPI_END_MESSAGE_MAP()
50 return PP_ERROR_FAILED; 50 return PP_ERROR_FAILED;
51 } 51 }
52 52
53 int32_t PepperGamepadHost::OnRequestMemory( 53 int32_t PepperGamepadHost::OnRequestMemory(
54 ppapi::host::HostMessageContext* context) { 54 ppapi::host::HostMessageContext* context) {
55 if (is_started_) 55 if (is_started_)
56 return PP_ERROR_FAILED; 56 return PP_ERROR_FAILED;
57 57
58 gamepad_service_->ConsumerBecameActive(this); 58 gamepad_service_->ConsumerBecameActive(this);
59 is_started_ = true; 59 is_started_ = true;
(...skipping 13 matching lines...) Expand all
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_->GetPluginProcessHandle());
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698