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

Unified Diff: chromeos/dbus/auth_policy_client.cc

Issue 2726133003: AuthPolicyClient: Remove fallback to string (Closed)
Patch Set: Created 3 years, 10 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/auth_policy_client.cc
diff --git a/chromeos/dbus/auth_policy_client.cc b/chromeos/dbus/auth_policy_client.cc
index 9ff1ea4cb34b2bbda353760619576299293f6c1f..a4f58c519e77fff2097876f07995e418635f0d8c 100644
--- a/chromeos/dbus/auth_policy_client.cc
+++ b/chromeos/dbus/auth_policy_client.cc
@@ -131,16 +131,11 @@ class AuthPolicyClientImpl : public AuthPolicyClient {
}
dbus::MessageReader reader(response);
const authpolicy::ErrorType error(GetErrorFromReader(&reader));
- if (reader.PopArrayOfBytesAsProto(&account_data)) {
- callback.Run(error, account_data);
+ if (!reader.PopArrayOfBytesAsProto(&account_data)) {
+ DLOG(ERROR) << "Failed to parse protobuf.";
Thiemo Nagel 2017/03/21 13:30:01 Nit: Why not use LOG(ERROR)?
Roman Sorokin (ftl) 2017/03/21 13:43:00 Just not to bloat the binary. Should probably dele
Thiemo Nagel 2017/03/21 13:45:37 Sounds good.
+ callback.Run(authpolicy::ErrorType::ERROR_DBUS_FAILURE, account_data);
return;
}
- DLOG(WARNING) << "Failed to parse protobuf. Fallback to string";
- // TODO(rsorokin): Remove once both ChromiumOS and Chromium use protobuf.
- std::string account_id;
- if (!reader.PopString(&account_id))
- DLOG(ERROR) << "Auth: Failed to get user_id from the response";
- account_data.set_account_id(account_id);
callback.Run(error, account_data);
}
« 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