Fix clang-tidy performance warnings in libweaved.

* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: I36db541ef5b063bc59ef639097119dc488936d5a
diff --git a/buffet/shill_client.cc b/buffet/shill_client.cc
index afaebba..eb75901 100644
--- a/buffet/shill_client.cc
+++ b/buffet/shill_client.cc
@@ -185,7 +185,8 @@
 }
 
 void ShillClient::ConnectToServiceError(
-    std::shared_ptr<org::chromium::flimflam::ServiceProxy> connecting_service) {
+    const std::shared_ptr<org::chromium::flimflam::ServiceProxy>&
+        connecting_service) {
   if (connecting_service != connecting_service_ ||
       connect_done_callback_.is_null()) {
     return;
diff --git a/buffet/shill_client.h b/buffet/shill_client.h
index 63cdd98..ea63bed 100644
--- a/buffet/shill_client.h
+++ b/buffet/shill_client.h
@@ -107,7 +107,7 @@
   void CleanupConnectingService();
 
   void ConnectToServiceError(
-      std::shared_ptr<org::chromium::flimflam::ServiceProxy>
+      const std::shared_ptr<org::chromium::flimflam::ServiceProxy>&
           connecting_service);
 
   const scoped_refptr<dbus::Bus> bus_;
diff --git a/common/binder_utils.cc b/common/binder_utils.cc
index 44f1c59..3c334f5 100644
--- a/common/binder_utils.cc
+++ b/common/binder_utils.cc
@@ -28,7 +28,8 @@
       1, android::String8{error->get()->GetMessage().c_str()});
 }
 
-bool StatusToError(android::binder::Status status, brillo::ErrorPtr* error) {
+bool StatusToError(const android::binder::Status& status,
+                   brillo::ErrorPtr* error) {
   if (status.isOk())
     return true;
   brillo::Error::AddTo(error, FROM_HERE, "binder",
diff --git a/common/binder_utils.h b/common/binder_utils.h
index 3aa5eda..2764aa6 100644
--- a/common/binder_utils.h
+++ b/common/binder_utils.h
@@ -41,7 +41,8 @@
 // Converts a binder status code to a Brillo error object. Returns true if the
 // status was isOk(), otherwise returns false and provides error information
 // in the |error| object.
-bool StatusToError(android::binder::Status status, brillo::ErrorPtr* error);
+bool StatusToError(const android::binder::Status& status,
+                   brillo::ErrorPtr* error);
 
 // Converts binder's UTF16 string into a regular UTF8-encoded standard string.
 inline std::string ToString(const android::String16& value) {
diff --git a/libweaved/command.cc b/libweaved/command.cc
index fc2a88d..bf64db9 100644
--- a/libweaved/command.cc
+++ b/libweaved/command.cc
@@ -154,7 +154,7 @@
   return Abort(error_code, command_error->GetMessage(), error);
 }
 
-bool Command::AbortWithCustomError(android::binder::Status status,
+bool Command::AbortWithCustomError(const android::binder::Status& status,
                                    brillo::ErrorPtr* error) {
   std::string error_code = BinderExceptionString(status.exceptionCode());
   return Abort(error_code, status.exceptionMessage().string(), error);
@@ -182,7 +182,7 @@
   return SetError(error_code, command_error->GetMessage(), error);
 }
 
-bool Command::SetCustomError(android::binder::Status status,
+bool Command::SetCustomError(const android::binder::Status& status,
                              brillo::ErrorPtr* error) {
   std::string error_code = BinderExceptionString(status.exceptionCode());
   return SetError(error_code, status.exceptionMessage().string(), error);
diff --git a/libweaved/command.h b/libweaved/command.h
index e6ffe57..9bbe63e 100644
--- a/libweaved/command.h
+++ b/libweaved/command.h
@@ -108,7 +108,7 @@
                             brillo::ErrorPtr* error);
   // AbortWithCustomError overload for specifying the error information as
   // binder::Status.
-  bool AbortWithCustomError(android::binder::Status status,
+  bool AbortWithCustomError(const android::binder::Status& status,
                             brillo::ErrorPtr* error);
 
   // Cancels command execution.
@@ -133,7 +133,7 @@
   bool SetCustomError(const brillo::Error* command_error,
                       brillo::ErrorPtr* error);
   // SetError overload for specifying the error information as binder::Status.
-  bool SetCustomError(android::binder::Status status,
+  bool SetCustomError(const android::binder::Status& status,
                       brillo::ErrorPtr* error);
 
  protected: