Commit a4c6031a authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Remove const in some methods of ChromeIdentityService 5/5

The goal of those 5 patches is to remove const on the following methods:
 * IsValidIdentity()
 * GetIdentityWithEmail()
 * GetIdentityWithGaiaID()
 * GetCanonicalizeEmailsForAllIdentities()
 * HasIdentities()
 * GetAllIdentities()
 * GetAllIdentitiesSortedForDisplay()

This is required for crrev.com/i/3208484, to not start async identity
fetch in ChromeIdentityServiceImpl instance when the cache is not
populated.

 * crrev.com/c/2345305 Add temporary methods
 * crrev.com/i/3201649 Switch to the temporary methods
 * crrev.com/c/2345146 Remove const in the methods
 * crrev.com/i/3201650 Switch back the original methods
=> crrev.com/c/2344467 Remove temporary methods

Bug: 897470
Change-Id: If54582a6b206672cc0148433a6031182233447d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2344467Reviewed-by: default avatarNohemi Fernandez <fernandex@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797221}
parent dd461994
...@@ -154,38 +154,28 @@ class ChromeIdentityService { ...@@ -154,38 +154,28 @@ class ChromeIdentityService {
// Returns YES if |identity| is valid and if the service has it in its list of // Returns YES if |identity| is valid and if the service has it in its list of
// identitites. // identitites.
virtual bool IsValidIdentity(ChromeIdentity* identity); virtual bool IsValidIdentity(ChromeIdentity* identity);
virtual bool IsValidIdentityTemporary(ChromeIdentity* identity) const;
// Returns the chrome identity having the email equal to |email| or |nil| if // Returns the chrome identity having the email equal to |email| or |nil| if
// no matching identity is found. // no matching identity is found.
virtual ChromeIdentity* GetIdentityWithEmail(const std::string& email); virtual ChromeIdentity* GetIdentityWithEmail(const std::string& email);
virtual ChromeIdentity* GetIdentityWithEmailTemporary(
const std::string& email) const;
// Returns the chrome identity having the gaia ID equal to |gaia_id| or |nil| // Returns the chrome identity having the gaia ID equal to |gaia_id| or |nil|
// if no matching identity is found. // if no matching identity is found.
virtual ChromeIdentity* GetIdentityWithGaiaID(const std::string& gaia_id); virtual ChromeIdentity* GetIdentityWithGaiaID(const std::string& gaia_id);
virtual ChromeIdentity* GetIdentityWithGaiaIDTemporary(
const std::string& gaia_id) const;
// Returns the canonicalized emails for all identities. // Returns the canonicalized emails for all identities.
virtual std::vector<std::string> GetCanonicalizeEmailsForAllIdentities(); virtual std::vector<std::string> GetCanonicalizeEmailsForAllIdentities();
virtual std::vector<std::string>
GetCanonicalizeEmailsForAllIdentitiesTemporary() const;
// Returns true if there is at least one identity. // Returns true if there is at least one identity.
virtual bool HasIdentities(); virtual bool HasIdentities();
virtual bool HasIdentitiesTemporary() const;
// Returns all ChromeIdentity objects in an array. // Returns all ChromeIdentity objects in an array.
virtual NSArray* GetAllIdentities(); virtual NSArray* GetAllIdentities();
virtual NSArray* GetAllIdentitiesTemporary() const;
// Returns all ChromeIdentity objects sorted by the ordering used in the // Returns all ChromeIdentity objects sorted by the ordering used in the
// account manager, which is typically based on the keychain ordering of // account manager, which is typically based on the keychain ordering of
// accounts. // accounts.
virtual NSArray* GetAllIdentitiesSortedForDisplay(); virtual NSArray* GetAllIdentitiesSortedForDisplay();
virtual NSArray* GetAllIdentitiesSortedForDisplayTemporary() const;
// Forgets the given identity on the device. This method logs the user out. // Forgets the given identity on the device. This method logs the user out.
// It is asynchronous because it needs to contact the server to revoke the // It is asynchronous because it needs to contact the server to revoke the
......
...@@ -62,66 +62,33 @@ ChromeIdentityService::CreateChromeIdentityInteractionManager( ...@@ -62,66 +62,33 @@ ChromeIdentityService::CreateChromeIdentityInteractionManager(
} }
bool ChromeIdentityService::IsValidIdentity(ChromeIdentity* identity) { bool ChromeIdentityService::IsValidIdentity(ChromeIdentity* identity) {
return IsValidIdentityTemporary(identity);
}
bool ChromeIdentityService::IsValidIdentityTemporary(
ChromeIdentity* identity) const {
return false; return false;
} }
ChromeIdentity* ChromeIdentityService::GetIdentityWithEmail( ChromeIdentity* ChromeIdentityService::GetIdentityWithEmail(
const std::string& email) { const std::string& email) {
return GetIdentityWithEmailTemporary(email);
}
ChromeIdentity* ChromeIdentityService::GetIdentityWithEmailTemporary(
const std::string& email) const {
return nil; return nil;
} }
ChromeIdentity* ChromeIdentityService::GetIdentityWithGaiaID( ChromeIdentity* ChromeIdentityService::GetIdentityWithGaiaID(
const std::string& gaia_id) { const std::string& gaia_id) {
return GetIdentityWithGaiaIDTemporary(gaia_id);
}
ChromeIdentity* ChromeIdentityService::GetIdentityWithGaiaIDTemporary(
const std::string& gaia_id) const {
return nil; return nil;
} }
std::vector<std::string> std::vector<std::string>
ChromeIdentityService::GetCanonicalizeEmailsForAllIdentities() { ChromeIdentityService::GetCanonicalizeEmailsForAllIdentities() {
return GetCanonicalizeEmailsForAllIdentitiesTemporary();
}
std::vector<std::string>
ChromeIdentityService::GetCanonicalizeEmailsForAllIdentitiesTemporary() const {
return std::vector<std::string>(); return std::vector<std::string>();
} }
bool ChromeIdentityService::HasIdentities() { bool ChromeIdentityService::HasIdentities() {
return HasIdentitiesTemporary();
}
bool ChromeIdentityService::HasIdentitiesTemporary() const {
return false; return false;
} }
NSArray* ChromeIdentityService::GetAllIdentities() { NSArray* ChromeIdentityService::GetAllIdentities() {
return GetAllIdentitiesTemporary();
}
NSArray* ChromeIdentityService::GetAllIdentitiesTemporary() const {
return nil; return nil;
} }
NSArray* ChromeIdentityService::GetAllIdentitiesSortedForDisplay() { NSArray* ChromeIdentityService::GetAllIdentitiesSortedForDisplay() {
return GetAllIdentitiesSortedForDisplayTemporary();
}
NSArray* ChromeIdentityService::GetAllIdentitiesSortedForDisplayTemporary()
const {
return nil; return nil;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment