summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-09 06:41:12 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-09 06:41:12 +0000
commit69d7f89d6a93e0fbce451960287066195c6d4ea0 (patch)
tree51c8c1f971d39d652ec38ed76070539bb33e85c7 /google_apis
parente3748a79b523a8d365d4a33ef986eebb4186fa78 (diff)
downloadchromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.zip
chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.gz
chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.bz2
Revert "Rewrite std::string("") to std::string(), Linux edition."
This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6. Revert "Fix build after r193020." This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a. Revert "Really fix build after r193020." This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/gaia_auth_fetcher.cc20
-rw-r--r--google_apis/gaia/gaia_auth_fetcher_unittest.cc53
-rw-r--r--google_apis/gaia/google_service_auth_error.cc2
-rw-r--r--google_apis/gaia/google_service_auth_error_unittest.cc2
-rw-r--r--google_apis/gaia/oauth2_access_token_fetcher_unittest.cc4
-rw-r--r--google_apis/gaia/oauth2_api_call_flow_unittest.cc10
-rw-r--r--google_apis/gaia/oauth2_mint_token_flow.cc17
-rw-r--r--google_apis/gaia/oauth2_mint_token_flow_unittest.cc2
-rw-r--r--google_apis/gaia/oauth_request_signer.cc6
-rw-r--r--google_apis/gaia/oauth_request_signer_unittest.cc84
-rw-r--r--google_apis/google_api_keys.cc29
11 files changed, 105 insertions, 124 deletions
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 15aa78a..9354447 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -617,7 +617,7 @@ void GaiaAuthFetcher::StartClientLogin(
allow_hosted_accounts);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_login_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -635,7 +635,7 @@ void GaiaAuthFetcher::StartIssueAuthToken(const std::string& sid,
request_body_ = MakeIssueAuthTokenBody(sid, lsid, service);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
issue_auth_token_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -669,7 +669,7 @@ void GaiaAuthFetcher::StartRevokeOAuth2Token(const std::string& auth_token) {
request_body_ = MakeRevokeTokenBody(auth_token);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
oauth2_revoke_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -692,7 +692,7 @@ void GaiaAuthFetcher::StartCookieForOAuthLoginTokenExchange(
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_login_to_oauth2_gurl_,
net::LOAD_NORMAL,
this));
@@ -708,7 +708,7 @@ void GaiaAuthFetcher::StartAuthCodeForOAuth2TokenExchange(
request_body_ = MakeGetTokenPairBody(auth_code);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
oauth2_token_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -723,7 +723,7 @@ void GaiaAuthFetcher::StartGetUserInfo(const std::string& lsid) {
request_body_ = MakeGetUserInfoBody(lsid);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
get_user_info_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -748,7 +748,7 @@ void GaiaAuthFetcher::StartMergeSession(const std::string& uber_token) {
request_body_ = MakeMergeSessionBody(uber_token, continue_url, source_);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
merge_session_gurl_,
net::LOAD_NORMAL,
this));
@@ -765,7 +765,7 @@ void GaiaAuthFetcher::StartTokenFetchForUberAuthExchange(
std::string authentication_header =
base::StringPrintf(kOAuthHeaderFormat, access_token.c_str());
fetcher_.reset(CreateGaiaFetcher(getter_,
- std::string(),
+ "",
authentication_header,
uberauth_token_gurl_,
kLoadFlagsIgnoreCookies,
@@ -785,7 +785,7 @@ void GaiaAuthFetcher::StartClientOAuth(const std::string& username,
source_, locale);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_oauth_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -814,7 +814,7 @@ void GaiaAuthFetcher::StartClientOAuthChallengeResponse(
request_body_ = MakeClientOAuthChallengeResponseBody(name, token, solution);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_oauth_gurl_,
kLoadFlagsIgnoreCookies,
this));
diff --git a/google_apis/gaia/gaia_auth_fetcher_unittest.cc b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
index 47b6d15..226ee1a 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -311,10 +311,10 @@ TEST_F(GaiaAuthFetcherTest, ParseRequest) {
RunParsingTest("SID=sid\nLSID=lsid\nAuth=auth\n", "sid", "lsid", "auth");
RunParsingTest("LSID=lsid\nSID=sid\nAuth=auth\n", "sid", "lsid", "auth");
RunParsingTest("SID=sid\nLSID=lsid\nAuth=auth", "sid", "lsid", "auth");
- RunParsingTest("SID=sid\nAuth=auth\n", "sid", std::string(), "auth");
- RunParsingTest("LSID=lsid\nAuth=auth\n", std::string(), "lsid", "auth");
- RunParsingTest("\nAuth=auth\n", std::string(), std::string(), "auth");
- RunParsingTest("SID=sid", "sid", std::string(), std::string());
+ RunParsingTest("SID=sid\nAuth=auth\n", "sid", "", "auth");
+ RunParsingTest("LSID=lsid\nAuth=auth\n", "", "lsid", "auth");
+ RunParsingTest("\nAuth=auth\n", "", "", "auth");
+ RunParsingTest("SID=sid", "sid", "", "");
}
TEST_F(GaiaAuthFetcherTest, ParseErrorRequest) {
@@ -588,11 +588,7 @@ TEST_F(GaiaAuthFetcherTest, FullTokenFailure) {
MockFetcher mock_fetcher(
issue_auth_token_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- cookies_,
- std::string(),
- net::URLFetcher::GET,
- &auth);
+ net::HTTP_FORBIDDEN, cookies_, "", net::URLFetcher::GET, &auth);
auth.OnURLFetchComplete(&mock_fetcher);
EXPECT_FALSE(auth.HasPendingFetch());
}
@@ -617,11 +613,8 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenSuccess) {
MockFetcher mock_fetcher1(
client_login_to_oauth2_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_OK,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_OK, cookies, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher1);
EXPECT_TRUE(auth.HasPendingFetch());
MockFetcher mock_fetcher2(
@@ -659,11 +652,8 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenClientLoginToOAuth2Failure) {
MockFetcher mock_fetcher(
client_login_to_oauth2_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_FORBIDDEN, cookies, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher);
EXPECT_FALSE(auth.HasPendingFetch());
}
@@ -684,21 +674,15 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenOAuth2TokenPairFailure) {
MockFetcher mock_fetcher1(
client_login_to_oauth2_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_OK,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_OK, cookies, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher1);
EXPECT_TRUE(auth.HasPendingFetch());
MockFetcher mock_fetcher2(
oauth2_token_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- cookies_,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_FORBIDDEN, cookies_, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher2);
EXPECT_FALSE(auth.HasPendingFetch());
}
@@ -826,7 +810,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthSuccess) {
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
scopes.push_back("https://some.other.scope.com");
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
std::string expected_text = base::StringPrintf(
"{"
@@ -858,8 +842,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthWithQuote) {
GaiaAuthFetcher auth(&consumer, "te\"sts", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back("https://some.\"other.scope.com");
- auth.StartClientOAuth(
- "user\"name", "pass\"word", scopes, std::string(), "e\"n");
+ auth.StartClientOAuth("user\"name", "pass\"word", scopes, "", "e\"n");
std::string expected_text = base::StringPrintf(
"{"
@@ -896,7 +879,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthBadAuth) {
GaiaAuthFetcher auth(&consumer, "tests", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
}
TEST_F(GaiaAuthFetcherTest, ClientOAuthCaptchaChallenge) {
@@ -925,7 +908,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthCaptchaChallenge) {
GaiaAuthFetcher auth(&consumer, "tests", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
}
TEST_F(GaiaAuthFetcherTest, ClientOAuthTwoFactorChallenge) {
@@ -953,7 +936,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthTwoFactorChallenge) {
GaiaAuthFetcher auth(&consumer, "tests", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
}
TEST_F(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess) {
diff --git a/google_apis/gaia/google_service_auth_error.cc b/google_apis/gaia/google_service_auth_error.cc
index 96fc063..8beeb4d 100644
--- a/google_apis/gaia/google_service_auth_error.cc
+++ b/google_apis/gaia/google_service_auth_error.cc
@@ -225,7 +225,7 @@ DictionaryValue* GoogleServiceAuthError::ToValue() const {
std::string GoogleServiceAuthError::ToString() const {
switch (state_) {
case NONE:
- return std::string();
+ return "";
case INVALID_GAIA_CREDENTIALS:
return "Invalid credentials.";
case USER_NOT_SIGNED_UP:
diff --git a/google_apis/gaia/google_service_auth_error_unittest.cc b/google_apis/gaia/google_service_auth_error_unittest.cc
index 15155b6..59aa510 100644
--- a/google_apis/gaia/google_service_auth_error_unittest.cc
+++ b/google_apis/gaia/google_service_auth_error_unittest.cc
@@ -64,7 +64,7 @@ TEST_F(GoogleServiceAuthErrorTest, CaptchaChallenge) {
EXPECT_TRUE(value->GetDictionary("captcha", &captcha_value));
ASSERT_TRUE(captcha_value);
ExpectDictStringValue("captcha_token", *captcha_value, "token");
- ExpectDictStringValue(std::string(), *captcha_value, "audioUrl");
+ ExpectDictStringValue("", *captcha_value, "audioUrl");
ExpectDictStringValue("http://www.google.com/", *captcha_value, "imageUrl");
ExpectDictStringValue("http://www.bing.com/", *captcha_value, "unlockUrl");
ExpectDictIntegerValue(0, *captcha_value, "imageWidth");
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
index 7c761c7..feb8020 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
@@ -120,7 +120,7 @@ class OAuth2AccessTokenFetcherTest : public testing::Test {
// These four tests time out, see http://crbug.com/113446.
TEST_F(OAuth2AccessTokenFetcherTest, DISABLED_GetAccessTokenRequestFailure) {
- TestURLFetcher* url_fetcher = SetupGetAccessToken(false, 0, std::string());
+ TestURLFetcher* url_fetcher = SetupGetAccessToken(false, 0, "");
EXPECT_CALL(consumer_, OnGetTokenFailure(_)).Times(1);
fetcher_.Start("client_id", "client_secret", "refresh_token", ScopeList());
fetcher_.OnURLFetchComplete(url_fetcher);
@@ -129,7 +129,7 @@ TEST_F(OAuth2AccessTokenFetcherTest, DISABLED_GetAccessTokenRequestFailure) {
TEST_F(OAuth2AccessTokenFetcherTest,
DISABLED_GetAccessTokenResponseCodeFailure) {
TestURLFetcher* url_fetcher =
- SetupGetAccessToken(true, net::HTTP_FORBIDDEN, std::string());
+ SetupGetAccessToken(true, net::HTTP_FORBIDDEN, "");
EXPECT_CALL(consumer_, OnGetTokenFailure(_)).Times(1);
fetcher_.Start("client_id", "client_secret", "refresh_token", ScopeList());
fetcher_.OnURLFetchComplete(url_fetcher);
diff --git a/google_apis/gaia/oauth2_api_call_flow_unittest.cc b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
index 4e8692e..137eaeb 100644
--- a/google_apis/gaia/oauth2_api_call_flow_unittest.cc
+++ b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
@@ -158,8 +158,8 @@ class OAuth2ApiCallFlowTest : public testing::Test {
GURL url(CreateApiUrl());
EXPECT_CALL(*flow_, CreateApiCallBody()).WillOnce(Return(body));
EXPECT_CALL(*flow_, CreateApiCallUrl()).WillOnce(Return(url));
- TestURLFetcher* url_fetcher =
- CreateURLFetcher(url, succeeds, status, std::string());
+ TestURLFetcher* url_fetcher = CreateURLFetcher(
+ url, succeeds, status, "");
EXPECT_CALL(factory_, CreateURLFetcher(_, url, _, _))
.WillOnce(Return(url_fetcher));
return url_fetcher;
@@ -240,7 +240,7 @@ TEST_F(OAuth2ApiCallFlowTest, EmptyAccessTokenFirstApiCallSucceeds) {
std::string at = "access_token";
std::vector<std::string> scopes(CreateTestScopes());
- CreateFlow(rt, std::string(), scopes);
+ CreateFlow(rt, "", scopes);
SetupAccessTokenFetcher(rt, scopes);
TestURLFetcher* url_fetcher = SetupApiCall(true, net::HTTP_OK);
EXPECT_CALL(*flow_, ProcessApiCallSuccess(url_fetcher));
@@ -256,7 +256,7 @@ TEST_F(OAuth2ApiCallFlowTest, EmptyAccessTokenApiCallFails) {
std::string at = "access_token";
std::vector<std::string> scopes(CreateTestScopes());
- CreateFlow(rt, std::string(), scopes);
+ CreateFlow(rt, "", scopes);
SetupAccessTokenFetcher(rt, scopes);
TestURLFetcher* url_fetcher = SetupApiCall(false, net::HTTP_BAD_GATEWAY);
EXPECT_CALL(*flow_, ProcessApiCallFailure(url_fetcher));
@@ -272,7 +272,7 @@ TEST_F(OAuth2ApiCallFlowTest, EmptyAccessTokenNewTokenGenerationFails) {
std::string at = "access_token";
std::vector<std::string> scopes(CreateTestScopes());
- CreateFlow(rt, std::string(), scopes);
+ CreateFlow(rt, "", scopes);
SetupAccessTokenFetcher(rt, scopes);
GoogleServiceAuthError error(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc
index 169d187..42fc4ef 100644
--- a/google_apis/gaia/oauth2_mint_token_flow.cc
+++ b/google_apis/gaia/oauth2_mint_token_flow.cc
@@ -89,16 +89,17 @@ OAuth2MintTokenFlow::Parameters::Parameters(
OAuth2MintTokenFlow::Parameters::~Parameters() {}
-OAuth2MintTokenFlow::OAuth2MintTokenFlow(URLRequestContextGetter* context,
- Delegate* delegate,
- const Parameters& parameters)
- : OAuth2ApiCallFlow(context,
- parameters.login_refresh_token,
- std::string(),
- std::vector<std::string>()),
+OAuth2MintTokenFlow::OAuth2MintTokenFlow(
+ URLRequestContextGetter* context,
+ Delegate* delegate,
+ const Parameters& parameters)
+ : OAuth2ApiCallFlow(
+ context, parameters.login_refresh_token,
+ "", std::vector<std::string>()),
delegate_(delegate),
parameters_(parameters),
- ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {}
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
+}
OAuth2MintTokenFlow::~OAuth2MintTokenFlow() { }
diff --git a/google_apis/gaia/oauth2_mint_token_flow_unittest.cc b/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
index 3206601..e213984 100644
--- a/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
+++ b/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
@@ -272,7 +272,7 @@ TEST_F(OAuth2MintTokenFlowTest, ParseIssueAdviceResponse) {
TEST_F(OAuth2MintTokenFlowTest, ProcessApiCallSuccess) {
{ // No body.
TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL);
- url_fetcher.SetResponseString(std::string());
+ url_fetcher.SetResponseString("");
CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE);
EXPECT_CALL(delegate_, OnMintTokenFailure(_));
flow_->ProcessApiCallSuccess(&url_fetcher);
diff --git a/google_apis/gaia/oauth_request_signer.cc b/google_apis/gaia/oauth_request_signer.cc
index 9952a6f..b5d138f 100644
--- a/google_apis/gaia/oauth_request_signer.cc
+++ b/google_apis/gaia/oauth_request_signer.cc
@@ -89,7 +89,7 @@ std::string BuildBaseString(const GURL& request_base_url,
std::string BuildBaseStringParameters(
const OAuthRequestSigner::Parameters& parameters) {
- std::string result;
+ std::string result = "";
OAuthRequestSigner::Parameters::const_iterator cursor;
OAuthRequestSigner::Parameters::const_iterator limit;
bool first = true;
@@ -297,7 +297,7 @@ bool SignParameters(const GURL& request_base_url,
// static
bool OAuthRequestSigner::Decode(const std::string& text,
std::string* decoded_text) {
- std::string accumulator;
+ std::string accumulator = "";
std::string::const_iterator cursor;
std::string::const_iterator limit;
for (limit = text.end(), cursor = text.begin(); cursor != limit; ++cursor) {
@@ -335,7 +335,7 @@ bool OAuthRequestSigner::Decode(const std::string& text,
// static
std::string OAuthRequestSigner::Encode(const std::string& text) {
- std::string result;
+ std::string result = "";
std::string::const_iterator cursor;
std::string::const_iterator limit;
for (limit = text.end(), cursor = text.begin(); cursor != limit; ++cursor) {
diff --git a/google_apis/gaia/oauth_request_signer_unittest.cc b/google_apis/gaia/oauth_request_signer_unittest.cc
index 40206f6..5cf2dc2 100644
--- a/google_apis/gaia/oauth_request_signer_unittest.cc
+++ b/google_apis/gaia/oauth_request_signer_unittest.cc
@@ -109,15 +109,15 @@ TEST(OAuthRequestSignerTest, SignGet2) {
parameters["oauth_nonce"] = "4d4hZW9DygWQujP2tz06UN";
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::SignURL(
- request_url,
- parameters,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::GET_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ parameters,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::GET_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"https://accounts.google.com/OAuthGetAccessToken"
"?oauth_consumer_key=anonymous"
@@ -137,14 +137,14 @@ TEST(OAuthRequestSignerTest, ParseAndSignGet1) {
"&oauth_timestamp=1308152953");
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::ParseAndSign(
- request_url,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::GET_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::GET_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ("https://www.google.com/accounts/o8/GetOAuthToken"
"?oauth_consumer_key=anonymous"
"&oauth_nonce=2oiE_aHdk5qRTz0L9C8Lq0g"
@@ -164,14 +164,14 @@ TEST(OAuthRequestSignerTest, ParseAndSignGet2) {
"&oauth_nonce=4d4hZW9DygWQujP2tz06UN");
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::ParseAndSign(
- request_url,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::GET_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::GET_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"https://accounts.google.com/OAuthGetAccessToken"
"?oauth_consumer_key=anonymous"
@@ -220,15 +220,15 @@ TEST(OAuthRequestSignerTest, SignPost2) {
parameters["oauth_nonce"] = "17171717171717171";
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::SignURL(
- request_url,
- parameters,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::POST_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ parameters,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::POST_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"oauth_consumer_key=anonymous"
"&oauth_nonce=17171717171717171"
@@ -273,14 +273,14 @@ TEST(OAuthRequestSignerTest, ParseAndSignPost2) {
"&oauth_nonce=17171717171717171");
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::ParseAndSign(
- request_url,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::POST_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::POST_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"oauth_consumer_key=anonymous"
"&oauth_nonce=17171717171717171"
diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc
index c05435e..cd13b9e 100644
--- a/google_apis/google_api_keys.cc
+++ b/google_apis/google_api_keys.cc
@@ -98,25 +98,22 @@ class APIKeyCache {
api_key_ = CalculateKeyValue(GOOGLE_API_KEY,
STRINGIZE_NO_EXPANSION(GOOGLE_API_KEY),
- NULL,
- std::string(),
+ NULL, "",
environment.get(),
command_line);
- std::string default_client_id =
- CalculateKeyValue(GOOGLE_DEFAULT_CLIENT_ID,
- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID),
- NULL,
- std::string(),
- environment.get(),
- command_line);
- std::string default_client_secret =
- CalculateKeyValue(GOOGLE_DEFAULT_CLIENT_SECRET,
- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET),
- NULL,
- std::string(),
- environment.get(),
- command_line);
+ std::string default_client_id = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_ID,
+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID),
+ NULL, "",
+ environment.get(),
+ command_line);
+ std::string default_client_secret = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_SECRET,
+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET),
+ NULL, "",
+ environment.get(),
+ command_line);
// We currently only allow overriding the baked-in values for the
// default OAuth2 client ID and secret using a command-line