aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buffet/shill_client.cc3
-rw-r--r--buffet/shill_client.h2
-rw-r--r--common/binder_utils.cc3
-rw-r--r--common/binder_utils.h3
-rw-r--r--libweaved/command.cc4
-rw-r--r--libweaved/command.h4
6 files changed, 11 insertions, 8 deletions
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::Connect(const string& ssid,
}
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 @@ class ShillClient final : public weave::provider::Network,
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 @@ android::binder::Status ToStatus(bool success, weave::ErrorPtr* error) {
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 @@ android::binder::Status ToStatus(bool success, weave::ErrorPtr* error);
// 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 @@ bool Command::AbortWithCustomError(const brillo::Error* command_error,
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 @@ bool Command::SetCustomError(const brillo::Error* command_error,
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 @@ class LIBWEAVED_EXPORT Command final {
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 @@ class LIBWEAVED_EXPORT Command final {
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: