Index: remoting/host/plugin/host_plugin_utils.h |
diff --git a/remoting/host/plugin/host_plugin_utils.h b/remoting/host/plugin/host_plugin_utils.h |
index 363da4f99a596869b541568728a7633d570189a5..02b413aafb31bb27bea90a14066e8a4105f03c09 100644 |
--- a/remoting/host/plugin/host_plugin_utils.h |
+++ b/remoting/host/plugin/host_plugin_utils.h |
@@ -30,6 +30,20 @@ NPVariant NPVariantFromString(const std::string& val); |
// Convert an NPVariant into an NSPObject. |
NPObject* ObjectFromNPVariant(const NPVariant& variant); |
+// Scoped pointer for NPObjects. All objects using this class must be |
+// owned by g_npnetscape_funcs. |
+class scoped_NPObject { |
+ public: |
+ scoped_NPObject(); |
+ ~scoped_NPObject(); |
+ |
+ void replace(NPObject* object); |
+ NPObject* get() { return object_; } |
+ |
+ private: |
+ NPObject* object_; |
+}; |
Wez
2011/08/13 01:35:32
This should really be scoped_refNPObject, I think,
Jamie
2011/08/13 02:20:15
I've taken Sergey's suggestion of calling it Scope
Jamie
2011/08/15 17:21:03
Actually, now I think about it, it does affect the
|
+ |
} // namespace remoting |
#endif // REMOTING_HOST_PLUGIN_HOST_PLUGIN_UTILS_H_ |