| 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/cpp/private/var_private.h" | 5 #include "ppapi/cpp/private/var_private.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_var_deprecated.h" | 7 #include "ppapi/c/dev/ppb_var_deprecated.h" |
| 8 #include "ppapi/cpp/instance.h" | 8 #include "ppapi/cpp/private/instance_private.h" |
| 9 #include "ppapi/cpp/logging.h" | 9 #include "ppapi/cpp/logging.h" |
| 10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
| 11 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" | 11 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 template <> const char* interface_name<PPB_Var_Deprecated>() { | 17 template <> const char* interface_name<PPB_Var_Deprecated>() { |
| 18 return PPB_VAR_DEPRECATED_INTERFACE; | 18 return PPB_VAR_DEPRECATED_INTERFACE; |
| 19 } | 19 } |
| 20 | 20 |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 using namespace deprecated; | 23 using namespace deprecated; |
| 24 | 24 |
| 25 VarPrivate::VarPrivate(Instance* instance, ScriptableObject* object) { | 25 VarPrivate::VarPrivate(InstancePrivate* instance, ScriptableObject* object) { |
| 26 if (has_interface<PPB_Var_Deprecated>()) { | 26 if (has_interface<PPB_Var_Deprecated>()) { |
| 27 var_ = get_interface<PPB_Var_Deprecated>()->CreateObject( | 27 var_ = get_interface<PPB_Var_Deprecated>()->CreateObject( |
| 28 instance->pp_instance(), object->GetClass(), object); | 28 instance->pp_instance(), object->GetClass(), object); |
| 29 needs_release_ = true; | 29 needs_release_ = true; |
| 30 } else { | 30 } else { |
| 31 var_.type = PP_VARTYPE_NULL; | 31 var_.type = PP_VARTYPE_NULL; |
| 32 var_.padding = 0; | 32 var_.padding = 0; |
| 33 needs_release_ = false; | 33 needs_release_ = false; |
| 34 } | 34 } |
| 35 } | 35 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 const Var& arg2, const Var& arg3, const Var& arg4, | 177 const Var& arg2, const Var& arg3, const Var& arg4, |
| 178 Var* exception) { | 178 Var* exception) { |
| 179 if (!has_interface<PPB_Var_Deprecated>()) | 179 if (!has_interface<PPB_Var_Deprecated>()) |
| 180 return Var(); | 180 return Var(); |
| 181 PP_Var args[4] = {arg1.pp_var(), arg2.pp_var(), arg3.pp_var(), arg4.pp_var()}; | 181 PP_Var args[4] = {arg1.pp_var(), arg2.pp_var(), arg3.pp_var(), arg4.pp_var()}; |
| 182 return Var(PassRef(), get_interface<PPB_Var_Deprecated>()->Call( | 182 return Var(PassRef(), get_interface<PPB_Var_Deprecated>()->Call( |
| 183 var_, method_name.pp_var(), 4, args, OutException(exception).get())); | 183 var_, method_name.pp_var(), 4, args, OutException(exception).get())); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace pp | 186 } // namespace pp |
| OLD | NEW |