Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: remoting/host/plugin/host_plugin_utils.cc

Issue 7635012: Host process i18n and Linux implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/plugin/host_plugin_utils.cc
diff --git a/remoting/host/plugin/host_plugin_utils.cc b/remoting/host/plugin/host_plugin_utils.cc
index f8e36bdc1f82faad9260be7116487a3aa0ad8610..1c09327d9bfdb6c7b2308000514e9e3d0f677ec5 100644
--- a/remoting/host/plugin/host_plugin_utils.cc
+++ b/remoting/host/plugin/host_plugin_utils.cc
@@ -40,4 +40,21 @@ NPObject* ObjectFromNPVariant(const NPVariant& variant) {
return NPVARIANT_TO_OBJECT(variant);
}
+ScopedRefNPObject::ScopedRefNPObject() : object_(NULL) { }
+
+ScopedRefNPObject::~ScopedRefNPObject() {
+ *this = NULL;
+}
+
+ScopedRefNPObject& ScopedRefNPObject::operator=(NPObject* object) {
+ if (object) {
+ g_npnetscape_funcs->retainobject(object);
+ }
+ if (object_) {
+ g_npnetscape_funcs->releaseobject(object_);
+ }
+ object_ = object;
+ return *this;
+}
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698