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

Unified Diff: chromeos/dbus/session_manager_client.cc

Issue 2887323002: Do not read redundant output param for StorePolicy DBus call family. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/session_manager_client.cc
diff --git a/chromeos/dbus/session_manager_client.cc b/chromeos/dbus/session_manager_client.cc
index 41c9785eac3e23ee01509627ba51aec2c77e31aa..ec0f11cf71e561b0e77f27f0901de42a0cb5fdd4 100644
--- a/chromeos/dbus/session_manager_client.cc
+++ b/chromeos/dbus/session_manager_client.cc
@@ -736,15 +736,8 @@ class SessionManagerClientImpl : public SessionManagerClient {
void OnStorePolicy(const std::string& method_name,
const StorePolicyCallback& callback,
dbus::Response* response) {
- bool success = false;
- if (!response) {
- LOG(ERROR) << "Failed to call " << method_name;
- } else {
- dbus::MessageReader reader(response);
- if (!reader.PopBool(&success))
- LOG(ERROR) << "Invalid response: " << response->ToString();
- }
- callback.Run(success);
+ LOG_IF(ERROR, !response) << "Failed to call " << method_name;
+ callback.Run(bool(response));
Daniel Erat 2017/05/18 16:32:27 i think we usually avoid using c-style casts. woul
hidehiko 2017/05/18 16:54:27 Good catch! It is bool ctor, but can be interprete
}
// Called when the owner key set signal is received.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698