OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
7 #include "ppapi/c/pp_var.h" | 7 #include "ppapi/c/pp_var.h" |
8 #include "ppapi/c/ppb_instance.h" | 8 #include "ppapi/c/ppb_instance.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 PP_Var GetOwnerElementObject(PP_Instance instance) { | 26 PP_Var GetOwnerElementObject(PP_Instance instance) { |
27 Dispatcher* dispatcher = PluginDispatcher::Get(); | 27 Dispatcher* dispatcher = PluginDispatcher::Get(); |
28 ReceiveSerializedVarReturnValue result; | 28 ReceiveSerializedVarReturnValue result; |
29 dispatcher->Send(new PpapiHostMsg_PPBInstance_GetOwnerElementObject( | 29 dispatcher->Send(new PpapiHostMsg_PPBInstance_GetOwnerElementObject( |
30 INTERFACE_ID_PPB_INSTANCE, instance, &result)); | 30 INTERFACE_ID_PPB_INSTANCE, instance, &result)); |
31 return result.Return(dispatcher); | 31 return result.Return(dispatcher); |
32 } | 32 } |
33 | 33 |
34 bool BindGraphics(PP_Instance instance, PP_Resource device) { | 34 PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) { |
35 bool result; | 35 PP_Bool result; |
36 PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 36 PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
37 INTERFACE_ID_PPB_INSTANCE, instance, device, &result)); | 37 INTERFACE_ID_PPB_INSTANCE, instance, device, &result)); |
38 return result; | 38 return result; |
39 } | 39 } |
40 | 40 |
41 bool IsFullFrame(PP_Instance instance) { | 41 PP_Bool IsFullFrame(PP_Instance instance) { |
42 bool result; | 42 PP_Bool result; |
43 PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_IsFullFrame( | 43 PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_IsFullFrame( |
44 INTERFACE_ID_PPB_INSTANCE, instance, &result)); | 44 INTERFACE_ID_PPB_INSTANCE, instance, &result)); |
45 return result; | 45 return result; |
46 } | 46 } |
47 | 47 |
48 PP_Var ExecuteScript(PP_Instance instance, PP_Var script, PP_Var* exception) { | 48 PP_Var ExecuteScript(PP_Instance instance, PP_Var script, PP_Var* exception) { |
49 Dispatcher* dispatcher = PluginDispatcher::Get(); | 49 Dispatcher* dispatcher = PluginDispatcher::Get(); |
50 ReceiveSerializedException se(dispatcher, exception); | 50 ReceiveSerializedException se(dispatcher, exception); |
51 if (se.IsThrown()) | 51 if (se.IsThrown()) |
52 return PP_MakeUndefined(); | 52 return PP_MakeUndefined(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 void PPB_Instance_Proxy::OnMsgGetOwnerElementObject( | 109 void PPB_Instance_Proxy::OnMsgGetOwnerElementObject( |
110 PP_Instance instance, | 110 PP_Instance instance, |
111 SerializedVarReturnValue result) { | 111 SerializedVarReturnValue result) { |
112 result.Return(dispatcher(), | 112 result.Return(dispatcher(), |
113 ppb_instance_target()->GetOwnerElementObject(instance)); | 113 ppb_instance_target()->GetOwnerElementObject(instance)); |
114 } | 114 } |
115 | 115 |
116 void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance, | 116 void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance, |
117 PP_Resource device, | 117 PP_Resource device, |
118 bool* result) { | 118 PP_Bool* result) { |
119 *result = ppb_instance_target()->BindGraphics(instance, device); | 119 *result = ppb_instance_target()->BindGraphics(instance, device); |
120 } | 120 } |
121 | 121 |
122 void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance, bool* result) { | 122 void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance, |
| 123 PP_Bool* result) { |
123 *result = ppb_instance_target()->IsFullFrame(instance); | 124 *result = ppb_instance_target()->IsFullFrame(instance); |
124 } | 125 } |
125 | 126 |
126 void PPB_Instance_Proxy::OnMsgExecuteScript( | 127 void PPB_Instance_Proxy::OnMsgExecuteScript( |
127 PP_Instance instance, | 128 PP_Instance instance, |
128 SerializedVarReceiveInput script, | 129 SerializedVarReceiveInput script, |
129 SerializedVarOutParam out_exception, | 130 SerializedVarOutParam out_exception, |
130 SerializedVarReturnValue result) { | 131 SerializedVarReturnValue result) { |
131 result.Return(dispatcher(), ppb_instance_target()->ExecuteScript( | 132 result.Return(dispatcher(), ppb_instance_target()->ExecuteScript( |
132 instance, | 133 instance, |
133 script.Get(dispatcher()), | 134 script.Get(dispatcher()), |
134 out_exception.OutParam(dispatcher()))); | 135 out_exception.OutParam(dispatcher()))); |
135 } | 136 } |
136 | 137 |
137 } // namespace proxy | 138 } // namespace proxy |
138 } // namespace pp | 139 } // namespace pp |
OLD | NEW |