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

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

Issue 2640323002: Check error returned from RefreshPolicy calls (Closed)
Patch Set: Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "chromeos/dbus/auth_policy_client.h" 4 #include "chromeos/dbus/auth_policy_client.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "components/signin/core/account_id/account_id.h" 8 #include "components/signin/core/account_id/account_id.h"
9 #include "dbus/bus.h" 9 #include "dbus/bus.h"
10 #include "dbus/message.h" 10 #include "dbus/message.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 private: 93 private:
94 void HandleRefreshPolicyCallback(const RefreshPolicyCallback& callback, 94 void HandleRefreshPolicyCallback(const RefreshPolicyCallback& callback,
95 dbus::Response* response) { 95 dbus::Response* response) {
96 if (!response) { 96 if (!response) {
97 DLOG(ERROR) << "RefreshDevicePolicy: failed to call to authpolicy"; 97 DLOG(ERROR) << "RefreshDevicePolicy: failed to call to authpolicy";
98 callback.Run(false); 98 callback.Run(false);
99 return; 99 return;
100 } 100 }
101 callback.Run(true); 101 dbus::MessageReader reader(response);
102 callback.Run(GetErrorFromReader(&reader) == authpolicy::ERROR_NONE);
102 } 103 }
103 104
104 void HandleJoinCallback(const JoinCallback& callback, 105 void HandleJoinCallback(const JoinCallback& callback,
105 dbus::Response* response) { 106 dbus::Response* response) {
106 if (!response) { 107 if (!response) {
107 DLOG(ERROR) << "Join: Couldn't call to authpolicy"; 108 DLOG(ERROR) << "Join: Couldn't call to authpolicy";
108 callback.Run(authpolicy::ERROR_DBUS_FAILURE); 109 callback.Run(authpolicy::ERROR_DBUS_FAILURE);
109 return; 110 return;
110 } 111 }
111 112
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 AuthPolicyClient::AuthPolicyClient() {} 144 AuthPolicyClient::AuthPolicyClient() {}
144 145
145 AuthPolicyClient::~AuthPolicyClient() {} 146 AuthPolicyClient::~AuthPolicyClient() {}
146 147
147 // static 148 // static
148 AuthPolicyClient* AuthPolicyClient::Create() { 149 AuthPolicyClient* AuthPolicyClient::Create() {
149 return new AuthPolicyClientImpl(); 150 return new AuthPolicyClientImpl();
150 } 151 }
151 152
152 } // namespace chromeos 153 } // 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