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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc

Issue 430643002: Correcting the version field in the Chrome-Proxy header to be the chromium build and patch number. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trybot test fix Created 6 years, 4 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/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
index ff30a18f383ea12edb9ae28d0ad7a6c541765d15..1faf4aa86dac7cdd60802adfabafef7347948f27 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
@@ -4,11 +4,14 @@
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
+#include "base/strings/string_split.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/common/chrome_version_info.h"
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h"
@@ -49,3 +52,24 @@ void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial(
"DataReductionProxyEnabled",
data_reduction_proxy_enabled ? "true" : "false");
}
+
+// static
+std::string DataReductionProxyChromeSettings::GetBuildAndPatchNumber() {
+ chrome::VersionInfo version_info;
+ std::vector<std::string> version_parts;
+ base::SplitString(version_info.Version(), '.', &version_parts);
+ if (version_parts.size() != 4)
+ return "";
+ return version_parts[2] + version_parts[3];
+}
+
+// static
+std::string DataReductionProxyChromeSettings::GetClient() {
+#if defined(OS_ANDROID)
+ return data_reduction_proxy::kClientChromeAndroid;
+#elif defined(OS_IOS)
+ return data_reduction_proxy::kClientChromeIOS;
+#else
+ return "";
+#endif
+}

Powered by Google App Engine
This is Rietveld 408576698