| 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/ppp_class_proxy.h" | 5 #include "ppapi/proxy/ppp_class_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_var_deprecated.h" | 7 #include "ppapi/c/dev/ppb_var_deprecated.h" |
| 8 #include "ppapi/c/dev/ppp_class_deprecated.h" | 8 #include "ppapi/c/dev/ppp_class_deprecated.h" |
| 9 #include "ppapi/proxy/dispatcher.h" | 9 #include "ppapi/proxy/dispatcher.h" |
| 10 #include "ppapi/proxy/interface_id.h" | 10 #include "ppapi/proxy/interface_id.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // implementation as the user data. | 168 // implementation as the user data. |
| 169 void* ToUserData(int64 value) { | 169 void* ToUserData(int64 value) { |
| 170 return reinterpret_cast<void*>(static_cast<intptr_t>(value)); | 170 return reinterpret_cast<void*>(static_cast<intptr_t>(value)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace | 173 } // namespace |
| 174 | 174 |
| 175 // PPP_Class_Proxy ------------------------------------------------------------- | 175 // PPP_Class_Proxy ------------------------------------------------------------- |
| 176 | 176 |
| 177 PPP_Class_Proxy::PPP_Class_Proxy(Dispatcher* dispatcher) | 177 PPP_Class_Proxy::PPP_Class_Proxy(Dispatcher* dispatcher) |
| 178 : InterfaceProxy(dispatcher, NULL) { | 178 : InterfaceProxy(dispatcher) { |
| 179 } | 179 } |
| 180 | 180 |
| 181 PPP_Class_Proxy::~PPP_Class_Proxy() { | 181 PPP_Class_Proxy::~PPP_Class_Proxy() { |
| 182 } | 182 } |
| 183 | 183 |
| 184 // static | 184 // static |
| 185 InterfaceProxy* PPP_Class_Proxy::Create(Dispatcher* dispatcher) { |
| 186 return new PPP_Class_Proxy(dispatcher); |
| 187 } |
| 188 |
| 189 // static |
| 185 PP_Var PPP_Class_Proxy::CreateProxiedObject(const PPB_Var_Deprecated* var, | 190 PP_Var PPP_Class_Proxy::CreateProxiedObject(const PPB_Var_Deprecated* var, |
| 186 Dispatcher* dispatcher, | 191 Dispatcher* dispatcher, |
| 187 PP_Module module_id, | 192 PP_Module module_id, |
| 188 int64 ppp_class, | 193 int64 ppp_class, |
| 189 int64 class_data) { | 194 int64 class_data) { |
| 190 ObjectProxy* object_proxy = new ObjectProxy(dispatcher, | 195 ObjectProxy* object_proxy = new ObjectProxy(dispatcher, |
| 191 ppp_class, class_data); | 196 ppp_class, class_data); |
| 192 return var->CreateObject(module_id, &class_interface, object_proxy); | 197 return var->CreateObject(module_id, &class_interface, object_proxy); |
| 193 } | 198 } |
| 194 | 199 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 result.Return(dispatcher(), ToPPPClass(ppp_class)->Construct( | 294 result.Return(dispatcher(), ToPPPClass(ppp_class)->Construct( |
| 290 ToUserData(object), arg_count, args, exception.OutParam(dispatcher()))); | 295 ToUserData(object), arg_count, args, exception.OutParam(dispatcher()))); |
| 291 } | 296 } |
| 292 | 297 |
| 293 void PPP_Class_Proxy::OnMsgDeallocate(int64 ppp_class, int64 object) { | 298 void PPP_Class_Proxy::OnMsgDeallocate(int64 ppp_class, int64 object) { |
| 294 ToPPPClass(ppp_class)->Deallocate(ToUserData(object)); | 299 ToPPPClass(ppp_class)->Deallocate(ToUserData(object)); |
| 295 } | 300 } |
| 296 | 301 |
| 297 } // namespace proxy | 302 } // namespace proxy |
| 298 } // namespace ppapi | 303 } // namespace ppapi |
| OLD | NEW |