summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authortbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-29 17:22:25 +0000
committertbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-29 17:22:25 +0000
commit6d610bbe20885750ca2e689af59910c592208620 (patch)
tree9a8650403db95412ce8f64502d696900770d7eb2 /remoting
parent7c43891761c0833ca2f3d685c0f88972e8188de7 (diff)
downloadchromium_src-6d610bbe20885750ca2e689af59910c592208620.zip
chromium_src-6d610bbe20885750ca2e689af59910c592208620.tar.gz
chromium_src-6d610bbe20885750ca2e689af59910c592208620.tar.bz2
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
Diffstat (limited to 'remoting')
-rw-r--r--remoting/client/plugin/chromoting_scriptable_object.cc2
-rw-r--r--remoting/client/plugin/chromoting_scriptable_object.h4
2 files changed, 3 insertions, 3 deletions
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<pp::Var>& 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);