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/ppb_cursor_control_proxy.h" | 5 #include "ppapi/proxy/ppb_cursor_control_proxy.h" |
6 | 6 |
7 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 7 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
8 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 8 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/plugin_resource_tracker.h" | 10 #include "ppapi/proxy/plugin_resource_tracker.h" |
11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
12 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
13 #include "ppapi/thunk/thunk.h" | 13 #include "ppapi/thunk/thunk.h" |
14 | 14 |
15 using ppapi::HostResource; | |
16 using ppapi::Resource; | |
17 using ppapi::thunk::EnterFunctionNoLock; | 15 using ppapi::thunk::EnterFunctionNoLock; |
18 using ppapi::thunk::PPB_CursorControl_FunctionAPI; | 16 using ppapi::thunk::PPB_CursorControl_FunctionAPI; |
19 | 17 |
20 namespace pp { | 18 namespace ppapi { |
21 namespace proxy { | 19 namespace proxy { |
22 | 20 |
23 namespace { | 21 namespace { |
24 | 22 |
25 InterfaceProxy* CreateCursorControlProxy(Dispatcher* dispatcher, | 23 InterfaceProxy* CreateCursorControlProxy(Dispatcher* dispatcher, |
26 const void* target_interface) { | 24 const void* target_interface) { |
27 return new PPB_CursorControl_Proxy(dispatcher, target_interface); | 25 return new PPB_CursorControl_Proxy(dispatcher, target_interface); |
28 } | 26 } |
29 | 27 |
30 } // namespace | 28 } // namespace |
31 | 29 |
32 PPB_CursorControl_Proxy::PPB_CursorControl_Proxy(Dispatcher* dispatcher, | 30 PPB_CursorControl_Proxy::PPB_CursorControl_Proxy(Dispatcher* dispatcher, |
33 const void* target_interface) | 31 const void* target_interface) |
34 : InterfaceProxy(dispatcher, target_interface) { | 32 : InterfaceProxy(dispatcher, target_interface) { |
35 } | 33 } |
36 | 34 |
37 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() { | 35 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() { |
38 } | 36 } |
39 | 37 |
40 // static | 38 // static |
41 const InterfaceProxy::Info* PPB_CursorControl_Proxy::GetInfo() { | 39 const InterfaceProxy::Info* PPB_CursorControl_Proxy::GetInfo() { |
42 static const Info info = { | 40 static const Info info = { |
43 ppapi::thunk::GetPPB_CursorControl_Thunk(), | 41 thunk::GetPPB_CursorControl_Thunk(), |
44 PPB_CURSOR_CONTROL_DEV_INTERFACE, | 42 PPB_CURSOR_CONTROL_DEV_INTERFACE, |
45 INTERFACE_ID_PPB_CURSORCONTROL, | 43 INTERFACE_ID_PPB_CURSORCONTROL, |
46 false, | 44 false, |
47 &CreateCursorControlProxy, | 45 &CreateCursorControlProxy, |
48 }; | 46 }; |
49 return &info; | 47 return &info; |
50 } | 48 } |
51 | 49 |
52 ppapi::thunk::PPB_CursorControl_FunctionAPI* | 50 ppapi::thunk::PPB_CursorControl_FunctionAPI* |
53 PPB_CursorControl_Proxy::AsPPB_CursorControl_FunctionAPI() { | 51 PPB_CursorControl_Proxy::AsPPB_CursorControl_FunctionAPI() { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 160 } |
163 | 161 |
164 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, | 162 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, |
165 PP_Bool* result) { | 163 PP_Bool* result) { |
166 EnterFunctionNoLock<PPB_CursorControl_FunctionAPI> enter(instance, true); | 164 EnterFunctionNoLock<PPB_CursorControl_FunctionAPI> enter(instance, true); |
167 if (enter.succeeded()) | 165 if (enter.succeeded()) |
168 *result = enter.functions()->CanLockCursor(instance); | 166 *result = enter.functions()->CanLockCursor(instance); |
169 } | 167 } |
170 | 168 |
171 } // namespace proxy | 169 } // namespace proxy |
172 } // namespace pp | 170 } // namespace ppapi |
OLD | NEW |