| 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/pp_errors.h" | 7 #include "ppapi/c/pp_errors.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/c/ppb_mouse_lock.h" | 11 #include "ppapi/c/ppb_mouse_lock.h" |
| 12 #include "ppapi/proxy/host_dispatcher.h" | 12 #include "ppapi/proxy/host_dispatcher.h" |
| 13 #include "ppapi/proxy/plugin_dispatcher.h" | 13 #include "ppapi/proxy/plugin_dispatcher.h" |
| 14 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 14 #include "ppapi/proxy/ppapi_messages.h" | 15 #include "ppapi/proxy/ppapi_messages.h" |
| 15 #include "ppapi/proxy/serialized_var.h" | 16 #include "ppapi/proxy/serialized_var.h" |
| 16 #include "ppapi/shared_impl/ppapi_globals.h" | |
| 17 #include "ppapi/shared_impl/url_util_impl.h" | 17 #include "ppapi/shared_impl/url_util_impl.h" |
| 18 #include "ppapi/thunk/enter.h" | 18 #include "ppapi/thunk/enter.h" |
| 19 #include "ppapi/thunk/thunk.h" | 19 #include "ppapi/thunk/thunk.h" |
| 20 | 20 |
| 21 // Windows headers interfere with this file. | 21 // Windows headers interfere with this file. |
| 22 #ifdef PostMessage | 22 #ifdef PostMessage |
| 23 #undef PostMessage | 23 #undef PostMessage |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 using ppapi::thunk::EnterFunctionNoLock; | 26 using ppapi::thunk::EnterFunctionNoLock; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 IPC_END_MESSAGE_MAP() | 116 IPC_END_MESSAGE_MAP() |
| 117 return handled; | 117 return handled; |
| 118 } | 118 } |
| 119 | 119 |
| 120 PPB_Instance_FunctionAPI* PPB_Instance_Proxy::AsPPB_Instance_FunctionAPI() { | 120 PPB_Instance_FunctionAPI* PPB_Instance_Proxy::AsPPB_Instance_FunctionAPI() { |
| 121 return this; | 121 return this; |
| 122 } | 122 } |
| 123 | 123 |
| 124 PP_Bool PPB_Instance_Proxy::BindGraphics(PP_Instance instance, | 124 PP_Bool PPB_Instance_Proxy::BindGraphics(PP_Instance instance, |
| 125 PP_Resource device) { | 125 PP_Resource device) { |
| 126 Resource* object = | 126 Resource* object = PluginResourceTracker::GetInstance()->GetResource(device); |
| 127 PpapiGlobals::Get()->GetResourceTracker()->GetResource(device); | |
| 128 if (!object || object->pp_instance() != instance) | 127 if (!object || object->pp_instance() != instance) |
| 129 return PP_FALSE; | 128 return PP_FALSE; |
| 130 | 129 |
| 131 PP_Bool result = PP_FALSE; | 130 PP_Bool result = PP_FALSE; |
| 132 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 131 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
| 133 INTERFACE_ID_PPB_INSTANCE, instance, object->host_resource(), | 132 INTERFACE_ID_PPB_INSTANCE, instance, object->host_resource(), |
| 134 &result)); | 133 &result)); |
| 135 return result; | 134 return result; |
| 136 } | 135 } |
| 137 | 136 |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 SerializedVarReturnValue result) { | 579 SerializedVarReturnValue result) { |
| 581 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); | 580 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); |
| 582 if (enter.succeeded()) { | 581 if (enter.succeeded()) { |
| 583 result.Return(dispatcher(), | 582 result.Return(dispatcher(), |
| 584 enter.functions()->GetPluginInstanceURL(instance, NULL)); | 583 enter.functions()->GetPluginInstanceURL(instance, NULL)); |
| 585 } | 584 } |
| 586 } | 585 } |
| 587 | 586 |
| 588 } // namespace proxy | 587 } // namespace proxy |
| 589 } // namespace ppapi | 588 } // namespace ppapi |
| OLD | NEW |