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

Side by Side Diff: chromeos/dbus/session_manager_client.cc

Issue 2887323002: Do not read redundant output param for StorePolicy DBus call family. (Closed)
Patch Set: Use var. 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/session_manager_client.h" 5 #include "chromeos/dbus/session_manager_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 callback.Run(std::string(), response_type); 729 callback.Run(std::string(), response_type);
730 730
731 LogPolicyResponseUma(method_name, response_type); 731 LogPolicyResponseUma(method_name, response_type);
732 } 732 }
733 733
734 // Called when kSessionManagerStorePolicy or kSessionManagerStorePolicyForUser 734 // Called when kSessionManagerStorePolicy or kSessionManagerStorePolicyForUser
735 // method is complete. 735 // method is complete.
736 void OnStorePolicy(const std::string& method_name, 736 void OnStorePolicy(const std::string& method_name,
737 const StorePolicyCallback& callback, 737 const StorePolicyCallback& callback,
738 dbus::Response* response) { 738 dbus::Response* response) {
739 bool success = false; 739 bool success = response != nullptr;
740 if (!response) { 740 LOG_IF(ERROR, !success) << "Failed to call " << method_name;
741 LOG(ERROR) << "Failed to call " << method_name;
742 } else {
743 dbus::MessageReader reader(response);
744 if (!reader.PopBool(&success))
745 LOG(ERROR) << "Invalid response: " << response->ToString();
746 }
747 callback.Run(success); 741 callback.Run(success);
748 } 742 }
749 743
750 // Called when the owner key set signal is received. 744 // Called when the owner key set signal is received.
751 void OwnerKeySetReceived(dbus::Signal* signal) { 745 void OwnerKeySetReceived(dbus::Signal* signal) {
752 dbus::MessageReader reader(signal); 746 dbus::MessageReader reader(signal);
753 std::string result_string; 747 std::string result_string;
754 if (!reader.PopString(&result_string)) { 748 if (!reader.PopString(&result_string)) {
755 LOG(ERROR) << "Invalid signal: " << signal->ToString(); 749 LOG(ERROR) << "Invalid signal: " << signal->ToString();
756 return; 750 return;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 1156
1163 SessionManagerClient* SessionManagerClient::Create( 1157 SessionManagerClient* SessionManagerClient::Create(
1164 DBusClientImplementationType type) { 1158 DBusClientImplementationType type) {
1165 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 1159 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
1166 return new SessionManagerClientImpl(); 1160 return new SessionManagerClientImpl();
1167 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type); 1161 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type);
1168 return new SessionManagerClientStubImpl(); 1162 return new SessionManagerClientStubImpl();
1169 } 1163 }
1170 1164
1171 } // namespace chromeos 1165 } // namespace chromeos
OLDNEW
« 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