Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 LOG_IF(ERROR, !response) << "Failed to call " << method_name; |
| 740 if (!response) { | 740 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
| |
| 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); | |
| 748 } | 741 } |
| 749 | 742 |
| 750 // Called when the owner key set signal is received. | 743 // Called when the owner key set signal is received. |
| 751 void OwnerKeySetReceived(dbus::Signal* signal) { | 744 void OwnerKeySetReceived(dbus::Signal* signal) { |
| 752 dbus::MessageReader reader(signal); | 745 dbus::MessageReader reader(signal); |
| 753 std::string result_string; | 746 std::string result_string; |
| 754 if (!reader.PopString(&result_string)) { | 747 if (!reader.PopString(&result_string)) { |
| 755 LOG(ERROR) << "Invalid signal: " << signal->ToString(); | 748 LOG(ERROR) << "Invalid signal: " << signal->ToString(); |
| 756 return; | 749 return; |
| 757 } | 750 } |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1162 | 1155 |
| 1163 SessionManagerClient* SessionManagerClient::Create( | 1156 SessionManagerClient* SessionManagerClient::Create( |
| 1164 DBusClientImplementationType type) { | 1157 DBusClientImplementationType type) { |
| 1165 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 1158 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 1166 return new SessionManagerClientImpl(); | 1159 return new SessionManagerClientImpl(); |
| 1167 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type); | 1160 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type); |
| 1168 return new SessionManagerClientStubImpl(); | 1161 return new SessionManagerClientStubImpl(); |
| 1169 } | 1162 } |
| 1170 | 1163 |
| 1171 } // namespace chromeos | 1164 } // namespace chromeos |
| OLD | NEW |