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

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: Fixed clang error. 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..deb13c85ee1ada176448b4016748db1cab0a8844 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);
}
+scoped_NPObject::scoped_NPObject() : object_(NULL) { }
+
+scoped_NPObject::~scoped_NPObject() {
+ replace(NULL);
+}
+
+void scoped_NPObject::replace(NPObject* object) {
+ if (object_) {
+ g_npnetscape_funcs->releaseobject(object_);
+ }
+ object_ = object;
+ if (object_) {
+ g_npnetscape_funcs->retainobject(object_);
+ }
+}
+
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698