| 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_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/plugin_resource.h" | 10 #include "ppapi/proxy/plugin_resource.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 84 } |
| 85 | 85 |
| 86 const PPB_Instance instance_interface = { | 86 const PPB_Instance instance_interface = { |
| 87 &GetWindowObject, | 87 &GetWindowObject, |
| 88 &GetOwnerElementObject, | 88 &GetOwnerElementObject, |
| 89 &BindGraphics, | 89 &BindGraphics, |
| 90 &IsFullFrame, | 90 &IsFullFrame, |
| 91 &ExecuteScript | 91 &ExecuteScript |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 InterfaceProxy* CreateInstanceProxy(Dispatcher* dispatcher, |
| 95 const void* target_interface) { |
| 96 return new PPB_Instance_Proxy(dispatcher, target_interface); |
| 97 } |
| 98 |
| 94 } // namespace | 99 } // namespace |
| 95 | 100 |
| 96 PPB_Instance_Proxy::PPB_Instance_Proxy(Dispatcher* dispatcher, | 101 PPB_Instance_Proxy::PPB_Instance_Proxy(Dispatcher* dispatcher, |
| 97 const void* target_interface) | 102 const void* target_interface) |
| 98 : InterfaceProxy(dispatcher, target_interface) { | 103 : InterfaceProxy(dispatcher, target_interface) { |
| 99 } | 104 } |
| 100 | 105 |
| 101 PPB_Instance_Proxy::~PPB_Instance_Proxy() { | 106 PPB_Instance_Proxy::~PPB_Instance_Proxy() { |
| 102 } | 107 } |
| 103 | 108 |
| 104 const void* PPB_Instance_Proxy::GetSourceInterface() const { | 109 // static |
| 105 return &instance_interface; | 110 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfo() { |
| 106 } | 111 static const Info info = { |
| 107 | 112 &instance_interface, |
| 108 InterfaceID PPB_Instance_Proxy::GetInterfaceId() const { | 113 PPB_INSTANCE_INTERFACE, |
| 109 return INTERFACE_ID_PPB_INSTANCE; | 114 INTERFACE_ID_PPB_INSTANCE, |
| 115 false, |
| 116 &CreateInstanceProxy, |
| 117 }; |
| 118 return &info; |
| 110 } | 119 } |
| 111 | 120 |
| 112 bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { | 121 bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 113 bool handled = true; | 122 bool handled = true; |
| 114 IPC_BEGIN_MESSAGE_MAP(PPB_Instance_Proxy, msg) | 123 IPC_BEGIN_MESSAGE_MAP(PPB_Instance_Proxy, msg) |
| 115 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetWindowObject, | 124 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetWindowObject, |
| 116 OnMsgGetWindowObject) | 125 OnMsgGetWindowObject) |
| 117 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetOwnerElementObject, | 126 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetOwnerElementObject, |
| 118 OnMsgGetOwnerElementObject) | 127 OnMsgGetOwnerElementObject) |
| 119 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_BindGraphics, | 128 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_BindGraphics, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 SerializedVarOutParam out_exception, | 168 SerializedVarOutParam out_exception, |
| 160 SerializedVarReturnValue result) { | 169 SerializedVarReturnValue result) { |
| 161 result.Return(dispatcher(), ppb_instance_target()->ExecuteScript( | 170 result.Return(dispatcher(), ppb_instance_target()->ExecuteScript( |
| 162 instance, | 171 instance, |
| 163 script.Get(dispatcher()), | 172 script.Get(dispatcher()), |
| 164 out_exception.OutParam(dispatcher()))); | 173 out_exception.OutParam(dispatcher()))); |
| 165 } | 174 } |
| 166 | 175 |
| 167 } // namespace proxy | 176 } // namespace proxy |
| 168 } // namespace pp | 177 } // namespace pp |
| OLD | NEW |