| 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/dev/scriptable_object_deprecated.h" | 5 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" |
| 6 #include "ppapi/c/dev/ppb_memory_dev.h" | 6 #include "ppapi/c/dev/ppb_memory_dev.h" |
| 7 #include "ppapi/c/dev/ppp_class_deprecated.h" | 7 #include "ppapi/c/dev/ppp_class_deprecated.h" |
| 8 #include "ppapi/cpp/module.h" | 8 #include "ppapi/cpp/module.h" |
| 9 #include "ppapi/cpp/var.h" | 9 #include "ppapi/cpp/var.h" |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 PP_Var* exception) { | 66 PP_Var* exception) { |
| 67 ExceptionConverter e(exception); | 67 ExceptionConverter e(exception); |
| 68 std::vector<Var> props; | 68 std::vector<Var> props; |
| 69 static_cast<ScriptableObject*>(object)->GetAllPropertyNames(&props, e.Get()); | 69 static_cast<ScriptableObject*>(object)->GetAllPropertyNames(&props, e.Get()); |
| 70 if (props.empty()) | 70 if (props.empty()) |
| 71 return; | 71 return; |
| 72 *property_count = static_cast<uint32_t>(props.size()); | 72 *property_count = static_cast<uint32_t>(props.size()); |
| 73 | 73 |
| 74 const PPB_Memory_Dev* memory_if = static_cast<const PPB_Memory_Dev*>( | 74 const PPB_Memory_Dev* memory_if = static_cast<const PPB_Memory_Dev*>( |
| 75 pp::Module::Get()->GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE)); | 75 pp::Module::Get()->GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE)); |
| 76 *properties = static_cast<PP_Var*>( | 76 *properties = static_cast<PP_Var*>(memory_if->MemAlloc( |
| 77 memory_if->MemAlloc(sizeof(PP_Var) * props.size())); | 77 static_cast<uint32_t>(sizeof(PP_Var) * props.size()))); |
| 78 | 78 |
| 79 for (size_t i = 0; i < props.size(); ++i) | 79 for (size_t i = 0; i < props.size(); ++i) |
| 80 (*properties)[i] = props[i].Detach(); | 80 (*properties)[i] = props[i].Detach(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void SetProperty(void* object, | 83 void SetProperty(void* object, |
| 84 PP_Var name, | 84 PP_Var name, |
| 85 PP_Var value, | 85 PP_Var value, |
| 86 PP_Var* exception) { | 86 PP_Var* exception) { |
| 87 ExceptionConverter e(exception); | 87 ExceptionConverter e(exception); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } | 183 } |
| 184 | 184 |
| 185 // static | 185 // static |
| 186 const PPP_Class_Deprecated* ScriptableObject::GetClass() { | 186 const PPP_Class_Deprecated* ScriptableObject::GetClass() { |
| 187 return &plugin_class; | 187 return &plugin_class; |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace deprecated | 190 } // namespace deprecated |
| 191 | 191 |
| 192 } // namespace pp | 192 } // namespace pp |
| OLD | NEW |