| OLD | NEW |
| 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/thunk/enter.h" | 15 #include "ppapi/thunk/enter.h" |
| 16 #include "ppapi/thunk/ppb_input_event_api.h" | 16 #include "ppapi/thunk/ppb_input_event_api.h" |
| 17 | 17 |
| 18 using ppapi::InputEventData; | |
| 19 using ppapi::thunk::EnterResourceNoLock; | 18 using ppapi::thunk::EnterResourceNoLock; |
| 20 using ppapi::thunk::PPB_InputEvent_API; | 19 using ppapi::thunk::PPB_InputEvent_API; |
| 21 | 20 |
| 22 namespace pp { | 21 namespace ppapi { |
| 23 namespace proxy { | 22 namespace proxy { |
| 24 | 23 |
| 25 namespace { | 24 namespace { |
| 26 | 25 |
| 27 PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource input_event) { | 26 PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource input_event) { |
| 28 EnterResourceNoLock<PPB_InputEvent_API> enter(input_event, false); | 27 EnterResourceNoLock<PPB_InputEvent_API> enter(input_event, false); |
| 29 if (enter.failed()) { | 28 if (enter.failed()) { |
| 30 NOTREACHED(); | 29 NOTREACHED(); |
| 31 return PP_FALSE; | 30 return PP_FALSE; |
| 32 } | 31 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const InputEventData& data, | 104 const InputEventData& data, |
| 106 PP_Bool* result) { | 105 PP_Bool* result) { |
| 107 PP_Resource event_resource = PPB_InputEvent_Proxy::CreateProxyResource( | 106 PP_Resource event_resource = PPB_InputEvent_Proxy::CreateProxyResource( |
| 108 instance, data); | 107 instance, data); |
| 109 *result = ppp_input_event_target()->HandleInputEvent(instance, | 108 *result = ppp_input_event_target()->HandleInputEvent(instance, |
| 110 event_resource); | 109 event_resource); |
| 111 PluginResourceTracker::GetInstance()->ReleaseResource(event_resource); | 110 PluginResourceTracker::GetInstance()->ReleaseResource(event_resource); |
| 112 } | 111 } |
| 113 | 112 |
| 114 } // namespace proxy | 113 } // namespace proxy |
| 115 } // namespace pp | 114 } // namespace ppapi |
| OLD | NEW |