Chromium Code Reviews| Index: google_apis/gaia/gaia_auth_util.cc |
| diff --git a/google_apis/gaia/gaia_auth_util.cc b/google_apis/gaia/gaia_auth_util.cc |
| index 33be5a803c1ebf35f43531cd4dab601c74899f9a..e9ec5454dda76cf34b4895f2f81b843dc6b6c586 100644 |
| --- a/google_apis/gaia/gaia_auth_util.cc |
| +++ b/google_apis/gaia/gaia_auth_util.cc |
| @@ -49,10 +49,16 @@ ListedAccount::ListedAccount() {} |
| ListedAccount::~ListedAccount() {} |
| bool ListedAccount::operator==(const ListedAccount& other) const { |
| - return email == other.email && |
| - gaia_id == other.gaia_id && |
| - valid == other.valid && |
| - raw_email == other.raw_email; |
| + // Only use ids for comparison if they've been computed by some caller, since |
| + // this class does not assign the id. |
| + if (!id.empty() && !other.id.empty()) { |
| + return id == other.id; |
| + } else { |
| + return email == other.email && |
| + gaia_id == other.gaia_id && |
| + valid == other.valid && |
| + raw_email == other.raw_email; |
| + } |
|
Roger Tawa OOO till Jul 10th
2015/06/09 19:16:52
Maybe DHCECK that either both |id|s are set or the
Mike Lerman
2015/06/09 19:29:20
Why? It could very well be that one ListedAccount
Roger Tawa OOO till Jul 10th
2015/06/09 19:33:25
OK, makes sense. I was sure if there was a case w
|
| } |
| std::string CanonicalizeEmail(const std::string& email_address) { |