Index: google_apis/google_api_keys.cc |
diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc |
index 06a53e2476f568824c6e6523f14e20f132ea1c4d..2e5766a0225dc70d8b8f1da7c8664795eff7dae2 100644 |
--- a/google_apis/google_api_keys.cc |
+++ b/google_apis/google_api_keys.cc |
@@ -206,6 +206,7 @@ class APIKeyCache { |
} |
std::string api_key() const { return api_key_; } |
+ void set_api_key(std::string api_key) { api_key_ = api_key; } |
Hiroshi Ichikawa
2017/04/13 06:42:55
const std::string&
Same for below.
jzw1
2017/04/14 02:10:32
Done.
Hiroshi Ichikawa
2017/04/14 02:19:44
Looks like this particular one is not fixed yet.
jzw1
2017/04/14 02:28:52
Done.
|
std::string api_key_non_stable() const { return api_key_non_stable_; } |
std::string api_key_remoting() const { return api_key_remoting_; } |
@@ -213,11 +214,17 @@ class APIKeyCache { |
DCHECK_LT(client, CLIENT_NUM_ITEMS); |
return client_ids_[client]; |
} |
+ void SetClientID(std::string client_id, OAuth2Client client) { |
+ client_ids_[client] = client_id; |
+ } |
std::string GetClientSecret(OAuth2Client client) const { |
DCHECK_LT(client, CLIENT_NUM_ITEMS); |
return client_secrets_[client]; |
} |
+ void SetClientSecret(std::string client_secret, OAuth2Client client) { |
+ client_secrets_[client] = client_secret; |
+ } |
std::string GetSpdyProxyAuthValue() { |
#if defined(SPDY_PROXY_AUTH_VALUE) |
@@ -319,6 +326,12 @@ std::string GetRemotingAPIKey() { |
return g_api_key_cache.Get().api_key_remoting(); |
} |
+void SetAPIKey(std::string api_key) { |
+#if defined(OS_MACOSX) |
Hiroshi Ichikawa
2017/04/13 06:42:55
Is this logic MacOS specific? If so, can you make
Eugene But (OOO till 7-30)
2017/04/13 15:06:25
Should this be OS_IOS ?
michaeldo
2017/04/13 19:28:09
Per the comment in the header, the method definiti
jzw1
2017/04/14 02:10:32
I changed to OS_IOS to be more specific
jzw1
2017/04/14 02:10:32
Yep.
jzw1
2017/04/14 02:10:32
Done.
|
+ g_api_key_cache.Get().set_api_key(api_key); |
+#endif |
+} |
+ |
std::string GetOAuth2ClientID(OAuth2Client client) { |
return g_api_key_cache.Get().GetClientID(client); |
} |
@@ -327,6 +340,18 @@ std::string GetOAuth2ClientSecret(OAuth2Client client) { |
return g_api_key_cache.Get().GetClientSecret(client); |
} |
+void SetClientID(std::string client_id, OAuth2Client client) { |
+#if defined(OS_MACOSX) |
michaeldo
2017/04/13 19:28:09
Same comment as SetAPIKey, entire method for SetCl
jzw1
2017/04/14 02:10:32
Done.
|
+ g_api_key_cache.Get().SetClientID(client_id, client); |
+#endif |
+} |
+ |
+void SetClientSecret(std::string client_secret, OAuth2Client client) { |
+#if defined(OS_MACOSX) |
+ g_api_key_cache.Get().SetClientSecret(client_secret, client); |
+#endif |
+} |
+ |
std::string GetSpdyProxyAuthValue() { |
return g_api_key_cache.Get().GetSpdyProxyAuthValue(); |
} |