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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc

Issue 635013003: Expose data reduction proxy auth token for internal builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head Created 6 years, 2 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
« no previous file with comments | « components/data_reduction_proxy/core/browser/BUILD.gn ('k') | google_apis/google_api_keys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc
index 12929ad8ac0a419693c92c74492db3ed87e16ec3..f130f9f8ded7d39488d12bb064b0aa708f3aa671 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc
@@ -23,6 +23,10 @@
#include "net/url_request/url_request.h"
#include "url/gurl.h"
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#include "google_apis/google_api_keys.h"
+#endif
+
namespace data_reduction_proxy {
// The empty version for the authentication protocol. Currently used by
@@ -213,10 +217,18 @@ std::string DataReductionProxyAuthRequestHandler::GetDefaultKey() const {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
std::string key =
command_line.GetSwitchValueASCII(switches::kDataReductionProxyKey);
+// Android and iOS get the default key from a preprocessor constant. All other
+// platforms get the key from google_apis
+#if defined(OS_ANDROID) || defined(OS_IOS)
#if defined(SPDY_PROXY_AUTH_VALUE)
if (key.empty())
key = SPDY_PROXY_AUTH_VALUE;
#endif
+#else
+ if (key.empty()) {
+ key = google_apis::GetSpdyProxyAuthValue();
+ }
+#endif // defined(OS_ANDROID) || defined(OS_IOS)
return key;
}
« no previous file with comments | « components/data_reduction_proxy/core/browser/BUILD.gn ('k') | google_apis/google_api_keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698