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

Side by Side Diff: components/signin/core/account_id/account_id.h

Issue 2452053002: Rename AccountId method GetGaiaIdKey() to GetAccountIdKey(). (Closed)
Patch Set: Updated comments Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef COMPONENTS_SIGNIN_CORE_ACCOUNT_ID_ACCOUNT_ID_H_ 5 #ifndef COMPONENTS_SIGNIN_CORE_ACCOUNT_ID_ACCOUNT_ID_H_
6 #define COMPONENTS_SIGNIN_CORE_ACCOUNT_ID_ACCOUNT_ID_H_ 6 #define COMPONENTS_SIGNIN_CORE_ACCOUNT_ID_ACCOUNT_ID_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 15 matching lines...) Expand all
26 bool operator!=(const AccountId& other) const; 26 bool operator!=(const AccountId& other) const;
27 bool operator<(const AccountId& right) const; 27 bool operator<(const AccountId& right) const;
28 28
29 // empty() is deprecated. Use !is_valid() instead. 29 // empty() is deprecated. Use !is_valid() instead.
30 bool empty() const; 30 bool empty() const;
31 bool is_valid() const; 31 bool is_valid() const;
32 void clear(); 32 void clear();
33 33
34 const std::string& GetAccountType() const; 34 const std::string& GetAccountType() const;
35 const std::string& GetGaiaId() const; 35 const std::string& GetGaiaId() const;
36 // Users of AccountId should make no assumptions on the format of email.
37 // I.e. it cannot be used as account identifier, because it is (in general)
38 // non-comparable.
36 const std::string& GetUserEmail() const; 39 const std::string& GetUserEmail() const;
37 40
38 // This returns prefixed GaiaId string to be used as a storage key. 41 // This returns prefixed some string that can be used as a storage key.
39 const std::string GetGaiaIdKey() const; 42 // You should make no assumptions on the format of this string.
43 const std::string GetAccountIdKey() const;
40 44
41 void SetGaiaId(const std::string& gaia_id); 45 void SetGaiaId(const std::string& gaia_id);
42 void SetUserEmail(const std::string& email); 46 void SetUserEmail(const std::string& email);
43 47
44 // This method is to be used during transition period only. 48 // This method is to be used during transition period only.
45 static AccountId FromUserEmail(const std::string& user_email); 49 static AccountId FromUserEmail(const std::string& user_email);
46 // This method is to be used during transition period only. 50 // This method is to be used during transition period only.
47 static AccountId FromGaiaId(const std::string& gaia_id); 51 static AccountId FromGaiaId(const std::string& gaia_id);
48 // This method is the preferred way to construct AccountId if you have 52 // This method is the preferred way to construct AccountId if you have
49 // full account information. 53 // full account information.
(...skipping 23 matching lines...) Expand all
73 77
74 // Implement hashing of AccountId, so it can be used as a key in STL containers. 78 // Implement hashing of AccountId, so it can be used as a key in STL containers.
75 template <> 79 template <>
76 struct hash<AccountId> { 80 struct hash<AccountId> {
77 std::size_t operator()(const AccountId& user_id) const; 81 std::size_t operator()(const AccountId& user_id) const;
78 }; 82 };
79 83
80 } // namespace BASE_HASH_NAMESPACE 84 } // namespace BASE_HASH_NAMESPACE
81 85
82 #endif // COMPONENTS_SIGNIN_CORE_ACCOUNT_ID_ACCOUNT_ID_H_ 86 #endif // COMPONENTS_SIGNIN_CORE_ACCOUNT_ID_ACCOUNT_ID_H_
OLDNEW
« no previous file with comments | « chromeos/login/auth/cryptohome_authenticator.cc ('k') | components/signin/core/account_id/account_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698