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

Unified Diff: components/signin/core/account_id/account_id.cc

Issue 2510683002: Overload << operator to allow logging of AccountIds. (Closed)
Patch Set: Add type 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 | « components/signin/core/account_id/account_id.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/account_id/account_id.cc
diff --git a/components/signin/core/account_id/account_id.cc b/components/signin/core/account_id/account_id.cc
index 1ffac80db1e42f94aaeb864a4fffdaef3c82b056..e232ecb965c26628a66adec4e1ad798d5f0588e4 100644
--- a/components/signin/core/account_id/account_id.cc
+++ b/components/signin/core/account_id/account_id.cc
@@ -319,6 +319,16 @@ bool AccountId::Deserialize(const std::string& serialized,
return false;
}
+std::ostream& operator<<(std::ostream& stream, const AccountId& account_id) {
+ stream << "{id: " << account_id.id_ << ", email: " << account_id.user_email_
+ << ", type: "
+ << static_cast<
+ std::underlying_type<decltype(account_id.account_type_)>::type>(
+ account_id.account_type_)
+ << "}";
+ return stream;
+}
+
const AccountId& EmptyAccountId() {
return AccountId::EmptyAccountId::GetInstance()->user_id;
}
« no previous file with comments | « components/signin/core/account_id/account_id.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698