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

Unified Diff: chrome/browser/extensions/api/identity/identity_apitest.cc

Issue 1358783002: Cleanup: Pass std::string as const reference from chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against ToT Created 5 years, 3 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
Index: chrome/browser/extensions/api/identity/identity_apitest.cc
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc
index f72177ad8de80ace1a3148ed6fbed544b1e096d2..93028b4179f3082d5bdebefd8bbdb3d6b67b7479 100644
--- a/chrome/browser/extensions/api/identity/identity_apitest.cc
+++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -396,7 +396,7 @@ class MockQueuedMintRequest : public IdentityMintRequestQueue::Request {
MOCK_METHOD1(StartMintToken, void(IdentityMintRequestQueue::MintType));
};
-gaia::AccountIds CreateIds(std::string email, std::string obfid) {
+gaia::AccountIds CreateIds(const std::string& email, const std::string& obfid) {
gaia::AccountIds ids;
ids.account_key = email;
ids.email = email;
@@ -670,11 +670,11 @@ class GetAuthTokenFunctionTest : public IdentityTestWithSignin {
command_line->AppendSwitch(switches::kExtensionsMultiAccount);
}
- void IssueLoginRefreshTokenForAccount(const std::string account_key) {
+ void IssueLoginRefreshTokenForAccount(const std::string& account_key) {
token_service_->UpdateCredentials(account_key, "refresh_token");
}
- void IssueLoginAccessTokenForAccount(const std::string account_key) {
+ void IssueLoginAccessTokenForAccount(const std::string& account_key) {
token_service_->IssueAllTokensForAccount(
account_key,
"access_token-" + account_key,
@@ -738,10 +738,10 @@ class GetAuthTokenFunctionTest : public IdentityTestWithSignin {
id_api()->SetCachedToken(key, token_data);
}
- const IdentityTokenCacheValue& GetCachedToken(std::string account_id) {
- if (account_id.empty())
- account_id = GetPrimaryAccountId();
- ExtensionTokenKey key(extension_id_, account_id, oauth_scopes_);
+ const IdentityTokenCacheValue& GetCachedToken(const std::string& account_id) {
+ ExtensionTokenKey key(
+ extension_id_, account_id.empty() ? GetPrimaryAccountId() : account_id,
+ oauth_scopes_);
return id_api()->GetCachedToken(key);
}

Powered by Google App Engine
This is Rietveld 408576698