OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef GPU_NP_UTILS_DYNAMIC_NP_OBJECT_H_ | |
6 #define GPU_NP_UTILS_DYNAMIC_NP_OBJECT_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "gpu/np_utils/default_np_object.h" | |
11 #include "gpu/np_utils/np_utils.h" | |
12 | |
13 namespace np_utils { | |
14 | |
15 // NPObjects of this type have a dictionary of property name / variant pairs | |
16 // that can be changed at runtime through NPAPI. | |
17 class DynamicNPObject : public DefaultNPObject<NPObject> { | |
18 public: | |
19 explicit DynamicNPObject(NPP npp); | |
20 | |
21 void Invalidate(); | |
22 bool HasProperty(NPIdentifier name); | |
23 bool GetProperty(NPIdentifier name, NPVariant* result); | |
24 bool SetProperty(NPIdentifier name, const NPVariant* value); | |
25 bool RemoveProperty(NPIdentifier name); | |
26 bool Enumerate(NPIdentifier** names, uint32_t* count); | |
27 | |
28 private: | |
29 typedef std::map<NPIdentifier, SmartNPVariant> PropertyMap; | |
30 PropertyMap properties_; | |
31 DISALLOW_COPY_AND_ASSIGN(DynamicNPObject); | |
32 }; | |
33 } // namespace np_utils | |
34 | |
35 #endif // GPU_NP_UTILS_DYNAMIC_NP_OBJECT_H_ | |
OLD | NEW |