| 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) { | 178 : InterfaceProxy(dispatcher, NULL) { |
| 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 | |
| 190 PP_Var PPP_Class_Proxy::CreateProxiedObject(const PPB_Var_Deprecated* var, | 185 PP_Var PPP_Class_Proxy::CreateProxiedObject(const PPB_Var_Deprecated* var, |
| 191 Dispatcher* dispatcher, | 186 Dispatcher* dispatcher, |
| 192 PP_Module module_id, | 187 PP_Module module_id, |
| 193 int64 ppp_class, | 188 int64 ppp_class, |
| 194 int64 class_data) { | 189 int64 class_data) { |
| 195 ObjectProxy* object_proxy = new ObjectProxy(dispatcher, | 190 ObjectProxy* object_proxy = new ObjectProxy(dispatcher, |
| 196 ppp_class, class_data); | 191 ppp_class, class_data); |
| 197 return var->CreateObject(module_id, &class_interface, object_proxy); | 192 return var->CreateObject(module_id, &class_interface, object_proxy); |
| 198 } | 193 } |
| 199 | 194 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 result.Return(dispatcher(), ToPPPClass(ppp_class)->Construct( | 289 result.Return(dispatcher(), ToPPPClass(ppp_class)->Construct( |
| 295 ToUserData(object), arg_count, args, exception.OutParam(dispatcher()))); | 290 ToUserData(object), arg_count, args, exception.OutParam(dispatcher()))); |
| 296 } | 291 } |
| 297 | 292 |
| 298 void PPP_Class_Proxy::OnMsgDeallocate(int64 ppp_class, int64 object) { | 293 void PPP_Class_Proxy::OnMsgDeallocate(int64 ppp_class, int64 object) { |
| 299 ToPPPClass(ppp_class)->Deallocate(ToUserData(object)); | 294 ToPPPClass(ppp_class)->Deallocate(ToUserData(object)); |
| 300 } | 295 } |
| 301 | 296 |
| 302 } // namespace proxy | 297 } // namespace proxy |
| 303 } // namespace ppapi | 298 } // namespace ppapi |
| OLD | NEW |