| 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_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
| 8 #include "ppapi/c/pp_var.h" | 8 #include "ppapi/c/pp_var.h" |
| 9 #include "ppapi/c/ppb_instance.h" | 9 #include "ppapi/c/ppb_instance.h" |
| 10 #include "ppapi/c/ppb_messaging.h" | 10 #include "ppapi/c/ppb_messaging.h" |
| 11 #include "ppapi/proxy/host_dispatcher.h" | 11 #include "ppapi/proxy/host_dispatcher.h" |
| 12 #include "ppapi/proxy/plugin_dispatcher.h" | 12 #include "ppapi/proxy/plugin_dispatcher.h" |
| 13 #include "ppapi/proxy/plugin_resource.h" | 13 #include "ppapi/proxy/plugin_resource.h" |
| 14 #include "ppapi/proxy/plugin_resource_tracker.h" | 14 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 15 #include "ppapi/proxy/ppapi_messages.h" | 15 #include "ppapi/proxy/ppapi_messages.h" |
| 16 #include "ppapi/proxy/serialized_var.h" | 16 #include "ppapi/proxy/serialized_var.h" |
| 17 #include "ppapi/thunk/enter.h" | 17 #include "ppapi/thunk/enter.h" |
| 18 #include "ppapi/thunk/thunk.h" | 18 #include "ppapi/thunk/thunk.h" |
| 19 | 19 |
| 20 // Windows headers interfere with this file. | 20 // Windows headers interfere with this file. |
| 21 #ifdef PostMessage | 21 #ifdef PostMessage |
| 22 #undef PostMessage | 22 #undef PostMessage |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 using ppapi::HostResource; |
| 25 using ppapi::thunk::EnterFunctionNoLock; | 26 using ppapi::thunk::EnterFunctionNoLock; |
| 26 using ppapi::thunk::EnterResourceNoLock; | 27 using ppapi::thunk::EnterResourceNoLock; |
| 27 using ppapi::thunk::PPB_Instance_FunctionAPI; | 28 using ppapi::thunk::PPB_Instance_FunctionAPI; |
| 28 | 29 |
| 29 namespace pp { | 30 namespace pp { |
| 30 namespace proxy { | 31 namespace proxy { |
| 31 | 32 |
| 32 namespace { | 33 namespace { |
| 33 | 34 |
| 34 InterfaceProxy* CreateInstanceProxy(Dispatcher* dispatcher, | 35 InterfaceProxy* CreateInstanceProxy(Dispatcher* dispatcher, |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 PP_Instance instance, | 284 PP_Instance instance, |
| 284 SerializedVarReturnValue result) { | 285 SerializedVarReturnValue result) { |
| 285 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); | 286 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); |
| 286 if (enter.succeeded()) { | 287 if (enter.succeeded()) { |
| 287 result.Return(dispatcher(), | 288 result.Return(dispatcher(), |
| 288 enter.functions()->GetOwnerElementObject(instance)); | 289 enter.functions()->GetOwnerElementObject(instance)); |
| 289 } | 290 } |
| 290 } | 291 } |
| 291 | 292 |
| 292 void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance, | 293 void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance, |
| 293 HostResource device, | 294 const HostResource& device, |
| 294 PP_Bool* result) { | 295 PP_Bool* result) { |
| 295 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); | 296 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); |
| 296 if (enter.succeeded()) { | 297 if (enter.succeeded()) { |
| 297 *result = enter.functions()->BindGraphics(instance, | 298 *result = enter.functions()->BindGraphics(instance, |
| 298 device.host_resource()); | 299 device.host_resource()); |
| 299 } | 300 } |
| 300 } | 301 } |
| 301 | 302 |
| 302 void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance, | 303 void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance, |
| 303 PP_Bool* result) { | 304 PP_Bool* result) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 364 |
| 364 void PPB_Instance_Proxy::OnMsgPostMessage(PP_Instance instance, | 365 void PPB_Instance_Proxy::OnMsgPostMessage(PP_Instance instance, |
| 365 SerializedVarReceiveInput message) { | 366 SerializedVarReceiveInput message) { |
| 366 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); | 367 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); |
| 367 if (enter.succeeded()) | 368 if (enter.succeeded()) |
| 368 enter.functions()->PostMessage(instance, message.Get(dispatcher())); | 369 enter.functions()->PostMessage(instance, message.Get(dispatcher())); |
| 369 } | 370 } |
| 370 | 371 |
| 371 } // namespace proxy | 372 } // namespace proxy |
| 372 } // namespace pp | 373 } // namespace pp |
| OLD | NEW |