From 6d610bbe20885750ca2e689af59910c592208620 Mon Sep 17 00:00:00 2001 From: "tbreisacher@chromium.org" Date: Thu, 29 Mar 2012 17:22:25 +0000 Subject: Prevent a couple unnecessary copies of Vars CID=12023,12024 BUG=none TEST=compile Review URL: https://chromiumcodereview.appspot.com/9791029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129640 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/client/plugin/chromoting_scriptable_object.cc | 2 +- remoting/client/plugin/chromoting_scriptable_object.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'remoting') diff --git a/remoting/client/plugin/chromoting_scriptable_object.cc b/remoting/client/plugin/chromoting_scriptable_object.cc index a6dbf0e..7e2de5e 100644 --- a/remoting/client/plugin/chromoting_scriptable_object.cc +++ b/remoting/client/plugin/chromoting_scriptable_object.cc @@ -301,7 +301,7 @@ void ChromotingScriptableObject::SendIq(const std::string& message_xml) { } void ChromotingScriptableObject::AddAttribute(const std::string& name, - Var attribute) { + const Var& attribute) { property_names_[name] = properties_.size(); properties_.push_back(PropertyDescriptor(name, attribute)); } diff --git a/remoting/client/plugin/chromoting_scriptable_object.h b/remoting/client/plugin/chromoting_scriptable_object.h index f040ee5..acb8d63 100644 --- a/remoting/client/plugin/chromoting_scriptable_object.h +++ b/remoting/client/plugin/chromoting_scriptable_object.h @@ -153,7 +153,7 @@ class ChromotingScriptableObject typedef pp::Var (ChromotingScriptableObject::*MethodHandler)( const std::vector& args, pp::Var* exception); struct PropertyDescriptor { - PropertyDescriptor(const std::string& n, pp::Var a) + PropertyDescriptor(const std::string& n, const pp::Var& a) : type(NONE), name(n), attribute(a), method(NULL) { } @@ -173,7 +173,7 @@ class ChromotingScriptableObject }; // Routines to add new attribute, method properties. - void AddAttribute(const std::string& name, pp::Var attribute); + void AddAttribute(const std::string& name, const pp::Var& attribute); void AddMethod(const std::string& name, MethodHandler handler); void SignalConnectionInfoChange(int state, int error); -- cgit v1.1