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

Side by Side Diff: ppapi/proxy/ppp_input_event_proxy.cc

Issue 7621070: Merge the plugin and impl side of the audio config and input event resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compile issues Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/proxy/ppp_input_event_proxy.h" 5 #include "ppapi/proxy/ppp_input_event_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ppapi/c/ppp_input_event.h" 9 #include "ppapi/c/ppp_input_event.h"
10 #include "ppapi/proxy/host_dispatcher.h" 10 #include "ppapi/proxy/host_dispatcher.h"
11 #include "ppapi/proxy/plugin_dispatcher.h" 11 #include "ppapi/proxy/plugin_dispatcher.h"
12 #include "ppapi/proxy/plugin_resource_tracker.h" 12 #include "ppapi/proxy/plugin_resource_tracker.h"
13 #include "ppapi/proxy/ppapi_messages.h" 13 #include "ppapi/proxy/ppapi_messages.h"
14 #include "ppapi/proxy/ppb_input_event_proxy.h" 14 #include "ppapi/proxy/ppb_input_event_proxy.h"
15 #include "ppapi/shared_impl/input_event_impl.h"
15 #include "ppapi/thunk/enter.h" 16 #include "ppapi/thunk/enter.h"
16 #include "ppapi/thunk/ppb_input_event_api.h" 17 #include "ppapi/thunk/ppb_input_event_api.h"
17 18
18 using ppapi::thunk::EnterResourceNoLock; 19 using ppapi::thunk::EnterResourceNoLock;
19 using ppapi::thunk::PPB_InputEvent_API; 20 using ppapi::thunk::PPB_InputEvent_API;
20 21
21 namespace ppapi { 22 namespace ppapi {
22 namespace proxy { 23 namespace proxy {
23 24
24 namespace { 25 namespace {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 OnMsgHandleInputEvent) 87 OnMsgHandleInputEvent)
87 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInputEvent_HandleFilteredInputEvent, 88 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInputEvent_HandleFilteredInputEvent,
88 OnMsgHandleFilteredInputEvent) 89 OnMsgHandleFilteredInputEvent)
89 IPC_MESSAGE_UNHANDLED(handled = false) 90 IPC_MESSAGE_UNHANDLED(handled = false)
90 IPC_END_MESSAGE_MAP() 91 IPC_END_MESSAGE_MAP()
91 return handled; 92 return handled;
92 } 93 }
93 94
94 void PPP_InputEvent_Proxy::OnMsgHandleInputEvent(PP_Instance instance, 95 void PPP_InputEvent_Proxy::OnMsgHandleInputEvent(PP_Instance instance,
95 const InputEventData& data) { 96 const InputEventData& data) {
96 PP_Resource event_resource = PPB_InputEvent_Proxy::CreateProxyResource( 97 scoped_refptr<InputEventImpl> resource(new InputEventImpl(
97 instance, data); 98 InputEventImpl::InitAsProxy(), instance, data));
98 ppp_input_event_target()->HandleInputEvent(instance, event_resource); 99 ppp_input_event_target()->HandleInputEvent(instance, resource->pp_resource());
99 PluginResourceTracker::GetInstance()->ReleaseResource(event_resource);
100 } 100 }
101 101
102 void PPP_InputEvent_Proxy::OnMsgHandleFilteredInputEvent( 102 void PPP_InputEvent_Proxy::OnMsgHandleFilteredInputEvent(
103 PP_Instance instance, 103 PP_Instance instance,
104 const InputEventData& data, 104 const InputEventData& data,
105 PP_Bool* result) { 105 PP_Bool* result) {
106 PP_Resource event_resource = PPB_InputEvent_Proxy::CreateProxyResource( 106 scoped_refptr<InputEventImpl> resource(new InputEventImpl(
107 instance, data); 107 InputEventImpl::InitAsProxy(), instance, data));
108 *result = ppp_input_event_target()->HandleInputEvent(instance, 108 *result = ppp_input_event_target()->HandleInputEvent(instance,
109 event_resource); 109 resource->pp_resource());
110 PluginResourceTracker::GetInstance()->ReleaseResource(event_resource);
111 } 110 }
112 111
113 } // namespace proxy 112 } // namespace proxy
114 } // namespace ppapi 113 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698